Exemplo n.º 1
0
        private SinoUC_IM_Text CreateRefTableInput(MD_InputModel_Column _col)
        {
            SinoUC_IM_RefTable _ref = new SinoUC_IM_RefTable(_col.EditFormat);

            _ref.Margin    = new Padding(0, 0, 0, 0);
            _ref.EditValue = GetEntityValue(_col);
            _ref.Anchor    = (AnchorStyles)(AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top);
            return(_ref);
        }
Exemplo n.º 2
0
        private SinoUC_IM_Date CreateDateInput(MD_InputModel_Column _col)
        {
            SinoUC_IM_Date _dateText = new SinoUC_IM_Date();

            _dateText.Margin    = new Padding(0, 0, 0, 0);
            _dateText.EditValue = GetEntityValue(_col);
            _dateText.Anchor    = (AnchorStyles)(AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top);
            return(_dateText);
        }
Exemplo n.º 3
0
        private SinoUC_IM_Number CreateNumberInput(MD_InputModel_Column _col)
        {
            SinoUC_IM_Number _valText = new SinoUC_IM_Number();

            _valText.Margin    = new Padding(0, 0, 0, 0);
            _valText.EditValue = GetEntityValue(_col);
            _valText.Anchor    = (AnchorStyles)(AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top);

            return(_valText);
        }
Exemplo n.º 4
0
 public Dialog_MoveColumnToGroup(List <MD_InputModel_ColumnGroup> groups, MD_InputModel_Column _col)
 {
     InitializeComponent();
     this.comboBoxEdit1.Properties.Items.Clear();
     this.comboBoxEdit1.Properties.Items.Add(new MD_InputModel_ColumnGroup("0", "", "未分组", 0));
     foreach (MD_InputModel_ColumnGroup _g in groups)
     {
         this.comboBoxEdit1.Properties.Items.Add(_g);
     }
 }
Exemplo n.º 5
0
 private object GetEntityValue(MD_InputModel_Column _col)
 {
     if (this.CurrentEntity.InputData.ContainsKey(_col.ColumnName))
     {
         return(this.CurrentEntity.InputData[_col.ColumnName]);
     }
     else
     {
         return(null);
     }
 }
Exemplo n.º 6
0
        private SinoUC_IM_Text CreateOrgInput(MD_InputModel_Column _col)
        {
            SinoUC_IM_Org _orgText = new SinoUC_IM_Org();

            _orgText.InitOrgs();
            _orgText.Margin    = new Padding(0, 0, 0, 0);
            _orgText.EditValue = GetEntityValue(_col);
            _orgText.Anchor    = (AnchorStyles)(AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top);

            return(_orgText);
        }
Exemplo n.º 7
0
 public bool InputModel_MoveColumnToGroup(MD_InputModel_Column Col, MD_InputModel_ColumnGroup InputModel_ColumnGroup)
 {
     try
     {
         OraMetaDataFactroy _of = new OraMetaDataFactroy();
         return(_of.InputModel_MoveColumnToGroup(Col, InputModel_ColumnGroup));
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }
Exemplo n.º 8
0
 public static bool InputModel_MoveColumnToGroup(MD_InputModel_Column _col, MD_InputModel_ColumnGroup InputModelColumnGroup)
 {
     try
     {
         using (SqlConnection cn = SqlHelper.OpenConnection())
         {
             SqlCommand _cmd = new SqlCommand(SQL_InputModel_MoveColumnToGroup, cn);
             _cmd.Parameters.Add("@IVGID", decimal.Parse(InputModelColumnGroup.GroupID));
             _cmd.Parameters.Add("@IVCID", decimal.Parse(_col.ColumnID));
             _cmd.ExecuteNonQuery();
         }
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Exemplo n.º 9
0
 private void DelColumn()
 {
     if (this.gridView1.RowCount > 0 && this.gridView1.FocusedRowHandle >= 0)
     {
         MD_InputModel_Column _col = this.gridView1.GetRow(this.gridView1.FocusedRowHandle) as MD_InputModel_Column;
         if (XtraMessageBox.Show(string.Format("是否确定要删除字段{0}?", _col.ColumnName), "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
             == DialogResult.Yes)
         {
             if (DAConfig.DataAccess.DelInputModelColumn(_col.ColumnID))
             {
                 ReInit();
             }
             else
             {
                 XtraMessageBox.Show("删除失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
 }
Exemplo n.º 10
0
 private void MoveColumn()
 {
     if (this.gridView1.RowCount > 0 && this.gridView1.FocusedRowHandle >= 0)
     {
         MD_InputModel_Column     _col = this.gridView1.GetRow(this.gridView1.FocusedRowHandle) as MD_InputModel_Column;
         Dialog_MoveColumnToGroup _f   = new Dialog_MoveColumnToGroup(this.InputModel.Groups, _col);
         if (_f.ShowDialog() == DialogResult.OK)
         {
             ;
         }
         {
             if (_f.SelectedGroup != null)
             {
                 if (DAConfig.DataAccess.InputModel_MoveColumnToGroup(_col, _f.SelectedGroup))
                 {
                     ReInit();
                 }
             }
         }
     }
 }
Exemplo n.º 11
0
 public bool InputModel_MoveColumnToGroup(MD_InputModel_Column _col, MD_InputModel_ColumnGroup mD_InputModel_ColumnGroup)
 {
     return(MetaDataFactroy.InputModel_MoveColumnToGroup(_col, mD_InputModel_ColumnGroup));
 }
Exemplo n.º 12
0
        /// <summary>
        /// 把数据列存到实体
        /// </summary>
        /// <param name="column"></param>
        /// <param name="entity"></param>
        /// <param name="sinoRequestUser"></param>
        private void SaveInputDataToEntityByColumns(MD_InputModel_Column column, MD_InputEntity entity, SinoRequestUser sinoRequestUser)
        {
            if (entity.InputData == null)
            {
                entity.InputData = new Dictionary <string, string>();
            }
            switch (column.ColumnType)
            {
            case "组织机构":
                //string orgCode = string.IsNullOrEmpty(HttpContext.Current.Request.Form[column.ColumnName]) ? "" : HttpContext.Current.Request.Form[column.ColumnName].ToString();
                string orgCode = string.IsNullOrEmpty("") ? "" : "".ToString();
                if (orgCode.Trim().IndexOf('[') > -1)
                {
                    string code = orgCode.Substring(orgCode.IndexOf('[') + 1, orgCode.IndexOf(']') - orgCode.IndexOf('[') - 1);
                    entity.InputData.Add(column.ColumnName, code);
                }
                else
                {
                    entity.InputData.Add(column.ColumnName, "");
                }
                break;

            case "代码表":
            case "移送管辖移往单位":
            case "派转移往单位":
                //string refCodeList = string.IsNullOrEmpty(HttpContext.Current.Request.Form[column.ColumnName]) ? "" : HttpContext.Current.Request.Form[column.ColumnName].ToString();
                string refCodeList = string.IsNullOrEmpty("") ? "" : "".ToString();
                //先判断是否为多选代码表,暂时判断只要不为空就为多选
                if (!string.IsNullOrEmpty(column.CanEditRule))
                {
                    if (refCodeList.Contains(','))
                    {
                        entity.InputData.Add(column.ColumnName, refCodeList);
                    }
                    else
                    {
                        string code = String.Empty;
                        if (refCodeList.Contains('['))
                        {
                            code = refCodeList.Substring(refCodeList.IndexOf('[') + 1, refCodeList.IndexOf(']') - refCodeList.IndexOf('[') - 1);
                        }
                        else
                        {
                            code = refCodeList;
                        }
                        entity.InputData.Add(column.ColumnName, code);
                    }
                }
                else
                {
                    if (refCodeList.Trim().IndexOf(',') > -1)
                    {
                        entity.InputData.Add(column.ColumnName, refCodeList);
                    }
                    else
                    {
                        if (refCodeList.Length > 1)
                        {
                            int temp = 0;
                            if (int.TryParse(refCodeList, out temp))
                            {
                                entity.InputData.Add(column.ColumnName, refCodeList);
                            }
                            else
                            {
                                string code = refCodeList.Substring(refCodeList.IndexOf('[') + 1, refCodeList.IndexOf(']') - refCodeList.IndexOf('[') - 1);
                                entity.InputData.Add(column.ColumnName, code);
                            }
                        }
                        else
                        {
                            entity.InputData.Add(column.ColumnName, "");
                        }
                    }
                }

                break;

            case "DATE":
            case "日期型":
                //if (!string.IsNullOrEmpty(HttpContext.Current.Request.Form[column.ColumnName]))
                if (!string.IsNullOrEmpty(""))
                {
                    //entity.InputData.Add(column.ColumnName, DateTime.Parse(HttpContext.Current.Request.Form[column.ColumnName]).ToString("s"));
                }
                break;

            case "RADIO":
                //string value = HttpContext.Current.Request.Form[column.ColumnName];
                string value = "";    //
                if (!string.IsNullOrEmpty(value))
                {
                    var array = value.Split(',');
                    entity.InputData.Add(column.ColumnName, array[0]);
                }
                break;

            case "VARCHAR":
            case "字符型":
            case "多行文本":
            case "NUMBER":
            case "数值型":
            case "目标单位":
                switch (column.EditFormat)
                {
                case "当前单位":
                    if (!string.IsNullOrEmpty(""))
                    {
                        //entity.InputData.Add(column.ColumnName, sinoRequestUser.BaseInfo.CurrentPost.PostDwId);
                    }
                    break;

                case "当前用户":
                    //if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["MenuId"]))
                    if (!string.IsNullOrEmpty(""))
                    {
                        entity.InputData.Add(column.ColumnName, sinoRequestUser.BaseInfo.UserId);
                    }
                    break;

                default:
                    if (column.EditFormat.ToUpper() == "HSBM")
                    {
                        //todo:还待处理HSBM保存时只保存HS编码
                        //string code = HttpContext.Current.Request.Form[column.ColumnName];
                        string code = "";
                        if (!string.IsNullOrEmpty(code))
                        {
                            if (code.IsDigit())
                            {
                                entity.InputData.Add(column.ColumnName, code);
                            }
                            else
                            {
                                try
                                {
                                    code = code.Substring(code.IndexOf('[') + 1, code.IndexOf(']') - code.IndexOf('[') - 1);
                                    entity.InputData.Add(column.ColumnName, code);
                                }
                                catch (Exception exception)
                                {
                                    string errorMessage = string.Format("HS编码[{0}]保存时格式异常{1}", code, exception.Message);
                                    //LogClient.WriteSystemLog(errorMessage, "ERROR");
                                }
                            }
                        }
                        else
                        {
                            entity.InputData.Add(column.ColumnName, "");
                        }
                    }
                    else if (column.EditFormat.ToUpper() == "PERSONLIST")
                    {
                        if (column.InputRule == "MutiSelect")
                        {
                            string tempText = "";        // HttpContext.Request.Form[column.ColumnName];

                            if (!string.IsNullOrEmpty(tempText))
                            {
                                if (tempText == column.ToolTipText)
                                {
                                    tempText = "";
                                }
                            }
                            entity.InputData.Add(column.ColumnName, tempText);
                        }
                        else
                        {
                            string userId = "";        // HttpContext.Current.Request.Form[column.ColumnName];
                            entity.InputData.Add(column.ColumnName, !string.IsNullOrEmpty(userId) ? userId : "");
                        }
                    }
                    else
                    {
                        string tempText = "";        // HttpContext.Current.Request.Form[column.ColumnName];

                        if (!string.IsNullOrEmpty(tempText))
                        {
                            if (tempText == column.ToolTipText)
                            {
                                tempText = "";
                            }
                        }
                        entity.InputData.Add(column.ColumnName, tempText);
                    }
                    break;
                }
                break;

            default:
                //entity.InputData.Add(column.ColumnName, (HttpContext.Current.Request.Form[column.ColumnName].LastIndexOf(',') == HttpContext.Current.Request.Form[column.ColumnName].Length - 1) ? HttpContext.Current.Request.Form[column.ColumnName].Substring(0, HttpContext.Current.Request.Form[column.ColumnName].Length - 1) : HttpContext.Current.Request.Form[column.ColumnName]);
                entity.InputData.Add(column.ColumnName, ("".LastIndexOf(',') == "".Length - 1) ? "".Substring(0, "".Length - 1) : "");
                break;
            }
        }
Exemplo n.º 13
0
        private void AddErrorMessage(Dictionary <string, string> errorList, MD_InputModel_Column column)
        {
            string message = string.Format("{0} 不能为空!", column.DisplayName);

            errorList.Add(column.ColumnName, message);
        }
Exemplo n.º 14
0
        private void AddErrorMsg(Dictionary <string, string> ErrorList, MD_InputModel_Column _column)
        {
            string _msg = string.Format("{0} 为必填项!", _column.DisplayName);

            ErrorList.Add(_column.DisplayName, _msg);
        }