Esempio n. 1
0
        private void btn_Click(object sender, EventArgs e)
        {
            SiftingDataEntity.MainEntity model = new SiftingDataEntity.MainEntity( );
            state = btn.Text;
            if (state.Equals("审核"))
            {
                model.DEL014 = true;
            }
            else
            {
                model.DEL014 = false;
            }

            model.DEL011 = txtRAA001.Text;
            result       = _bll.Examine(model);
            if (result)
            {
                XtraMessageBox.Show(state + "成功");
                //if ( state . Equals ( "审核" ) )
                //    btn . Text = "反审核";
                //else if ( state . Equals ( "反审核" ) )
                //    btn . Text = "审核";
                examine(state);
            }
            else
            {
                XtraMessageBox.Show(state + "失败");
            }
        }
Esempio n. 2
0
 void Edits(Hashtable SQLString, StringBuilder strSql, SiftingDataEntity.MainEntity model)
 {
     strSql = new StringBuilder( );
     strSql.Append("update JIFMAI set ");
     strSql.Append("MAI001=@MAI001,");
     strSql.Append("MAI002=@MAI002,");
     strSql.Append("MAI003=@MAI003,");
     strSql.Append("MAI004=@MAI004 ");
     //strSql . Append ( "MAI005=@MAI005 " );
     strSql.Append(" where idx=@idx");
     SqlParameter [] parameters =
     {
         new SqlParameter("@MAI001", SqlDbType.Date,      3),
         new SqlParameter("@MAI002", SqlDbType.NVarChar, 50),
         new SqlParameter("@MAI003", SqlDbType.NVarChar, 50),
         new SqlParameter("@MAI004", SqlDbType.Int,       4),
         //new SqlParameter("@MAI005", SqlDbType.NVarChar,200),
         new SqlParameter("@idx",    SqlDbType.Int, 4)
     };
     parameters [0].Value = model.MAI001;
     parameters [1].Value = model.MAI002;
     parameters [2].Value = model.MAI003;
     parameters [3].Value = model.MAI004;
     //parameters [ 4 ] . Value = model . MAI005;
     parameters [4].Value = model.idx;
     SQLString.Add(strSql, parameters);
 }
Esempio n. 3
0
        void EditIbb(Hashtable SQLString, SiftingDataEntity.MainEntity model)
        {
            StringBuilder strSql = new StringBuilder( );

            strSql.AppendFormat("UPDATE DCSIBB SET IBB965='{0}' WHERE IBB001='{1}' AND IBB002='{2}'", model.DEL015, model.DEL017, model.DEL018);
            SQLString.Add(strSql, null);
        }
Esempio n. 4
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="table"></param>
        /// <param name="oderNum"></param>
        /// <returns></returns>
        public bool Save(DataTable table, string oderNum, string remark)
        {
            Hashtable     SQLString = new Hashtable( );
            StringBuilder strSql    = new StringBuilder( );

            SiftingDataEntity.MainEntity model = new SiftingDataEntity.MainEntity( );
            model.DEL013 = remark;
            for (int i = 0; i < table.Rows.Count; i++)
            {
                model.DEL011 = oderNum;
                model.DEL001 = table.Rows [i] ["DEL001"].ToString( );
                model.DEL002 = table.Rows [i] ["DEL002"].ToString( );
                model.DEL003 = table.Rows [i] ["DEL003"].ToString( );
                model.DEL004 = table.Rows [i] ["DEL004"].ToString( );
                model.DEL005 = table.Rows [i] ["DEL005"].ToString( );
                model.DEL006 = table.Rows [i] ["DEL006"].ToString( );
                model.DEL007 = string.IsNullOrEmpty(table.Rows [i] ["DEL007"].ToString( )) == true ? 0 : Convert.ToDecimal(table.Rows [i] ["DEL007"].ToString( ));
                model.DEL008 = string.IsNullOrEmpty(table.Rows [i] ["DEL008"].ToString( )) == true ? 0 : Convert.ToDecimal(table.Rows [i] ["DEL008"].ToString( ));
                model.DEL009 = string.IsNullOrEmpty(table.Rows [i] ["DEL009"].ToString( )) == true ? 0 : Convert.ToDecimal(table.Rows [i] ["DEL009"].ToString( ));
                model.DEL010 = table.Rows [i] ["DEL010"].ToString( );           /* string . IsNullOrEmpty ( table . Rows [ i ] [ "DEL010" ] . ToString ( ) ) == true ? 0 : Convert . ToDecimal ( table . Rows [ i ] [ "DEL010" ] . ToString ( ) );*/
                model.DEL012 = table.Rows [i] ["DEL012"].ToString( );
                Add(SQLString, strSql, model);
            }

            return(SqlHelper.ExecuteSqlTran(SQLString));
        }
Esempio n. 5
0
        public FormMain( )
        {
            InitializeComponent( );

            _bll  = new SiftingDataBll.Bll.MainBll( );
            model = new SiftingDataEntity.MainEntity( );

            dtNow = _bll.getTimeNow( ).ToString("yyyyMMdd");

            barManager1.Items.Remove(toolExport);
            gridView1.OptionsBehavior.Editable = false;

            partTable             = _bll.getTablePartNum( );
            partNum.DataSource    = partTable;
            partNum.DisplayMember = "MAI002";
            partNum.ValueMember   = "MAI002";

            DataTable table = _bll.getTableInfo( );

            txtMAI002.Properties.DataSource    = table.DefaultView.ToTable(true, "MAI002");
            txtMAI002.Properties.DisplayMember = "MAI002";
            txtMAI003.Properties.DataSource    = table.DefaultView.ToTable(true, "MAI003");
            txtMAI003.Properties.DisplayMember = "MAI003";

            GridViewMoHuSelect.SetFilter(repositoryItemGridLookUpEdit1View);
        }
Esempio n. 6
0
 void Delete(Hashtable SQLString, StringBuilder strSql, SiftingDataEntity.MainEntity model)
 {
     strSql = new StringBuilder( );
     strSql.Append("delete from JIFMAI ");
     strSql.Append(" where idx=@idx");
     SqlParameter [] parameters =
     {
         new SqlParameter("@idx", SqlDbType.Int, 4)
     };
     parameters [0].Value = model.idx;
     SQLString.Add(strSql, parameters);
 }
Esempio n. 7
0
        void Edit(Hashtable SQLString, StringBuilder strSql, SiftingDataEntity.MainEntity model)
        {
            strSql = new StringBuilder( );
            strSql.Append("update QIXDEL set ");
            strSql.Append("DEL001=@DEL001,");
            strSql.Append("DEL002=@DEL002,");
            strSql.Append("DEL003=@DEL003,");
            strSql.Append("DEL004=@DEL004,");
            strSql.Append("DEL005=@DEL005,");
            strSql.Append("DEL006=@DEL006,");
            strSql.Append("DEL007=@DEL007,");
            strSql.Append("DEL008=@DEL008,");
            strSql.Append("DEL009=@DEL009,");
            strSql.Append("DEL010=@DEL010,");
            strSql.Append("DEL011=@DEL011,");
            strSql.Append("DEL012=@DEL012,");
            strSql.Append("DEL013=@DEL013 ");
            strSql.Append(" where idx=@idx");
            SqlParameter [] parameters =
            {
                new SqlParameter("@DEL001", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL002", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL003", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL004", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL005", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL006", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL007", SqlDbType.Decimal,    9),
                new SqlParameter("@DEL008", SqlDbType.Decimal,    9),
                new SqlParameter("@DEL009", SqlDbType.Decimal,    9),
                new SqlParameter("@DEL010", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL011", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL012", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL013", SqlDbType.NVarChar, 250),
                new SqlParameter("@idx",    SqlDbType.Int, 4)
            };
            parameters [0].Value  = model.DEL001;
            parameters [1].Value  = model.DEL002;
            parameters [2].Value  = model.DEL003;
            parameters [3].Value  = model.DEL004;
            parameters [4].Value  = model.DEL005;
            parameters [5].Value  = model.DEL006;
            parameters [6].Value  = model.DEL007;
            parameters [7].Value  = model.DEL008;
            parameters [8].Value  = model.DEL009;
            parameters [9].Value  = model.DEL010;
            parameters [10].Value = model.DEL011;
            parameters [11].Value = model.DEL012;
            parameters [12].Value = model.DEL013;
            parameters [13].Value = model.id;

            SQLString.Add(strSql, parameters);
        }
Esempio n. 8
0
        private void btn_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtRAA001.Text))
            {
                XtraMessageBox.Show("来源单号不可为空");
                return;
            }
            SiftingDataEntity.MainEntity model = new SiftingDataEntity.MainEntity( );
            state = btn.Text;
            if (state.Equals("审核"))
            {
                model.DEL014 = true;
            }
            else
            {
                model.DEL014 = false;
            }

            model.DEL011 = txtRAA001.Text;
            model.DEL015 = txtDEL015.Text;
            if (state.Equals("反审核"))
            {
                if (_bll.Exists(txtRAA001.Text, txtDEA002.Text) == false)
                {
                    XtraMessageBox.Show("已经入库,不允许反审核");
                    return;
                }
            }
            result = _bll.Examine(model);
            if (result)
            {
                XtraMessageBox.Show(state + "成功");
                //if ( state . Equals ( "审核" ) )
                //    btn . Text = "反审核";
                //else if ( state . Equals ( "反审核" ) )
                //    btn . Text = "审核";
                examine(state);
                if (state.Equals("反审核"))
                {
                    toolEdit.Visibility = toolDelete.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
                }
                else
                {
                    toolEdit.Visibility = toolDelete.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
                }
            }
            else
            {
                XtraMessageBox.Show(state + "失败");
            }
        }
Esempio n. 9
0
        public FormMain( )
        {
            InitializeComponent( );

            _bll  = new SiftingDataBll.Bll.MainBll( );
            model = new SiftingDataEntity.MainEntity( );
            getQueryForColumn( );
            Utility.GridViewMoHuSelect.SetFilter(gridLookUpEdit1View);
            Utility.GridViewMoHuSelect.SetFilter(sunOfNumA);
            Utility.GridViewMoHuSelect.SetFilter(gridView2);
            Utility.GridViewMoHuSelect.SetFilter(gridView4);
            Utility.GridViewMoHuSelect.SetFilter(View4);
            controlUnEnable( );
        }
Esempio n. 10
0
        /// <summary>
        /// 更改
        /// </summary>
        /// <param name="table"></param>
        /// <param name="oderNum"></param>
        /// <param name="idxList"></param>
        /// <returns></returns>
        public bool Update(DataTable table, string oderNum, List <int> idxList, string remark, string oddNum, string num, string piNum, string numOfOrder)
        {
            Hashtable     SQLString = new Hashtable( );
            StringBuilder strSql    = new StringBuilder( );

            SiftingDataEntity.MainEntity model = new SiftingDataEntity.MainEntity( );
            model.DEL013 = remark;
            model.DEL015 = oderNum;
            for (int i = 0; i < table.Rows.Count; i++)
            {
                model.DEL011 = piNum;
                model.DEL016 = num;
                model.DEL017 = oddNum;
                model.DEL001 = table.Rows [i] ["DEL001"].ToString( );
                model.DEL002 = table.Rows [i] ["DEL002"].ToString( );
                model.DEL003 = table.Rows [i] ["DEL003"].ToString( );
                model.DEL004 = table.Rows [i] ["DEL004"].ToString( );
                model.DEL005 = table.Rows [i] ["DEL005"].ToString( );
                model.DEL006 = table.Rows [i] ["DEL006"].ToString( );
                model.DEL007 = string.IsNullOrEmpty(table.Rows [i] ["DEL007"].ToString( )) == true ? 0 : Convert.ToDecimal(table.Rows [i] ["DEL007"].ToString( ));
                model.DEL008 = string.IsNullOrEmpty(table.Rows [i] ["DEL008"].ToString( )) == true ? 0 : Convert.ToDecimal(table.Rows [i] ["DEL008"].ToString( ));
                model.DEL009 = string.IsNullOrEmpty(table.Rows [i] ["DEL009"].ToString( )) == true ? 0 : Convert.ToDecimal(table.Rows [i] ["DEL009"].ToString( ));
                model.DEL010 = table.Rows [i] ["DEL010"].ToString( );           /* string . IsNullOrEmpty ( table . Rows [ i ] [ "DEL010" ] . ToString ( ) ) == true ? 0 : Convert . ToDecimal ( table . Rows [ i ] [ "DEL010" ] . ToString ( ) );*/
                model.id     = string.IsNullOrEmpty(table.Rows [i] ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["idx"].ToString( ));
                model.DEL012 = table.Rows [i] ["DEL012"].ToString( );
                model.DEL018 = numOfOrder;
                if (model.id < 1)
                {
                    Add(SQLString, strSql, model);
                }
                else
                {
                    Edit(SQLString, strSql, model);
                }
            }

            if (idxList != null && idxList.Count > 0)
            {
                foreach (int i in idxList)
                {
                    model.id = i;
                    if (model.id > 0)
                    {
                        Remove(SQLString, strSql, model);
                    }
                }
            }

            return(SqlHelper.ExecuteSqlTran(SQLString));
        }
Esempio n. 11
0
        void Add(Hashtable SQLString, StringBuilder strSql, SiftingDataEntity.MainEntity model)
        {
            strSql = new StringBuilder( );
            strSql.Append("insert into QIXDEL(");
            strSql.Append("DEL001,DEL002,DEL003,DEL004,DEL005,DEL006,DEL007,DEL008,DEL009,DEL010,DEL011,DEL012,DEL013,DEL015,DEL016,DEL017,DEL018)");
            strSql.Append(" values (");
            strSql.Append("@DEL001,@DEL002,@DEL003,@DEL004,@DEL005,@DEL006,@DEL007,@DEL008,@DEL009,@DEL010,@DEL011,@DEL012,@DEL013,@DEL015,@DEL016,@DEL017,@DEL018)");
            SqlParameter [] parameters =
            {
                new SqlParameter("@DEL001", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL002", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL003", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL004", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL005", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL006", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL007", SqlDbType.Decimal,    9),
                new SqlParameter("@DEL008", SqlDbType.Decimal,    9),
                new SqlParameter("@DEL009", SqlDbType.Decimal,    9),
                new SqlParameter("@DEL010", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL011", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL012", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL013", SqlDbType.NVarChar, 250),
                new SqlParameter("@DEL015", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL016", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL017", SqlDbType.NVarChar,  50),
                new SqlParameter("@DEL018", SqlDbType.NVarChar, 20)
            };
            parameters [0].Value  = model.DEL001;
            parameters [1].Value  = model.DEL002;
            parameters [2].Value  = model.DEL003;
            parameters [3].Value  = model.DEL004;
            parameters [4].Value  = model.DEL005;
            parameters [5].Value  = model.DEL006;
            parameters [6].Value  = model.DEL007;
            parameters [7].Value  = model.DEL008;
            parameters [8].Value  = model.DEL009;
            parameters [9].Value  = model.DEL010;
            parameters [10].Value = model.DEL011;
            parameters [11].Value = model.DEL012;
            parameters [12].Value = model.DEL013;
            parameters [13].Value = model.DEL015;
            parameters [14].Value = model.DEL016;
            parameters [15].Value = model.DEL017;
            parameters [16].Value = model.DEL018;

            SQLString.Add(strSql, parameters);
        }
Esempio n. 12
0
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="table"></param>
        /// <returns></returns>
        public bool Delete(DataTable table)
        {
            ArrayList     SQLString = new ArrayList( );
            StringBuilder strSql    = new StringBuilder( );

            SiftingDataEntity.MainEntity model = new SiftingDataEntity.MainEntity( );
            for (int i = 0; i < table.Rows.Count; i++)
            {
                model.idx = string.IsNullOrEmpty(table.Rows [i] ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["idx"].ToString( ));
                if (model.idx > 0)
                {
                    Delete(SQLString, strSql, model);
                }
            }

            return(SqlHelper.ExecuteSqlTran(SQLString));
        }
Esempio n. 13
0
        /// <summary>
        /// 审核  反审核
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Examine(SiftingDataEntity.MainEntity model)
        {
            StringBuilder strSql = new StringBuilder( );

            strSql.Append("UPDATE QIXDEL SET DEL014=@DEL014 WHERE DEL011=@DEL011");
            SqlParameter [] parameter =
            {
                new SqlParameter("@DEL011", SqlDbType.NVarChar, 50),
                new SqlParameter("@DEL014", SqlDbType.Bit)
            };
            parameter [0].Value = model.DEL011;
            parameter [1].Value = model.DEL014;

            int rows = SqlHelper.ExecuteNonQuery(strSql.ToString( ), parameter);

            return(rows > 0 ? true : false);
        }
Esempio n. 14
0
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <param name="table"></param>
        /// <param name="idxList"></param>
        /// <returns></returns>
        public bool Save(DataTable table, List <string> idxList)
        {
            Hashtable     SQLString = new Hashtable( );
            StringBuilder strSql    = new StringBuilder( );

            SiftingDataEntity.MainEntity model = new SiftingDataEntity.MainEntity( );
            for (int i = 0; i < table.Rows.Count; i++)
            {
                model.idx    = string.IsNullOrEmpty(table.Rows [i] ["idx"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["idx"].ToString( ));
                model.MAI001 = string.IsNullOrEmpty(table.Rows [i] ["MAI001"].ToString( )) == true ? DateTime.Now : Convert.ToDateTime(table.Rows [i] ["MAI001"].ToString( ));
                model.MAI002 = table.Rows [i] ["MAI002"].ToString( );
                model.MAI003 = table.Rows [i] ["MAI003"].ToString( );
                model.MAI004 = string.IsNullOrEmpty(table.Rows [i] ["MAI004"].ToString( )) == true ? 0 : Convert.ToInt32(table.Rows [i] ["MAI004"].ToString( ));
                //model . MAI005 = table . Rows [ i ] [ "MAI005" ] . ToString ( );
                if (model.idx < 1)
                {
                    if (Exists(model.MAI002))
                    {
                        Edit(SQLString, strSql, model);
                    }
                    else
                    {
                        Add(SQLString, strSql, model);
                    }
                }
                else
                {
                    Edits(SQLString, strSql, model);
                }
            }

            if (idxList.Count > 0)
            {
                foreach (string i in idxList)
                {
                    model.idx = Convert.ToInt32(i);
                    if (model.idx > 0)
                    {
                        Delete(SQLString, strSql, model);
                    }
                }
            }

            return(SqlHelper.ExecuteSqlTran(SQLString));
        }
Esempio n. 15
0
        public FormMain( )
        {
            InitializeComponent( );

            _bll  = new SiftingDataBll.Bll.MainBll( );
            model = new SiftingDataEntity.MainEntity( );

            barTool.LinksPersistInfo.RemoveAt(toolCanecl.Id);
            barTool.LinksPersistInfo.RemoveAt(toolSave.Id);
            barTool.LinksPersistInfo.RemoveAt(toolDelete.Id);
            barTool.LinksPersistInfo.RemoveAt(toolEdit.Id);
            barTool.LinksPersistInfo.RemoveAt(toolAdd.Id);

            getQueryForColumn( );
            Utility.GridViewMoHuSelect.SetFilter(gridLookUpEdit1View);
            Utility.GridViewMoHuSelect.SetFilter(sunOfNumA);
            Utility.GridViewMoHuSelect.SetFilter(gridView2);
            Utility.GridViewMoHuSelect.SetFilter(gridView3);
            Utility.GridViewMoHuSelect.SetFilter(gridView4);
            controlUnEnable( );
            layoutControlItem13.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
        }
Esempio n. 16
0
        void Add(Hashtable SQLString, StringBuilder strSql, SiftingDataEntity.MainEntity model)
        {
            strSql = new StringBuilder( );
            strSql.Append("insert into JIFMAI(");
            strSql.Append("MAI001,MAI002,MAI003,MAI004)");
            strSql.Append(" values (");
            strSql.Append("@MAI001,@MAI002,@MAI003,@MAI004)");
            SqlParameter [] parameters =
            {
                new SqlParameter("@MAI001", SqlDbType.Date,      3),
                new SqlParameter("@MAI002", SqlDbType.NVarChar, 50),
                new SqlParameter("@MAI003", SqlDbType.NVarChar, 50),
                new SqlParameter("@MAI004", SqlDbType.Int, 4)   //,
                //new SqlParameter("@MAI005", SqlDbType.NVarChar,200)
            };
            parameters [0].Value = model.MAI001;
            parameters [1].Value = model.MAI002;
            parameters [2].Value = model.MAI003;
            parameters [3].Value = model.MAI004;
            //parameters [ 4 ] . Value = model . MAI005;

            SQLString.Add(strSql, parameters);
        }
Esempio n. 17
0
 /// <summary>
 /// 审核  反审核
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool Examine(SiftingDataEntity.MainEntity model)
 {
     return(dal.Examine(model));
 }
Esempio n. 18
0
 void Delete(ArrayList SQLString, StringBuilder strSql, SiftingDataEntity.MainEntity model)
 {
     strSql = new StringBuilder( );
     strSql.AppendFormat("DELETE FROM JIFMAI WHERE idx={0}", model.idx);
     SQLString.Add(strSql);
 }