| | |
| | | txt.Text = strVal; |
| | | } |
| | | } |
| | | |
| | | //自定义仓库 |
| | | if (colType is UcLookCk) |
| | | { |
| | |
| | | if (colType is SimpleButton) |
| | | { |
| | | var txt = colType as SimpleButton; |
| | | txt.Enabled = !isEdt; |
| | | if (txt.Tag != null && txt.Tag.ToString() == "gvBtnAlawys") |
| | | txt.Enabled = true; |
| | | else |
| | | txt.Enabled = !isEdt; |
| | | continue; |
| | | } |
| | | //自定工序 |
| | |
| | | if (colType is UcDictionary) |
| | | { |
| | | var txt = colType as UcDictionary; |
| | | txt.TextTxt = (strVal); |
| | | txt.IsReadly = isEdt; |
| | | continue; |
| | | } |
| | | //自定单据类型下拉 |
| | | if (colType is UcDictionaryComBox) |
| | | { |
| | | var txt = colType as UcDictionaryComBox; |
| | | txt.TextTxt = (strVal); |
| | | txt.IsReadly = isEdt; |
| | | continue; |
| | |
| | | txt.IsReadly = isEdt; |
| | | continue; |
| | | } |
| | | //自定义单据类型下拉 |
| | | if (ctrl is UcDictionaryComBox) |
| | | { |
| | | var txt = ctrl as UcDictionaryComBox; |
| | | //txt.SetIdOrCode("-1"); |
| | | txt.IsReadly = isEdt; |
| | | continue; |
| | | } |
| | | if (ctrl is SimpleButton) |
| | | { |
| | | var txt = ctrl as SimpleButton; |
| | | txt.Enabled = !isEdt; |
| | | if (txt.Tag != null && txt.Tag.ToString() == "gvBtnAlawys") |
| | | txt.Enabled = true; |
| | | else |
| | | txt.Enabled = !isEdt; |
| | | continue; |
| | | } |
| | | } |
| | |
| | | ctrl.Enabled = !isEdt; |
| | | continue; |
| | | } |
| | | // |
| | | if (ctrl is CheckEdit) |
| | | { |
| | | var txt = ctrl as CheckEdit; |
| | |
| | | txt.IsReadly = isEdt; |
| | | continue; |
| | | } |
| | | |
| | | //自定部门 |
| | | if (ctrl is UcLookDepartment) |
| | | { |
| | |
| | | txt.IsReadly = isEdt; |
| | | continue; |
| | | } |
| | | //自定单据类型下拉 |
| | | if (ctrl is UcDictionaryComBox) |
| | | { |
| | | var txt = ctrl as UcDictionaryComBox; |
| | | txt.IsReadly = isEdt; |
| | | continue; |
| | | } |
| | | if (ctrl is SimpleButton) |
| | | { |
| | | var txt = ctrl as SimpleButton; |
| | | txt.Enabled = !isEdt; |
| | | if (txt.Tag != null && txt.Tag.ToString() == "gvBtnAlawys") |
| | | txt.Enabled = true; |
| | | else |
| | | txt.Enabled = !isEdt; |
| | | continue; |
| | | } |
| | | } |
| | |
| | | |
| | | public static FilterEntity getFilterEntityWord(string id, string idDec, string val, string type) |
| | | { |
| | | return new FilterEntity(id, idDec + ")", " like ", "包含)", "%" + val + "%", type); |
| | | switch (type) |
| | | { |
| | | case "Bit类型": |
| | | string _val = (val.ToUpper() == "true".ToUpper() ? "1" : "0"); |
| | | return new FilterEntity(id, idDec + ")", "=", "等于)", "" + _val + "", type); |
| | | break; |
| | | default: |
| | | return new FilterEntity(id, idDec + ")", "like", "包含)", "%" + val + "%", type); |
| | | break; |
| | | } |
| | | |
| | | } |
| | | public static List<FilterEntity> GetDilter(GridColumnCollection Columns, GridView gridView1 = null) |
| | | { |
| | |
| | | ColumnFilterInfo filter = col.FilterInfo; |
| | | if (string.IsNullOrEmpty(filter.FilterString)) |
| | | continue; |
| | | // fiList.Add(new FilterEntity("b.FNumber", "使用组织", " like ", "包含", "%" + filter.Value + "%")); |
| | | string[] ddd = filter.FilterString.Replace("Contains", "").Replace("(", "").Replace(")", "").Replace("'", "").Replace("'", "").Split(','); |
| | | //Contains([fSubsidiary], '005') |
| | | fiList.Add(getFilterEntityWord(col.Tag.ToString(), col.Caption.Trim(), ddd[1].Trim(), col.UnboundExpression)); |
| | | string _filterString = filter.FilterString.Replace("Contains", "").Replace("(", "").Replace(")", "").Replace("'", "").Replace("'", ""); |
| | | string[] ddd = _filterString.Split(','); |
| | | string _val = ""; |
| | | if (ddd.Length > 1) |
| | | { |
| | | _val = ddd[1].Trim(); |
| | | } |
| | | else |
| | | { |
| | | ddd = _filterString.Split('='); |
| | | _val = ddd[1].Trim(); |
| | | } |
| | | fiList.Add(getFilterEntityWord(col.Tag.ToString(), col.Caption.Trim(), _val, col.UnboundExpression)); |
| | | } |
| | | return fiList; |
| | | } |
| | |
| | | case "时间类型": |
| | | _sbSqlWhere.Append(" and CONVERT(nvarchar(30)," + itm.fileId + ",23)" + itm.fileOper + "'" + itm.fileValue + "'"); |
| | | break; |
| | | //case "数值类型": |
| | | // _sbSqlWhere.Append(" and " + itm.fileId + itm.fileOper + "'" + itm.fileValue + "'"); |
| | | // break; |
| | | case "Bit类型": |
| | | _sbSqlWhere.Append(" and isnull(" + itm.fileId + ",0) =" + itm.fileValue + ""); |
| | | break; |
| | | default: |
| | | _sbSqlWhere.Append(" and " + itm.fileId + itm.fileOper + "'" + itm.fileValue + "'"); |
| | | _sbSqlWhere.Append(" and " + itm.fileId + " " + itm.fileOper + " '" + itm.fileValue + "'"); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return _sbSqlWhere.ToString(); |
| | | } |
| | | |
| | | |
| | | public delegate void DelegateGetModel(string guid); |
| | | public delegate void DelegateGetList(int currentPage); |
| | | /// <summary> |
| | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 判断是不是一个有效的数值 |
| | | /// </summary> |
| | | /// <param name="str"></param> |
| | | /// <returns></returns> |
| | | public static bool IsNumeric(string str) |
| | | { |
| | | Regex regex = new Regex("^[0-9]+$"); |
| | | return regex.IsMatch(str); |
| | | } |
| | | /// <summary> |
| | | /// 判断是不是一个有效果的decimal数值 |
| | | /// </summary> |
| | | /// <param name="str"></param> |
| | | /// <returns></returns> |
| | | public static bool IsNumeric2(string str) |
| | | { |
| | | string input = str; |