コード例 #1
0
ファイル: FrmProductTree.cs プロジェクト: seezeef/YS_ERP
        private void tv_AfterSelect(object sender, TreeViewEventArgs e)
        {
            TreeNode node = tv.SelectedNode;

            if (node.Nodes.Count <= 0)
            {
                //MessageBox.Show(node.Name + node.Text);
                BaseProductionProcessTable _currentProductionProcessTable = bProductionProcess.GetModel(node.Name);
                txtCode.Text                 = _currentProductionProcessTable.CODE;
                txtName.Text                 = _currentProductionProcessTable.NAME;
                txtenglishname.Text          = _currentProductionProcessTable.ENGLISHNAME;
                txtDepartment.Text           = _currentProductionProcessTable.DEPARTMENT_NAME;
                txtDepartmentCode.Text       = _currentProductionProcessTable.DEPARTMENT_CODE;
                txtDrawingType1.Text         = _currentProductionProcessTable.DRAWING_TYPE_NAME1;
                txtDrawingType2.Text         = _currentProductionProcessTable.DRAWING_TYPE_NAME2;
                txtDrawingType3.Text         = _currentProductionProcessTable.DRAWING_TYPE_NAME3;
                txtDrawingType4.Text         = _currentProductionProcessTable.DRAWING_TYPE_NAME4;
                txtDrawingType5.Text         = _currentProductionProcessTable.DRAWING_TYPE_NAME5;
                txtDrawingType6.Text         = _currentProductionProcessTable.DRAWING_TYPE_NAME6;
                txtDrawingTypeCode1.Text     = _currentProductionProcessTable.DRAWING_TYPE_CODE1;
                txtDrawingTypeCode2.Text     = _currentProductionProcessTable.DRAWING_TYPE_CODE2;
                txtDrawingTypeCode3.Text     = _currentProductionProcessTable.DRAWING_TYPE_CODE3;
                txtDrawingTypeCode4.Text     = _currentProductionProcessTable.DRAWING_TYPE_CODE4;
                txtDrawingTypeCode5.Text     = _currentProductionProcessTable.DRAWING_TYPE_CODE5;
                txtDrawingTypeCode6.Text     = _currentProductionProcessTable.DRAWING_TYPE_CODE6;
                txtTechnologyCode1.Text      = _currentProductionProcessTable.TECHNOLOGY_CODE1;
                txtTechnologyCode2.Text      = _currentProductionProcessTable.TECHNOLOGY_CODE2;
                txtTechnologyCode3.Text      = _currentProductionProcessTable.TECHNOLOGY_CODE3;
                txtTechnology1.Text          = _currentProductionProcessTable.TECHNOLOGY_NAME1;
                txtTechnology2.Text          = _currentProductionProcessTable.TECHNOLOGY_NAME2;
                txtTechnology3.Text          = _currentProductionProcessTable.TECHNOLOGY_NAME3;
                txtproductioncycle.Text      = _currentProductionProcessTable.PRODUCTION_CYCLE.ToString();
                this.cboStatus.SelectedValue = _currentProductionProcessTable.JUDGMENT;
            }
        }
コード例 #2
0
 /// <summary>
 /// 删除
 /// </summary>
 private void MasterToolBar_DoDelete_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("确定要删除吗?", this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.OK)
     {
         try
         {
             GetCurrentSelectedTable();
             if (_currentProductionProcessTable != null)
             {
                 bProductionProcess.Delete(_currentProductionProcessTable.CODE);
                 Search(this.pgControl.GetCurrentPage());
             }
             else
             {
                 MessageBox.Show("请选择正确的行!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("删除失败,请重试或与系统管理员联系。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
             Logger.Error("订单类型删除失败", ex);
         }
         _currentProductionProcessTable = null;
     }
 }
コード例 #3
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (CheckInput())
     {
         if (_currentProductionProcessTable == null)
         {
             _currentProductionProcessTable = new BaseProductionProcessTable();
         }
         _currentProductionProcessTable.CODE = txtCode.Text.Trim();
         _currentProductionProcessTable.NAME = txtName.Text.Trim();
         //_currentProductionProcessTable.COMPANY_CODE = "01";
         _currentProductionProcessTable.LAST_UPDATE_USER   = _userInfo.CODE;
         _currentProductionProcessTable.ENGLISHNAME        = txtenglishname.Text.Trim();
         _currentProductionProcessTable.DEPARTMENT_CODE    = txtDepartmentCode.Text.Trim();
         _currentProductionProcessTable.DRAWING_TYPE_CODE1 = txtDrawingTypeCode1.Text.Trim();
         _currentProductionProcessTable.DRAWING_TYPE_CODE2 = txtDrawingTypeCode2.Text.Trim();
         _currentProductionProcessTable.DRAWING_TYPE_CODE3 = txtDrawingTypeCode3.Text.Trim();
         _currentProductionProcessTable.DRAWING_TYPE_CODE4 = txtDrawingTypeCode4.Text.Trim();
         _currentProductionProcessTable.DRAWING_TYPE_CODE5 = txtDrawingTypeCode5.Text.Trim();
         _currentProductionProcessTable.DRAWING_TYPE_CODE6 = txtDrawingTypeCode6.Text.Trim();
         _currentProductionProcessTable.PRODUCTION_CYCLE   = CConvert.ToDecimal(txtproductioncycle.Text.Trim());
         _currentProductionProcessTable.ATTRIBUTE1         = "";
         _currentProductionProcessTable.ATTRIBUTE2         = "";
         _currentProductionProcessTable.ATTRIBUTE3         = "";
         _currentProductionProcessTable.TECHNOLOGY_CODE1   = txtTechnologyCode1.Text.Trim();
         _currentProductionProcessTable.TECHNOLOGY_CODE2   = txtTechnologyCode2.Text.Trim();
         _currentProductionProcessTable.TECHNOLOGY_CODE3   = txtTechnologyCode3.Text.Trim();
         _currentProductionProcessTable.JUDGMENT           = cboStatus.SelectedValue.ToString();
         try
         {
             if (bProductionProcess.Exists(txtCode.Text.Trim()))
             {
                 bProductionProcess.Update(_currentProductionProcessTable);
             }
             else
             {
                 _currentProductionProcessTable.CREATE_USER = _userInfo.CODE;
                 bProductionProcess.Add(_currentProductionProcessTable);
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("保存失败,请重新输入!");
             Logger.Error("订单类型保存失败!", ex);
             return;
         }
         result = DialogResult.OK;
         this.Close();
         CCacheData.DrawingType = null;
     }
 }
コード例 #4
0
 private void txtCode_Leave(object sender, EventArgs e)
 {
     //判断编号是否已存在
     if (!(txtCode.Focused))
     {
         BaseProductionProcessTable ProductionProcess = new BaseProductionProcessTable();
         ProductionProcess = bProductionProcess.GetModel(txtCode.Text);
         if (ProductionProcess != null)
         {
             txtCode.Text = "";
             MessageBox.Show("类型编号和订单编号的组合已存在,请重新输入!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
 }
コード例 #5
0
        /// <summary>
        /// 获得当前选中的数据
        /// </summary>
        private void GetCurrentSelectedTable()
        {
            try
            {
                string code = dgvData.SelectedRows[0].Cells["CODE"].Value.ToString();
                if (code != "")
                {
                    _currentProductionProcessTable = bProductionProcess.GetModel(code);
                }
            }
            catch (Exception ex)
            {
                Logger.Error("订单类型中获取当前数据失败!", ex);
            }

            if (_currentProductionProcessTable == null || _currentProductionProcessTable.CODE == null || "".Equals(_currentProductionProcessTable.CODE))
            {
                _currentProductionProcessTable = null;
            }
        }
コード例 #6
0
        /// <summary>
        /// 打开新窗口
        /// </summary>
        private void OpenDialogFrm(int mode)
        {
            if (mode == CConstant.MODE_NEW || _currentProductionProcessTable != null)
            {
                FrmProductionProcessDialog frm = new FrmProductionProcessDialog();
                frm.UserInfo = _userInfo;
                frm.CurrentProductionProcessTable = _currentProductionProcessTable;
                frm.Mode = mode;

                DialogResult resule = frm.ShowDialog(this);
                if (resule == DialogResult.OK && isSearch)
                {
                    Search(this.pgControl.GetCurrentPage());
                }
                frm.Dispose();
            }
            else
            {
                //MessageBox.Show("请选择正确的行!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            _currentProductionProcessTable = null;
        }
コード例 #7
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(BaseProductionProcessTable model)
        {
            StringBuilder strSql = null;
            int           rows   = 0;

            if (IsDelete(model.CODE))
            {
                #region 更新
                strSql = new StringBuilder();
                strSql.Append("update BASE_PRODUCTION_PROCESS set ");
                strSql.Append("NAME=@NAME,");
                strSql.Append("STATUS_FLAG=@STATUS_FLAG,");
                strSql.Append("CREATE_USER=@CREATE_USER,");
                strSql.Append("LAST_UPDATE_USER=@LAST_UPDATE_USER,");
                strSql.Append("LAST_UPDATE_TIME=GETDATE(),");
                strSql.Append("DEPARTMENT_CODE=@DEPARTMENT_CODE,");
                strSql.Append("DRAWING_TYPE_CODE1=@DRAWING_TYPE_CODE1,");
                strSql.Append("DRAWING_TYPE_CODE2=@DRAWING_TYPE_CODE2,");
                strSql.Append("DRAWING_TYPE_CODE3=@DRAWING_TYPE_CODE3,");
                strSql.Append("DRAWING_TYPE_CODE4=@DRAWING_TYPE_CODE4,");
                strSql.Append("DRAWING_TYPE_CODE5=@DRAWING_TYPE_CODE5,");
                strSql.Append("DRAWING_TYPE_CODE6=@DRAWING_TYPE_CODE6,");
                strSql.Append("TECHNOLOGY_CODE1=@TECHNOLOGY_CODE1,");
                strSql.Append("TECHNOLOGY_CODE2=@TECHNOLOGY_CODE2,");
                strSql.Append("TECHNOLOGY_CODE3=@TECHNOLOGY_CODE3,");
                strSql.Append("PRODUCTION_CYCLE=@PRODUCTION_CYCLE,");
                strSql.Append("PROCESS_STATUS=@PROCESS_STATUS");
                strSql.Append(" where CODE=@CODE ");
                SqlParameter[] parameters =
                {
                    new SqlParameter("@CODE",               SqlDbType.VarChar,   20),
                    new SqlParameter("@NAME",               SqlDbType.VarChar,  100),
                    new SqlParameter("@STATUS_FLAG",        SqlDbType.Int,        4),
                    new SqlParameter("@CREATE_USER",        SqlDbType.VarChar,   20),
                    new SqlParameter("@LAST_UPDATE_USER",   SqlDbType.VarChar,   20),
                    new SqlParameter("@DEPARTMENT_CODE",    SqlDbType.VarChar,   20),
                    new SqlParameter("@DRAWING_TYPE_CODE1", SqlDbType.VarChar,   20),
                    new SqlParameter("@DRAWING_TYPE_CODE2", SqlDbType.VarChar,   20),
                    new SqlParameter("@DRAWING_TYPE_CODE3", SqlDbType.VarChar,   20),
                    new SqlParameter("@DRAWING_TYPE_CODE4", SqlDbType.VarChar,   20),
                    new SqlParameter("@DRAWING_TYPE_CODE5", SqlDbType.VarChar,   20),
                    new SqlParameter("@DRAWING_TYPE_CODE6", SqlDbType.VarChar,   20),
                    new SqlParameter("@TECHNOLOGY_CODE1",   SqlDbType.VarChar,   20),
                    new SqlParameter("@TECHNOLOGY_CODE2",   SqlDbType.VarChar,   20),
                    new SqlParameter("@TECHNOLOGY_CODE3",   SqlDbType.VarChar,   20),
                    new SqlParameter("@PRODUCTION_CYCLE",   SqlDbType.Decimal),
                    new SqlParameter("@PROCESS_STATUS",     SqlDbType.VarChar, 20)
                };
                parameters[0].Value  = model.CODE;
                parameters[1].Value  = model.NAME;
                parameters[2].Value  = CConstant.INIT;
                parameters[3].Value  = model.LAST_UPDATE_USER;
                parameters[4].Value  = model.LAST_UPDATE_USER;
                parameters[5].Value  = model.DEPARTMENT_CODE;
                parameters[6].Value  = model.DRAWING_TYPE_CODE1;
                parameters[7].Value  = model.DRAWING_TYPE_CODE2;
                parameters[8].Value  = model.DRAWING_TYPE_CODE3;
                parameters[9].Value  = model.DRAWING_TYPE_CODE4;
                parameters[10].Value = model.DRAWING_TYPE_CODE5;
                parameters[11].Value = model.DRAWING_TYPE_CODE6;
                parameters[12].Value = model.TECHNOLOGY_CODE1;
                parameters[13].Value = model.TECHNOLOGY_CODE2;
                parameters[14].Value = model.TECHNOLOGY_CODE3;
                parameters[15].Value = model.PRODUCTION_CYCLE;
                parameters[16].Value = model.JUDGMENT;
                rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
                #endregion
            }
            else
            {
                #region 增加
                strSql = new StringBuilder();
                strSql.Append("insert into BASE_PRODUCTION_PROCESS(");
                strSql.Append("CODE,NAME,STATUS_FLAG,CREATE_USER,CREATE_DATE_TIME,LAST_UPDATE_USER,LAST_UPDATE_TIME,ENGLISH_NAME,ATTRIBUTE1,ATTRIBUTE2,ATTRIBUTE3,DEPARTMENT_CODE,DRAWING_TYPE_CODE1,PRODUCTION_CYCLE,DRAWING_TYPE_CODE2,DRAWING_TYPE_CODE3,DRAWING_TYPE_CODE4,DRAWING_TYPE_CODE5,DRAWING_TYPE_CODE6,TECHNOLOGY_CODE1,TECHNOLOGY_CODE2,TECHNOLOGY_CODE3,PROCESS_STATUS)");
                strSql.Append(" values (");
                strSql.Append("@CODE,@NAME,@STATUS_FLAG,@CREATE_USER,GETDATE(),@LAST_UPDATE_USER,GETDATE(),@ENGLISH_NAME,@ATTRIBUTE1,@ATTRIBUTE2,@ATTRIBUTE3,@DEPARTMENT_CODE,@DRAWING_TYPE_CODE1,@PRODUCTION_CYCLE,@DRAWING_TYPE_CODE2,@DRAWING_TYPE_CODE3,@DRAWING_TYPE_CODE4,@DRAWING_TYPE_CODE5,@DRAWING_TYPE_CODE6,@TECHNOLOGY_CODE1,@TECHNOLOGY_CODE2,@TECHNOLOGY_CODE3,@PROCESS_STATUS)");
                SqlParameter[] parameters =
                {
                    new SqlParameter("@CODE",               SqlDbType.VarChar,   20),
                    new SqlParameter("@NAME",               SqlDbType.VarChar,  100),
                    new SqlParameter("@STATUS_FLAG",        SqlDbType.Int,        4),
                    new SqlParameter("@CREATE_USER",        SqlDbType.VarChar,   20),
                    new SqlParameter("@LAST_UPDATE_USER",   SqlDbType.VarChar,   20),
                    new SqlParameter("@ENGLISH_NAME",       SqlDbType.VarChar,   20),
                    new SqlParameter("@ATTRIBUTE1",         SqlDbType.VarChar,   20),
                    new SqlParameter("@ATTRIBUTE2",         SqlDbType.VarChar,   20),
                    new SqlParameter("@ATTRIBUTE3",         SqlDbType.VarChar,   20),
                    new SqlParameter("@DEPARTMENT_CODE",    SqlDbType.VarChar,   20),
                    new SqlParameter("@DRAWING_TYPE_CODE1", SqlDbType.VarChar,   20),
                    new SqlParameter("@PRODUCTION_CYCLE",   SqlDbType.Decimal),
                    new SqlParameter("@DRAWING_TYPE_CODE2", SqlDbType.VarChar,   20),
                    new SqlParameter("@DRAWING_TYPE_CODE3", SqlDbType.VarChar,   20),
                    new SqlParameter("@DRAWING_TYPE_CODE4", SqlDbType.VarChar,   20),
                    new SqlParameter("@DRAWING_TYPE_CODE5", SqlDbType.VarChar,   20),
                    new SqlParameter("@DRAWING_TYPE_CODE6", SqlDbType.VarChar,   20),
                    new SqlParameter("@TECHNOLOGY_CODE1",   SqlDbType.VarChar,   20),
                    new SqlParameter("@TECHNOLOGY_CODE2",   SqlDbType.VarChar,   20),
                    new SqlParameter("@TECHNOLOGY_CODE3",   SqlDbType.VarChar,   20),
                    new SqlParameter("@PROCESS_STATUS",     SqlDbType.VarChar, 20)
                };
                parameters[0].Value  = model.CODE;
                parameters[1].Value  = model.NAME;
                parameters[2].Value  = CConstant.INIT;
                parameters[3].Value  = model.CREATE_USER;
                parameters[4].Value  = model.LAST_UPDATE_USER;
                parameters[5].Value  = model.ENGLISHNAME;
                parameters[6].Value  = model.ATTRIBUTE1;
                parameters[7].Value  = model.ATTRIBUTE2;
                parameters[8].Value  = model.ATTRIBUTE3;
                parameters[9].Value  = model.DEPARTMENT_CODE;
                parameters[10].Value = model.DRAWING_TYPE_CODE1;
                parameters[11].Value = model.PRODUCTION_CYCLE;
                parameters[12].Value = model.DRAWING_TYPE_CODE2;
                parameters[13].Value = model.DRAWING_TYPE_CODE3;
                parameters[14].Value = model.DRAWING_TYPE_CODE4;
                parameters[15].Value = model.DRAWING_TYPE_CODE5;
                parameters[16].Value = model.DRAWING_TYPE_CODE6;
                parameters[17].Value = model.TECHNOLOGY_CODE1;
                parameters[18].Value = model.TECHNOLOGY_CODE2;
                parameters[19].Value = model.TECHNOLOGY_CODE3;
                parameters[20].Value = model.JUDGMENT;
                rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
                #endregion
            }
            if (rows > 0)
            {
                return(true);
                // CCacheData.DrawingType = null;
            }
            else
            {
                return(false);
            }
        }
コード例 #8
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public BaseProductionProcessTable GetModel(string CODE)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  *  from base_production_process_view ");
            strSql.Append(" where CODE=@CODE ");
            strSql.AppendFormat(" and STATUS_FLAG <> {0}", CConstant.DELETE);
            SqlParameter[] parameters =
            {
                new SqlParameter("@CODE", SqlDbType.VarChar, 50)
            };
            parameters[0].Value = CODE;

            BaseProductionProcessTable model = null;
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                model      = new BaseProductionProcessTable();
                model.CODE = dr["CODE"].ToString();
                model.NAME = dr["NAME"].ToString();
                if (dr["STATUS_FLAG"].ToString() != "")
                {
                    model.STATUE_FLAG = CConvert.ToInt32(dr["STATUS_FLAG"]);
                }

                if (dr["CREATE_USER"].ToString() != "")
                {
                    model.CREATE_USER = dr["CREATE_USER"].ToString();
                }

                if (dr["LAST_UPDATE_USER"].ToString() != "")
                {
                    model.LAST_UPDATE_USER = dr["LAST_UPDATE_USER"].ToString();
                }

                if (dr["CREATE_DATE_TIME"].ToString() != "")
                {
                    model.CREATE_DATE_TIME = DateTime.Parse(dr["CREATE_DATE_TIME"].ToString());
                }

                if (dr["LAST_UPDATE_TIME"].ToString() != "")
                {
                    model.LAST_UPDATE_TIME = DateTime.Parse(dr["LAST_UPDATE_TIME"].ToString());
                }
                if (dr["ENGLISH_NAME"].ToString() != "")
                {
                    model.ENGLISHNAME = dr["ENGLISH_NAME"].ToString();
                }
                if (dr["PRODUCTION_CYCLE"].ToString() != "")
                {
                    model.PRODUCTION_CYCLE = CConvert.ToDecimal(dr["PRODUCTION_CYCLE"]);
                }
                if (dr["DEPARTMENT_CODE"].ToString() != "")
                {
                    model.DEPARTMENT_CODE = dr["DEPARTMENT_CODE"].ToString();
                }
                if (dr["DEPARTMENT_NAME"].ToString() != "")
                {
                    model.DEPARTMENT_NAME = dr["DEPARTMENT_NAME"].ToString();
                }
                if (dr["DRAWING_TYPE_CODE1"].ToString() != "")
                {
                    model.DRAWING_TYPE_CODE1 = dr["DRAWING_TYPE_CODE1"].ToString();
                }
                if (dr["DRAWING_TYPE_CODE2"].ToString() != "")
                {
                    model.DRAWING_TYPE_CODE2 = dr["DRAWING_TYPE_CODE2"].ToString();
                }
                if (dr["DRAWING_TYPE_CODE3"].ToString() != "")
                {
                    model.DRAWING_TYPE_CODE3 = dr["DRAWING_TYPE_CODE3"].ToString();
                }
                if (dr["DRAWING_TYPE_CODE4"].ToString() != "")
                {
                    model.DRAWING_TYPE_CODE4 = dr["DRAWING_TYPE_CODE4"].ToString();
                }
                if (dr["DRAWING_TYPE_CODE5"].ToString() != "")
                {
                    model.DRAWING_TYPE_CODE5 = dr["DRAWING_TYPE_CODE5"].ToString();
                }
                if (dr["DRAWING_TYPE_CODE6"].ToString() != "")
                {
                    model.DRAWING_TYPE_CODE6 = dr["DRAWING_TYPE_CODE6"].ToString();
                }
                if (dr["DRAWING_TYPE_NAME1"].ToString() != "")
                {
                    model.DRAWING_TYPE_NAME1 = dr["DRAWING_TYPE_NAME1"].ToString();
                }
                if (dr["DRAWING_TYPE_NAME2"].ToString() != "")
                {
                    model.DRAWING_TYPE_NAME2 = dr["DRAWING_TYPE_NAME2"].ToString();
                }
                if (dr["DRAWING_TYPE_NAME3"].ToString() != "")
                {
                    model.DRAWING_TYPE_NAME3 = dr["DRAWING_TYPE_NAME3"].ToString();
                }
                if (dr["DRAWING_TYPE_NAME4"].ToString() != "")
                {
                    model.DRAWING_TYPE_NAME4 = dr["DRAWING_TYPE_NAME4"].ToString();
                }
                if (dr["DRAWING_TYPE_NAME5"].ToString() != "")
                {
                    model.DRAWING_TYPE_NAME5 = dr["DRAWING_TYPE_NAME5"].ToString();
                }
                if (dr["DRAWING_TYPE_NAME6"].ToString() != "")
                {
                    model.DRAWING_TYPE_NAME6 = dr["DRAWING_TYPE_NAME6"].ToString();
                }

                if (dr["TECHNOLOGY_CODE1"].ToString() != "")
                {
                    model.TECHNOLOGY_CODE1 = dr["TECHNOLOGY_CODE1"].ToString();
                }
                if (dr["TECHNOLOGY_CODE2"].ToString() != "")
                {
                    model.TECHNOLOGY_CODE2 = dr["TECHNOLOGY_CODE2"].ToString();
                }
                if (dr["TECHNOLOGY_CODE3"].ToString() != "")
                {
                    model.TECHNOLOGY_CODE3 = dr["TECHNOLOGY_CODE3"].ToString();
                }
                if (dr["TECHNOLOGY_NAME1"].ToString() != "")
                {
                    model.TECHNOLOGY_NAME1 = dr["TECHNOLOGY_NAME1"].ToString();
                }
                if (dr["TECHNOLOGY_NAME2"].ToString() != "")
                {
                    model.TECHNOLOGY_NAME2 = dr["TECHNOLOGY_NAME2"].ToString();
                }
                if (dr["TECHNOLOGY_NAME3"].ToString() != "")
                {
                    model.TECHNOLOGY_NAME3 = dr["TECHNOLOGY_NAME3"].ToString();
                }
                if (dr["PROCESS_STATUS"].ToString() != "")
                {
                    model.JUDGMENT = dr["PROCESS_STATUS"].ToString();
                }

                break;
            }
            return(model);
        }
コード例 #9
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(BaseProductionProcessTable model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update BASE_PRODUCTION_PROCESS set ");
            strSql.Append("NAME=@NAME,");
            strSql.Append("STATUS_FLAG=@STATUS_FLAG,");
            strSql.Append("LAST_UPDATE_USER=@LAST_UPDATE_USER,");
            strSql.Append("LAST_UPDATE_TIME=GETDATE(),");
            strSql.Append("ENGLISH_NAME=@ENGLISH_NAME,");
            strSql.Append("DEPARTMENT_CODE=@DEPARTMENT_CODE,");
            strSql.Append("DRAWING_TYPE_CODE1=@DRAWING_TYPE_CODE1,");
            strSql.Append("PRODUCTION_CYCLE=@PRODUCTION_CYCLE,");
            strSql.Append("DRAWING_TYPE_CODE2=@DRAWING_TYPE_CODE2,");
            strSql.Append("DRAWING_TYPE_CODE3=@DRAWING_TYPE_CODE3,");
            strSql.Append("DRAWING_TYPE_CODE4=@DRAWING_TYPE_CODE4,");
            strSql.Append("DRAWING_TYPE_CODE5=@DRAWING_TYPE_CODE5,");
            strSql.Append("DRAWING_TYPE_CODE6=@DRAWING_TYPE_CODE6,");
            strSql.Append("TECHNOLOGY_CODE1=@TECHNOLOGY_CODE1,");
            strSql.Append("TECHNOLOGY_CODE2=@TECHNOLOGY_CODE2,");
            strSql.Append("TECHNOLOGY_CODE3=@TECHNOLOGY_CODE3,");
            strSql.Append("PROCESS_STATUS=@PROCESS_STATUS");

            strSql.Append(" where CODE=@CODE ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@CODE",               SqlDbType.VarChar,   20),
                new SqlParameter("@NAME",               SqlDbType.VarChar,  100),
                new SqlParameter("@STATUS_FLAG",        SqlDbType.Int,        4),
                new SqlParameter("@LAST_UPDATE_USER",   SqlDbType.VarChar,   20),
                new SqlParameter("@ENGLISH_NAME",       SqlDbType.VarChar,   20),
                new SqlParameter("@DEPARTMENT_CODE",    SqlDbType.VarChar,   20),
                new SqlParameter("@DRAWING_TYPE_CODE1", SqlDbType.VarChar,   20),
                new SqlParameter("@PRODUCTION_CYCLE",   SqlDbType.Decimal),
                new SqlParameter("@DRAWING_TYPE_CODE2", SqlDbType.VarChar,   20),
                new SqlParameter("@DRAWING_TYPE_CODE3", SqlDbType.VarChar,   20),
                new SqlParameter("@DRAWING_TYPE_CODE4", SqlDbType.VarChar,   20),
                new SqlParameter("@DRAWING_TYPE_CODE5", SqlDbType.VarChar,   20),
                new SqlParameter("@DRAWING_TYPE_CODE6", SqlDbType.VarChar,   20),
                new SqlParameter("@TECHNOLOGY_CODE1",   SqlDbType.VarChar,   20),
                new SqlParameter("@TECHNOLOGY_CODE2",   SqlDbType.VarChar,   20),
                new SqlParameter("@TECHNOLOGY_CODE3",   SqlDbType.VarChar,   20),
                new SqlParameter("@PROCESS_STATUS",     SqlDbType.VarChar, 20)
            };
            parameters[0].Value  = model.CODE;
            parameters[1].Value  = model.NAME;
            parameters[2].Value  = model.STATUE_FLAG;
            parameters[3].Value  = model.LAST_UPDATE_USER;
            parameters[4].Value  = model.ENGLISHNAME;
            parameters[5].Value  = model.DEPARTMENT_CODE;
            parameters[6].Value  = model.DRAWING_TYPE_CODE1;
            parameters[7].Value  = model.PRODUCTION_CYCLE;
            parameters[8].Value  = model.DRAWING_TYPE_CODE2;
            parameters[9].Value  = model.DRAWING_TYPE_CODE3;
            parameters[10].Value = model.DRAWING_TYPE_CODE4;
            parameters[11].Value = model.DRAWING_TYPE_CODE5;
            parameters[12].Value = model.DRAWING_TYPE_CODE6;
            parameters[13].Value = model.TECHNOLOGY_CODE1;
            parameters[14].Value = model.TECHNOLOGY_CODE2;
            parameters[15].Value = model.TECHNOLOGY_CODE3;
            parameters[16].Value = model.JUDGMENT;
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                CCacheData.DrawingType = null;
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #10
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(BaseProductionProcessTable model)
 {
     return(dal.Update(model));
 }
コード例 #11
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(BaseProductionProcessTable model)
 {
     return(dal.Add(model));
 }