| | |
| | | request.ContentType = "application/json"; |
| | | request.Headers.Add("token", GetBasicAuthTicket()); |
| | | request.Accept = "*/*"; |
| | | request.Timeout = 15000; |
| | | request.Timeout = 150000; |
| | | request.AllowAutoRedirect = false; |
| | | request.ServicePoint.Expect100Continue = false; |
| | | wdf.SetCaption(_caption + "(10/100)" + meth); |
| | |
| | | |
| | | txt.Text = strVal; |
| | | } |
| | | |
| | | else |
| | | txt.Text = strVal; |
| | | txt.ReadOnly = isEdt; |
| | |
| | | var txt = colType as MemoEdit; |
| | | if (txt != null) |
| | | txt.Text = strVal; |
| | | txt.ReadOnly = isEdt; |
| | | if (_isRead(txt.Tag)) |
| | | { |
| | | txt.ReadOnly = true; |
| | | } |
| | | else |
| | | txt.ReadOnly = isEdt; |
| | | continue; |
| | | } |
| | | //数字卡 |
| | |
| | | { |
| | | var txt = colType as CheckBox; |
| | | if (txt != null) |
| | | txt.Checked = bool.Parse(strVal); |
| | | switch (strVal) |
| | | { |
| | | case "True": |
| | | txt.Checked = true; |
| | | break; |
| | | case "1": |
| | | txt.Checked = true; |
| | | break; |
| | | case "False": |
| | | txt.Checked = false; |
| | | break; |
| | | default: |
| | | txt.Checked = false; |
| | | break; |
| | | } |
| | | txt.Enabled = !isEdt; |
| | | continue; |
| | | } |
| | | if (colType is CheckEdit) |
| | | { |
| | | var txt = colType as CheckEdit; |
| | | if (txt != null) |
| | | txt.Checked = bool.Parse(strVal); |
| | | txt.ReadOnly = isEdt; |
| | | continue; |
| | | } |
| | | //if (colType is CheckEdit) |
| | | //{ |
| | | // var txt = colType as CheckEdit; |
| | | // if (txt != null) |
| | | // txt.Checked = bool.Parse(strVal); |
| | | // txt.ReadOnly = isEdt; |
| | | // continue; |
| | | //} |
| | | //时间 |
| | | if (colType is DateTimePicker) |
| | | { |
| | |
| | | if (ctrl is TextEdit) |
| | | { |
| | | var txt = ctrl as TextEdit; |
| | | if (_isRead(txt.Tag)) |
| | | { |
| | | txt.ReadOnly = true; |
| | | } |
| | | else |
| | | txt.ReadOnly = isEdt; |
| | | bool _bl = _isRead(txt.Tag, isEdt); |
| | | txt.ReadOnly = _bl; |
| | | // txt.ReadOnly = isEdt; |
| | | continue; |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private static bool _isRead(object obj) |
| | | private static bool _isRead(object obj,bool isEdt=false) |
| | | { |
| | | if (obj != null && obj.ToString().ToUpper().Contains("readOnly".ToUpper())) |
| | | ///永远是只读的 |
| | | if (obj != null && obj.ToString().ToUpper()==("readOnly".ToUpper())) |
| | | { |
| | | return true; |
| | | } |
| | | return false; |
| | | ///永远是可写的 |
| | | if (obj != null && obj.ToString().ToUpper()==("readOnly-1".ToUpper())) |
| | | { |
| | | return false; |
| | | } |
| | | return isEdt; |
| | | } |
| | | /// <summary> |
| | | /// 切换选项卡 |