Exemple #1
0
        void edit_pqcf(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.StandardAuditForCHEntity model)
        {
            strSql = new StringBuilder( );
            strSql.Append("update R_PQCH set ");
            strSql.Append("CH002=@CH002,");
            strSql.Append("CH003=@CH003,");
            strSql.Append("CH004=@CH004,");
            strSql.Append("CH005=@CH005,");
            strSql.Append("CH006=@CH006 ");
            strSql.Append(" where CH001=@CH001");
            SqlParameter [] parameters =
            {
                new SqlParameter("@CH001", SqlDbType.NVarChar, 20),
                new SqlParameter("@CH002", SqlDbType.NVarChar, 20),
                new SqlParameter("@CH003", SqlDbType.NVarChar, 50),
                new SqlParameter("@CH004", SqlDbType.NVarChar, 20),
                new SqlParameter("@CH005", SqlDbType.NVarChar, 20),
                new SqlParameter("@CH006", SqlDbType.NVarChar, 50)
            };
            parameters [0].Value = model.CH001;
            parameters [1].Value = model.CH002;
            parameters [2].Value = model.CH003;
            parameters [3].Value = model.CH004;
            parameters [4].Value = model.CH005;
            parameters [5].Value = model.CH006;

            SQLString.Add(strSql, parameters);
        }
Exemple #2
0
        public MulaolaoLibrary.StandardAuditForCHEntity getDataRow(DataRow row)
        {
            MulaolaoLibrary.StandardAuditForCHEntity model = new MulaolaoLibrary.StandardAuditForCHEntity( );
            if (row != null)
            {
                if (row ["CH001"] != null)
                {
                    model.CH001 = row ["CH001"].ToString( );
                }
                if (row ["CH002"] != null)
                {
                    model.CH002 = row ["CH002"].ToString( );
                }
                if (row ["CH003"] != null)
                {
                    model.CH003 = row ["CH003"].ToString( );
                }
                if (row ["CH004"] != null)
                {
                    model.CH004 = row ["CH004"].ToString( );
                }
                if (row ["CH005"] != null)
                {
                    model.CH005 = row ["CH005"].ToString( );
                }
                if (row ["CH006"] != null)
                {
                    model.CH006 = row ["CH006"].ToString( );
                }
            }

            return(model);
        }
Exemple #3
0
        void add_pqcf(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.StandardAuditForCHEntity model)
        {
            strSql = new StringBuilder( );
            strSql.Append("insert into R_PQCH(");
            strSql.Append("CH001,CH003,CH004,CH005,CH006)");
            strSql.Append(" values (");
            strSql.Append("@CH001,@CH003,@CH004,@CH005,@CH006)");
            SqlParameter [] parameters =
            {
                new SqlParameter("@CH001", SqlDbType.NVarChar, 20),
                //new SqlParameter("@CH002", SqlDbType.NVarChar,20),
                new SqlParameter("@CH003", SqlDbType.NVarChar, 50),
                new SqlParameter("@CH004", SqlDbType.NVarChar, 20),
                new SqlParameter("@CH005", SqlDbType.NVarChar, 20),
                new SqlParameter("@CH006", SqlDbType.NVarChar, 50)
            };
            parameters [0].Value = model.CH001;
            //parameters [ 1 ] . Value = model . CH002;
            parameters [1].Value = model.CH003;
            parameters [2].Value = model.CH004;
            parameters [3].Value = model.CH005;
            parameters [4].Value = model.CH006;

            SQLString.Add(strSql, parameters);
        }
Exemple #4
0
 void getData( )
 {
     _ch = _bll.getModel(_ch.CH001);
     //txtColor . Text = _ch . CH002;
     cmbUserOne.Text         = _ch.CH003;
     cmbUserTwo.Text         = _ch.CH004;
     cmbUserTre.Text         = _ch.CH005;
     cmbUserFor.Text         = _ch.CH006;
     tableView               = _bll.getView(" CI001='" + _ch.CH001 + "'");
     gridControl1.DataSource = tableView;
 }
Exemple #5
0
        public FormStandardAuditFor( )
        {
            InitializeComponent( );

            _ch       = new MulaolaoLibrary.StandardAuditForCHEntity( );
            _ci       = new MulaolaoLibrary.StandardAuditForCIEntity( );
            _bll      = new MulaolaoBll.Bll.StandardAuditForBll( );
            tableView = new DataTable( );
            tablePro  = new DataTable( );
            printOne  = new DataTable( );
            printTwo  = new DataTable( );
            MulaolaoBll.UserInfoMation.tableName = this.Name;

            GridViewMoHuSelect.SetFilter(resPro);
            GridViewMoHuSelect.SetFilter(bandedGridView1);
            GrivColumnStyle.setColumnStyle(new DevExpress.XtraGrid.Views.Grid.GridView [] { bandedGridView1 });
            Power(this);
            UnEnable( );

            tablePro             = _bll.getPro( );
            lupPro.DataSource    = tablePro;
            lupPro.DisplayMember = "CI012";
            lupPro.ValueMember   = "CI012";

            DataTable dt = _bll.getUser( );

            if (dt != null && dt.Rows.Count > 0)
            {
                DataTable da = dt.Copy( ).DefaultView.ToTable(true, "CH003");
                for (int i = 0; i < da.Rows.Count; i++)
                {
                    cmbUserOne.Properties.Items.Add(da.Rows [i] ["CH003"].ToString( ));
                }
                da = dt.Copy( ).DefaultView.ToTable(true, "CH004");
                for (int i = 0; i < da.Rows.Count; i++)
                {
                    cmbUserTwo.Properties.Items.Add(da.Rows [i] ["CH004"].ToString( ));
                }
                da = dt.Copy( ).DefaultView.ToTable(true, "CH005");
                for (int i = 0; i < da.Rows.Count; i++)
                {
                    cmbUserTre.Properties.Items.Add(da.Rows [i] ["CH005"].ToString( ));
                }
                da = dt.Copy( ).DefaultView.ToTable(true, "CH006");
                for (int i = 0; i < da.Rows.Count; i++)
                {
                    cmbUserFor.Properties.Items.Add(da.Rows [i] ["CH006"].ToString( ));
                }
            }
        }
Exemple #6
0
        /// <summary>
        /// edit data from r_pqcb and r_pqcc to database
        /// </summary>
        /// <param name="table"></param>
        /// <param name="_cb"></param>
        /// <param name="logins"></param>
        /// <param name="strList"></param>
        /// <returns></returns>
        public bool Edit(DataTable table, MulaolaoLibrary.StandardAuditForCHEntity _cf, string logins, List <string> strList)
        {
            Hashtable     SQLString = new Hashtable( );
            StringBuilder strSql    = new StringBuilder( );

            edit_pqcf(SQLString, strSql, _cf);
            SQLString.Add(Drity.DrityOfComparation("R_484", "动力段生产首件量.检具审核确认记录表(R_484)", logins, Drity.GetDt( ), _cf.CH001, strSql.ToString( ).Replace("'", "''"), "编辑", "编辑"), null);

            MulaolaoLibrary.StandardAuditForCIEntity _ce = new MulaolaoLibrary.StandardAuditForCIEntity( );
            _ce.CI001 = _cf.CH001;
            for (int i = 0; i < table.Rows.Count; i++)
            {
                _ce.CI002 = table.Rows [i] ["CI002"].ToString( );
                _ce.CI003 = table.Rows [i] ["CI003"].ToString( );
                _ce.CI004 = table.Rows [i] ["CI004"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI005"].ToString( )))
                {
                    _ce.CI005 = null;
                }
                else
                {
                    _ce.CI005 = Convert.ToDateTime(table.Rows [i] ["CI005"]);
                }
                if (string.IsNullOrEmpty(table.Rows [i] ["CI006"].ToString( )))
                {
                    _ce.CI006 = null;
                }
                else
                {
                    _ce.CI006 = Convert.ToDateTime(table.Rows [i] ["CI006"]);
                }
                _ce.CI007 = table.Rows [i] ["CI007"].ToString( );
                _ce.CI008 = table.Rows [i] ["CI008"].ToString( );
                _ce.CI009 = table.Rows [i] ["CI009"].ToString( );
                _ce.CI010 = table.Rows [i] ["CI010"].ToString( );
                _ce.CI011 = table.Rows [i] ["CI011"].ToString( );
                _ce.CI012 = table.Rows [i] ["CI012"].ToString( );
                _ce.CI013 = table.Rows [i] ["CI013"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI014"].ToString( )))
                {
                    _ce.CI014 = null;
                }
                else
                {
                    _ce.CI014 = Convert.ToDateTime(table.Rows [i] ["CI014"]);
                }
                _ce.CI015 = table.Rows [i] ["CI015"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI016"].ToString( )))
                {
                    _ce.CI016 = null;
                }
                else
                {
                    _ce.CI016 = Convert.ToDateTime(table.Rows [i] ["CI016"]);
                }
                _ce.CI017 = table.Rows [i] ["CI017"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI018"].ToString( )))
                {
                    _ce.CI018 = null;
                }
                else
                {
                    _ce.CI018 = Convert.ToDateTime(table.Rows [i] ["CI018"]);
                }
                if (string.IsNullOrEmpty(table.Rows [i] ["CI019"].ToString( )))
                {
                    _ce.CI019 = null;
                }
                else
                {
                    _ce.CI019 = Convert.ToInt32(table.Rows [i] ["CI019"]);
                }
                _ce.CI020 = table.Rows [i] ["CI020"].ToString( );
                _ce.CI021 = table.Rows [i] ["CI021"].ToString( );
                _ce.CI024 = string.IsNullOrEmpty(table.Rows [i] ["CI024"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["CI024"].ToString( ));
                _ce.idx   = string.IsNullOrEmpty(table.Rows [i] ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["idx"].ToString( ));
                if (_ce.idx < 1)
                {
                    add_pqcg(SQLString, strSql, _ce, logins);
                }
                else
                {
                    edit_pqcg(SQLString, strSql, _ce, logins);
                }
            }

            foreach (string s in strList)
            {
                _ce.idx = Convert.ToInt32(s);
                delete_pqcg(SQLString, strSql, _ce, logins);
            }

            return(SqlHelper.ExecuteSqlTran(SQLString));
        }
Exemple #7
0
        /// <summary>
        /// save data to r_pqcb and r_pqcc
        /// </summary>
        /// <param name="table"></param>
        /// <param name="_cb"></param>
        /// <returns></returns>
        public bool Save(DataTable table, MulaolaoLibrary.StandardAuditForCHEntity _cf, string logins)
        {
            Hashtable     SQLString = new Hashtable( );
            StringBuilder strSql    = new StringBuilder( );

            _cf.CH001 = getOddNum( );
            add_pqcf(SQLString, strSql, _cf);
            SQLString.Add(Drity.DrityOfComparation("R_487", "包装首件标准样审核确认记录表(R_487)", logins, Drity.GetDt( ), _cf.CH001, strSql.ToString( ).Replace("'", "''"), "新增", "新增"), null);

            MulaolaoLibrary.StandardAuditForCIEntity _ce = new MulaolaoLibrary.StandardAuditForCIEntity( );
            _ce.CI001 = _cf.CH001;
            for (int i = 0; i < table.Rows.Count; i++)
            {
                _ce.CI002 = table.Rows [i] ["CI002"].ToString( );
                _ce.CI003 = table.Rows [i] ["CI003"].ToString( );
                _ce.CI004 = table.Rows [i] ["CI004"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI005"].ToString( )))
                {
                    _ce.CI005 = null;
                }
                else
                {
                    _ce.CI005 = Convert.ToDateTime(table.Rows [i] ["CI005"]);
                }
                if (string.IsNullOrEmpty(table.Rows [i] ["CI006"].ToString( )))
                {
                    _ce.CI006 = null;
                }
                else
                {
                    _ce.CI006 = Convert.ToDateTime(table.Rows [i] ["CI006"]);
                }
                _ce.CI007 = table.Rows [i] ["CI007"].ToString( );
                _ce.CI008 = table.Rows [i] ["CI008"].ToString( );
                _ce.CI009 = table.Rows [i] ["CI009"].ToString( );
                _ce.CI010 = table.Rows [i] ["CI010"].ToString( );
                _ce.CI011 = table.Rows [i] ["CI011"].ToString( );
                _ce.CI012 = table.Rows [i] ["CI012"].ToString( );
                _ce.CI013 = table.Rows [i] ["CI013"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI014"].ToString( )))
                {
                    _ce.CI014 = null;
                }
                else
                {
                    _ce.CI014 = Convert.ToDateTime(table.Rows [i] ["CI014"]);
                }
                _ce.CI015 = table.Rows [i] ["CI015"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI016"].ToString( )))
                {
                    _ce.CI016 = null;
                }
                else
                {
                    _ce.CI016 = Convert.ToDateTime(table.Rows [i] ["CI016"]);
                }
                _ce.CI017 = table.Rows [i] ["CI017"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CI018"].ToString( )))
                {
                    _ce.CI018 = null;
                }
                else
                {
                    _ce.CI018 = Convert.ToDateTime(table.Rows [i] ["CI018"]);
                }
                if (string.IsNullOrEmpty(table.Rows [i] ["CI019"].ToString( )))
                {
                    _ce.CI019 = null;
                }
                else
                {
                    _ce.CI019 = Convert.ToInt32(table.Rows [i] ["CI019"]);
                }
                _ce.CI020 = table.Rows [i] ["CI020"].ToString( );
                _ce.CI021 = table.Rows [i] ["CI021"].ToString( );
                _ce.CI024 = string.IsNullOrEmpty(table.Rows [i] ["CI024"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["CI024"].ToString( ));
                add_pqcg(SQLString, strSql, _ce, logins);
            }

            return(SqlHelper.ExecuteSqlTran(SQLString));
        }
Exemple #8
0
 /// <summary>
 /// edit data from r_pqcb and r_pqcc to database
 /// </summary>
 /// <param name="table"></param>
 /// <param name="_cb"></param>
 /// <param name="logins"></param>
 /// <param name="strList"></param>
 /// <returns></returns>
 public bool Edit(DataTable table, MulaolaoLibrary.StandardAuditForCHEntity _cd, string logins, List <string> strList)
 {
     return(_dal.Edit(table, _cd, logins, strList));
 }
Exemple #9
0
 /// <summary>
 /// save data to r_pqcb and r_pqcc
 /// </summary>
 /// <param name="table"></param>
 /// <param name="_cb"></param>
 /// <returns></returns>
 public bool Save(DataTable table, MulaolaoLibrary.StandardAuditForCHEntity _cd, string logins)
 {
     return(_dal.Save(table, _cd, logins));
 }