コード例 #1
0
 private void btn修改状态_Click(object sender, EventArgs e)
 {
     if (this.dbGridView.SelectedRows.Count == 0)
     {
         return;
     }
     //
     using (var Fm = new BAS_存货设置_修改状态())
     {
         Fm.Editor_Mod(this.dbGridView.SelectedRows[0]);
         if (Fm.ShowDialog() == DialogResult.OK)
         {
             var model = new Ref_WS_STK.DataType_存货();
             model.ExAction = "Mod_ZT";
             foreach (DataGridViewRow Row in this.dbGridView.SelectedRows)
             {
                 model.存货编码 = Row.Cells["存货编码"].Value.ToString();
                 model.存货状态 = Fm.Value;
                 AppServer.UsingWcf(() =>
                 {
                     AppServer.wcfClient.BAS_存货_Edit(ref model);
                 });
                 //
                 if (model.ExResult != 0)
                 {
                     AppServer.ShowMsg_Error(model.ErrorMsg);
                     break;
                 }
             }
             //
             this.DataBinding_dbGridView(this.dbTreeView.SelectedNode.ID, 0);
         }
     }
 }
コード例 #2
0
 private void btn查询_Click(object sender, EventArgs e)
 {
     base.Cursor = Cursors.WaitCursor;
     //
     try
     {
         var model = new Ref_WS_STK.DataType_存货();
         model.ExAction = "RK_List";
         model.类别编码     = this.dbTreeView.SelectedNode.ID;
         model.存货名称     = this.txt存货名称.Text.Trim();
         model.默认仓库编码   = (string)this.cbx仓库编码.SelectedValue;
         AppServer.UsingWcf(() =>
         {
             this.dbGridView_CH.DataSource = AppServer.wcfClient.BAS_存货_List(model).Tables[0];
         });
     }
     catch (Exception exp)
     {
         AppServer.ShowMsg_Error(exp.Message);
     }
     //
     base.Cursor = Cursors.Arrow;
     //
     this.txt存货名称.Focus();
 }
コード例 #3
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            if (this.dbGridView.Rows.Count == 0)
            {
                return;
            }
            if (!AppServer.DialogMsg("确定要删除该存货"))
            {
                return;
            }
            //
            var model = new Ref_WS_STK.DataType_存货();

            model.ExAction = "Del";
            foreach (DataGridViewRow Row in this.dbGridView.SelectedRows)
            {
                model.存货编码 = Row.Cells["存货编码"].Value.ToString();
                AppServer.UsingWcf(() =>
                {
                    AppServer.wcfClient.BAS_存货_Edit(ref model);
                });
            }
            //
            if (model.ExResult != 0)
            {
                AppServer.ShowMsg_Error(model.ErrorMsg);
            }
            else
            {
                this.DataBinding_dbGridView(this.dbTreeView.SelectedNode.ID, 0);
            }
        }
コード例 #4
0
 public void DataBinding_dbGridView_WL(string ASortCode, int ARowIndex)
 {
     base.Cursor = Cursors.WaitCursor;
     //
     try
     {
         var model = new Ref_WS_STK.DataType_存货();
         model.ExAction = "CK_List";
         model.类别编码     = ASortCode;
         model.存货名称     = this.txt存货名称.Text.Trim();
         model.默认仓库编码   = (string)this.cbx仓库编码.SelectedValue;
         model.可出库      = this.chk可出库.Checked;
         AppServer.UsingWcf(() =>
         {
             this.dbGridView_CH.DataSource = AppServer.wcfClient.BAS_存货_List(model).Tables[0];
         });
         this.dbGridView_CH.GoToRowByIndex(ARowIndex);
     }
     catch
     { }
     //
     base.Cursor = Cursors.Arrow;
     //
     this.txt存货名称.Focus();
 }
コード例 #5
0
 private void dbTreeView_AfterSelect(object sender, TreeViewEventArgs e)
 {
     base.Cursor = Cursors.WaitCursor;
     //
     try
     {
         var model = new Ref_WS_STK.DataType_存货();
         model.ExAction = "CK_List";
         model.类别编码     = ((DBTreeNode)e.Node).ID;
         model.默认仓库编码   = (string)this.cbx仓库编码.SelectedValue;
         model.可出库      = this.chk可出库.Checked;
         AppServer.UsingWcf(() =>
         {
             this.dbGridView_CH.DataSource = AppServer.wcfClient.BAS_存货_List(model).Tables[0];
         });
         this.dbGridView_CH.GoToRowByIndex(0);
     }
     catch (Exception exp)
     {
         AppServer.ShowMsg_Error(exp.Message);
     }
     //
     base.Cursor = Cursors.Arrow;
     //
     this.txt存货名称.Focus();
 }
コード例 #6
0
        public void DataBinding_dbGridView()
        {
            var model = new Ref_WS_STK.DataType_存货();

            model.类别编码 = _lbcode;
            model.包含下级 = false;
            model.存货名称 = this.txt存货名称.Text.Trim();
            AppServer.UsingWcf(() =>
            {
                this.dbGridView.DataSource = AppServer.wcfClient.BAS_存货_List(model).Tables[0];
            });
        }
コード例 #7
0
        private void DataBinding_cbx计量单位()
        {
            var model = new Ref_WS_STK.DataType_存货();

            model.ExAction = "JLDW";
            AppServer.UsingWcf(() =>
            {
                this.cbx计量单位.ValueMember   = "ID";
                this.cbx计量单位.DisplayMember = "计量单位";
                this.cbx计量单位.DataSource    = AppServer.wcfClient.BAS_存货_List(model).Tables[0];
            });
            //
            this.cbx计量单位.SelectedIndex = -1;
        }
コード例 #8
0
        public void DataBinding_dbGridView(string ASortCode, int ARowIndex)
        {
            base.Cursor = Cursors.WaitCursor;
            //
            var model = new Ref_WS_STK.DataType_存货();

            model.类别编码 = ASortCode;
            model.存货状态 = this.cbx类别状态.SelectedValue.ToIntegerDef();
            AppServer.UsingWcf(() =>
            {
                this.dbGridView.DataSource = AppServer.wcfClient.BAS_存货_List(model).Tables[0];
            });
            this.lbl物资.Text = String.Format("共有 {0} 条记录", this.dbGridView.Rows.Count);
            //
            this.dbGridView.GoToRowByIndex(ARowIndex);
            //
            base.Cursor = Cursors.Arrow;
        }
コード例 #9
0
        public void DataBinding_dbGridView_WL(string ASortCode, int ARowIndex)
        {
            base.Cursor = Cursors.WaitCursor;
            //
            var model = new Ref_WS_STK.DataType_存货();

            model.ExAction = "SlCCH";
            model.类别编码     = ASortCode;
            model.存货状态     = 0;
            model.包含下级     = this.chkShowSubCode.Checked;
            AppServer.UsingWcf(() =>
            {
                this.dbGridView_WL.DataSource = AppServer.wcfClient.BAS_存货_List(model).Tables[0];
            });
            this.dbGridView_WL.GoToRowByIndex(ARowIndex);
            //
            base.Cursor = Cursors.Arrow;
        }
コード例 #10
0
        private void btnBind_Click(object sender, EventArgs e)
        {
            if (this.dbGridView_RK.Rows.Count == 0 || this.dbGridView_RK.SelectedCells.Count == 0)
            {
                return;
            }
            //
            DataTable dt    = null;
            var       model = new Ref_WS_STK.DataType_存货();

            model.ExAction = "IsBind";
            model.存货编码     = this.dbGridView_RK.Rows[this.dbGridView_RK.CurrentCell.RowIndex].Cells["存货编码"].Value.ToString();
            model.默认仓库编码   = (string)this.cbx仓库编码.SelectedValue;
            AppServer.UsingWcf(() =>
            {
                dt = AppServer.wcfClient.BAS_存货_List(model).Tables[0];
            });
            //
            if (dt.Rows.Count > 0)
            {
                if (!AppServer.DialogMsg(String.Format("存货“{0}”已经在货架“{1}”上了,是否更改存放货架?",
                                                       this.dbGridView_RK.Rows[this.dbGridView_RK.CurrentCell.RowIndex].Cells["存货名称"].Value,
                                                       dt.Rows[0]["仓库名称"].ToString())))
                {
                    return;
                }
            }
            //
            using (var Fm = new M01_基础设置.BAS_货架设置_Select())
            {
                Fm.Select_Mod((string)this.cbx仓库编码.SelectedValue);
                if (Fm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    foreach (DataGridViewCell Cell in this.dbGridView_RK.SelectedCells)
                    {
                        this.dbGridView_RK.Rows[Cell.RowIndex].Cells["存放货架"].Value = Fm.CKName;
                        this.dbGridView_RK.Rows[Cell.RowIndex].Cells["货架编码"].Value = Fm.CKCode;
                    }
                }
            }
        }
コード例 #11
0
 private void btn设置存放仓库_Click(object sender, EventArgs e)
 {
     if (this.dbGridView.SelectedRows.Count == 0)
     {
         return;
     }
     //
     using (var Fm = new BAS_存货设置_选择仓库())
     {
         Fm.Editor_Mod(this.dbGridView.SelectedRows[0].Cells["默认仓库编码"].Value.ToString());
         if (Fm.ShowDialog() == DialogResult.OK)
         {
             this.Cursor = Cursors.WaitCursor;
             //
             var model = new Ref_WS_STK.DataType_存货();
             model.ExAction = "Bind_MRCK";
             AppServer.UsingWcf(() =>
             {
                 foreach (DataGridViewRow Row in this.dbGridView.SelectedRows)
                 {
                     model.存货编码   = Row.Cells["存货编码"].Value.ToString();
                     model.默认仓库编码 = Fm.CKCodes;
                     AppServer.wcfClient.BAS_存货_Edit(ref model);
                     //
                     if (model.ExResult != 0)
                     {
                         AppServer.ShowMsg_Error(model.ErrorMsg);
                         break;
                     }
                     //
                     Row.Cells["默认仓库"].Value   = Fm.CKNames;
                     Row.Cells["默认仓库编码"].Value = Fm.CKCodes;
                 }
             });
             //
             this.Cursor = Cursors.Default;
         }
     }
 }
コード例 #12
0
        private bool PostData()
        {
            if (String.IsNullOrWhiteSpace(this.txt存货名称.Text))
            {
                AppServer.ShowMsg("存货名称不能为空或是全部空格");
                return(false);
            }
            if (this.rdbtn自定义.Checked && String.IsNullOrEmpty(this.txt存货序号.Text))
            {
                AppServer.ShowMsg("您选择的插入顺序为自定义,但没有选择存货");
                return(false);
            }
            //
            var model = new Ref_WS_STK.DataType_存货();

            model.ExAction = this.Tag.ToString();
            model.存货编码     = this.txt存货名称.Tag.ToString();
            TY.Helper.FormHelper.DataBinding_DataSourceToModel(this, model);
            model.类别编码          = this.txt类别名称.Tag.ToString();
            model.计量单位          = this.cbx计量单位.Text;
            model.LoginUserCode = AppServer.LoginUserCode;
            model.一个序号          = this.rdbtn自定义.Checked ? this.txt存货序号.Tag.ToIntegerDef() : -1;
            AppServer.UsingWcf(() =>
            {
                AppServer.wcfClient.BAS_存货_Edit(ref model);
            });
            //
            if (model.ExResult != 0)
            {
                AppServer.ShowMsg_Error(model.ErrorMsg);
                return(false);
            }
            if (this.OnAddNewDataEvent != null)
            {
                this.OnAddNewDataEvent(this.txt类别名称.Tag.ToString(), model.类别序号);
            }
            return(true);
        }