Exemplo n.º 1
0
        void add_pqcb(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.StandardAuditTwoCDEntity model)
        {
            strSql = new StringBuilder( );
            strSql.Append("insert into R_PQCD(");
            strSql.Append("CD001,CD002,CD003,CD004,CD005,CD006,CD007,CD008,CD009,CD010)");
            strSql.Append(" values (");
            strSql.Append("@CD001,@CD002,@CD003,@CD004,@CD005,@CD006,@CD007,@CD008,@CD009,@CD010)");
            SqlParameter [] parameters =
            {
                new SqlParameter("@CD001", SqlDbType.NVarChar, 20),
                new SqlParameter("@CD002", SqlDbType.NVarChar, 20),
                new SqlParameter("@CD003", SqlDbType.NVarChar, 50),
                new SqlParameter("@CD004", SqlDbType.NVarChar, 20),
                new SqlParameter("@CD005", SqlDbType.Int,       4),
                new SqlParameter("@CD006", SqlDbType.NVarChar, 50),
                new SqlParameter("@CD007", SqlDbType.NVarChar, 20),
                new SqlParameter("@CD008", SqlDbType.NVarChar, 20),
                new SqlParameter("@CD009", SqlDbType.NVarChar, 20),
                new SqlParameter("@CD010", SqlDbType.NVarChar, 20)
            };
            parameters [0].Value = model.CD001;
            parameters [1].Value = model.CD002;
            parameters [2].Value = model.CD003;
            parameters [3].Value = model.CD004;
            parameters [4].Value = model.CD005;
            parameters [5].Value = model.CD006;
            parameters [6].Value = model.CD007;
            parameters [7].Value = model.CD008;
            parameters [8].Value = model.CD009;
            parameters [9].Value = model.CD010;

            SQLString.Add(strSql, parameters);
        }
Exemplo n.º 2
0
        public MulaolaoLibrary.StandardAuditTwoCDEntity getDataRow(DataRow row)
        {
            MulaolaoLibrary.StandardAuditTwoCDEntity model = new MulaolaoLibrary.StandardAuditTwoCDEntity( );
            if (row != null)
            {
                if (row ["CD001"] != null)
                {
                    model.CD001 = row ["CD001"].ToString( );
                }
                if (row ["CD002"] != null)
                {
                    model.CD002 = row ["CD002"].ToString( );
                }
                if (row ["CD003"] != null)
                {
                    model.CD003 = row ["CD003"].ToString( );
                }
                if (row ["CD004"] != null)
                {
                    model.CD004 = row ["CD004"].ToString( );
                }
                if (row ["CD005"] != null && row ["CD005"].ToString( ) != string.Empty)
                {
                    model.CD005 = int.Parse(row ["CD005"].ToString( ));
                }
                if (row ["CD006"] != null)
                {
                    model.CD006 = row ["CD006"].ToString( );
                }
                if (row ["CD007"] != null)
                {
                    model.CD007 = row ["CD007"].ToString( );
                }
                if (row ["CD008"] != null)
                {
                    model.CD008 = row ["CD008"].ToString( );
                }
                if (row ["CD009"] != null)
                {
                    model.CD009 = row ["CD009"].ToString( );
                }
                if (row ["CD010"] != null)
                {
                    model.CD010 = row ["CD010"].ToString( );
                }
            }

            return(model);
        }
Exemplo n.º 3
0
        public FormStandardAuditTwo( )
        {
            InitializeComponent( );

            _cd           = new MulaolaoLibrary.StandardAuditTwoCDEntity( );
            _ce           = new MulaolaoLibrary.StandardAuditTwoCEEntity( );
            _bll          = new MulaolaoBll.Bll.StandardAuditTwoBll( );
            tableView     = new DataTable( );
            tablePrintOne = new DataTable( );
            tablePrintTwo = new DataTable( );

            GridViewMoHuSelect.SetFilter(secView);
            GridViewMoHuSelect.SetFilter(bandedGridView1);
            GrivColumnStyle.setColumnStyle(new DevExpress.XtraGrid.Views.Grid.GridView [] { bandedGridView1 });
            MulaolaoBll.UserInfoMation.tableName = this.Name;

            Power(this);
            UnEnable( );

            secPro.Properties.DataSource    = _bll.getProInfo( );
            secPro.Properties.DisplayMember = "PQF04";
            secPro.Properties.ValueMember   = "PQF01";

            DataTable dt = _bll.getUser( );

            if (dt != null && dt.Rows.Count > 0)
            {
                DataTable da = dt.Copy( ).DefaultView.ToTable(true, "CD007");
                for (int i = 0; i < da.Rows.Count; i++)
                {
                    cmbUserOne.Properties.Items.Add(da.Rows [i] ["CD007"].ToString( ));
                }
                da = dt.Copy( ).DefaultView.ToTable(true, "CD008");
                for (int i = 0; i < da.Rows.Count; i++)
                {
                    cmbUserTwo.Properties.Items.Add(da.Rows [i] ["CD008"].ToString( ));
                }
                da = dt.Copy( ).DefaultView.ToTable(true, "CD009");
                for (int i = 0; i < da.Rows.Count; i++)
                {
                    cmbUserTre.Properties.Items.Add(da.Rows [i] ["CD009"].ToString( ));
                }
                da = dt.Copy( ).DefaultView.ToTable(true, "CD010");
                for (int i = 0; i < da.Rows.Count; i++)
                {
                    cmbUserFor.Properties.Items.Add(da.Rows [i] ["CD010"].ToString( ));
                }
            }
        }
Exemplo n.º 4
0
 void getData( )
 {
     _cd = _bll.getModel(_cd.CD001);
     secPro.EditValue        = _cd.CD002;
     txtNum.Text             = _cd.CD002;
     txtNo.Text              = _cd.CD004;
     txtNumer.Text           = _cd.CD005.ToString( );
     txtColor.Text           = _cd.CD006;
     cmbUserOne.Text         = _cd.CD007;
     cmbUserTwo.Text         = _cd.CD008;
     cmbUserTre.Text         = _cd.CD009;
     cmbUserFor.Text         = _cd.CD010;
     tableView               = _bll.getView(" CE001='" + _cd.CD001 + "'");
     gridControl1.DataSource = tableView;
 }
Exemplo n.º 5
0
        void edit_pqcb(Hashtable SQLString, StringBuilder strSql, MulaolaoLibrary.StandardAuditTwoCDEntity model)
        {
            strSql = new StringBuilder( );
            strSql.Append("update R_PQCD set ");
            strSql.Append("CD002=@CD002,");
            strSql.Append("CD003=@CD003,");
            strSql.Append("CD004=@CD004,");
            strSql.Append("CD005=@CD005,");
            strSql.Append("CD006=@CD006,");
            strSql.Append("CD007=@CD007,");
            strSql.Append("CD008=@CD008,");
            strSql.Append("CD009=@CD009,");
            strSql.Append("CD010=@CD010 ");
            strSql.Append(" where CD001=@CD001");
            SqlParameter [] parameters =
            {
                new SqlParameter("@CD001", SqlDbType.NVarChar, 20),
                new SqlParameter("@CD002", SqlDbType.NVarChar, 20),
                new SqlParameter("@CD003", SqlDbType.NVarChar, 50),
                new SqlParameter("@CD004", SqlDbType.NVarChar, 20),
                new SqlParameter("@CD005", SqlDbType.Int,       4),
                new SqlParameter("@CD006", SqlDbType.NVarChar, 50),
                new SqlParameter("@CD007", SqlDbType.NVarChar, 20),
                new SqlParameter("@CD008", SqlDbType.NVarChar, 20),
                new SqlParameter("@CD009", SqlDbType.NVarChar, 20),
                new SqlParameter("@CD010", SqlDbType.NVarChar, 20)
            };
            parameters [0].Value = model.CD001;
            parameters [1].Value = model.CD002;
            parameters [2].Value = model.CD003;
            parameters [3].Value = model.CD004;
            parameters [4].Value = model.CD005;
            parameters [5].Value = model.CD006;
            parameters [6].Value = model.CD007;
            parameters [7].Value = model.CD008;
            parameters [8].Value = model.CD009;
            parameters [9].Value = model.CD010;

            SQLString.Add(strSql, parameters);
        }
Exemplo n.º 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.StandardAuditTwoCDEntity _cd, string logins, List <string> strList)
 {
     return(_dal.Edit(table, _cd, logins, strList));
 }
Exemplo n.º 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.StandardAuditTwoCDEntity _cd, string logins)
 {
     return(_dal.Save(table, _cd, logins));
 }
Exemplo n.º 8
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.StandardAuditTwoCDEntity _cd, string logins)
        {
            Hashtable     SQLString = new Hashtable( );
            StringBuilder strSql    = new StringBuilder( );

            _cd.CD001 = getOddNum( );
            add_pqcb(SQLString, strSql, _cd);
            SQLString.Add(Drity.DrityOfComparation("R_483", "丝、移、热印生产首件标准样审核确认记录表(R_483)", logins, Drity.GetDt( ), _cd.CD001, strSql.ToString( ).Replace("'", "''"), "新增", "新增"), null);

            MulaolaoLibrary.StandardAuditTwoCEEntity _ce = new MulaolaoLibrary.StandardAuditTwoCEEntity( );
            _ce.CE001 = _cd.CD001;
            for (int i = 0; i < table.Rows.Count; i++)
            {
                _ce.CE002 = table.Rows [i] ["CE002"].ToString( );
                _ce.CE003 = table.Rows [i] ["CE003"].ToString( );
                _ce.CE004 = table.Rows [i] ["CE004"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CE005"].ToString( )))
                {
                    _ce.CE005 = null;
                }
                else
                {
                    _ce.CE005 = Convert.ToDateTime(table.Rows [i] ["CE005"]);
                }
                if (string.IsNullOrEmpty(table.Rows [i] ["CE006"].ToString( )))
                {
                    _ce.CE006 = null;
                }
                else
                {
                    _ce.CE006 = Convert.ToDateTime(table.Rows [i] ["CE006"]);
                }
                _ce.CE007 = table.Rows [i] ["CE007"].ToString( );
                _ce.CE008 = table.Rows [i] ["CE008"].ToString( );
                _ce.CE009 = table.Rows [i] ["CE009"].ToString( );
                _ce.CE010 = table.Rows [i] ["CE010"].ToString( );
                _ce.CE011 = table.Rows [i] ["CE011"].ToString( );
                _ce.CE012 = table.Rows [i] ["CE012"].ToString( );
                _ce.CE013 = table.Rows [i] ["CE013"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CE014"].ToString( )))
                {
                    _ce.CE014 = null;
                }
                else
                {
                    _ce.CE014 = Convert.ToDateTime(table.Rows [i] ["CE014"]);
                }
                _ce.CE015 = table.Rows [i] ["CE015"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CE016"].ToString( )))
                {
                    _ce.CE016 = null;
                }
                else
                {
                    _ce.CE016 = Convert.ToDateTime(table.Rows [i] ["CE016"]);
                }
                _ce.CE017 = table.Rows [i] ["CE017"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CE018"].ToString( )))
                {
                    _ce.CE018 = null;
                }
                else
                {
                    _ce.CE018 = Convert.ToDateTime(table.Rows [i] ["CE018"]);
                }
                _ce.CE019 = table.Rows [i] ["CE019"].ToString( );
                if (string.IsNullOrEmpty(table.Rows [i] ["CE020"].ToString( )))
                {
                    _ce.CE020 = null;
                }
                else
                {
                    _ce.CE020 = Convert.ToDateTime(table.Rows [i] ["CE020"]);
                }
                _ce.CE021 = table.Rows [i] ["CE021"].ToString( );
                _ce.CE022 = table.Rows [i] ["CE022"].ToString( );
                _ce.CE023 = table.Rows [i] ["CE023"].ToString( );
                add_pqcc(SQLString, strSql, _ce, logins);
            }

            return(SqlHelper.ExecuteSqlTran(SQLString));
        }