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(0);
            }
        }
Пример #2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            this.SelectState = this.cbx类别状态.SelectedValue.ToIntegerDef();
            //
            if (!AppServer.DialogMsg("确认要修改当前类别的状态吗?"))
            {
                return;
            }
            //
            if (this.SelectState == 3)
            {
                if (!AppServer.DialogMsg("当前类别下架后,此类别的下级类别及其所属商品将一块下架,确认要进行?"))
                {
                    return;
                }
            }
            //
            var model = new Ref_WS_STK.DataType_存货_类别();

            model.ExAction = "Mod_ZT";
            model.类别编码     = this.txt类别名称.Tag.ToString();
            model.类别状态     = this.SelectState;
            AppServer.UsingWcf(() =>
            {
                AppServer.wcfClient.BAS_存货_类别_Edit(ref model);
            });
            if (model.ExResult != 0)
            {
                AppServer.ShowMsg_Error(model.ErrorMsg);
            }
            else
            {
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
        }
Пример #3
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            if (this.dbGridView.Rows.Count == 0)
            {
                return;
            }
            if (!AppServer.DialogMsg(String.Format("确定要删除“{0}”出库单?",
                                                   this.dbGridView.SelectedRows[0].Cells["单据编码"].Value)))
            {
                return;
            }
            //
            var model = new Ref_WS_STK.DataType_库存管理();

            model.ExAction      = "Del";
            model.单据编码          = this.dbGridView.SelectedRows[0].Cells["单据编码"].Value.ToString();
            model.LoginUserCode = AppServer.LoginUserCode;
            AppServer.UsingWcf(() =>
            {
                AppServer.wcfClient.STK_库存出库_Edit(ref model);
            });
            //
            if (model.ExResult != 0)
            {
                AppServer.ShowMsg_Error(model.ErrorMsg);
            }
            else
            {
                this.DataBinding_dbGridView(0);
            }
        }
Пример #4
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     if (!AppServer.DialogMsg("是否放弃储物箱绑定信息?"))
     {
         return;
     }
     this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
 }
Пример #5
0
        private void btn提交_Click(object sender, EventArgs e)
        {
            Properties.Settings.Default.CKCode = (string)this.cbx仓库编码.SelectedValue;
            Properties.Settings.Default.Save();
            //
            if (this.dbGridView_RK.Rows.Count == 0)
            {
                AppServer.ShowMsg("入库单没有数据,无法提交!");
                return;
            }
            if (this.cbx供应商编码.SelectedIndex == -1 && String.IsNullOrWhiteSpace(this.txt原始单号.Text))
            {
                if (!AppServer.DialogMsg("供应商、原始单号为空,是否继续?"))
                {
                    return;
                }
            }
            else if (this.cbx供应商编码.SelectedIndex == -1)
            {
                if (!AppServer.DialogMsg("供应商为空,是否继续?"))
                {
                    return;
                }
            }
            else if (String.IsNullOrWhiteSpace(this.txt原始单号.Text))
            {
                if (!AppServer.DialogMsg("原始单号为空,是否继续?"))
                {
                    return;
                }
            }
            //
            this.Cursor = Cursors.WaitCursor;
            //
            var model = new Ref_WS_STK.DataType_库存管理();

            TY.Helper.FormHelper.DataBinding_DataSourceToModel(this, model);
            model.ExAction      = this.btnEnter.Tag.ToString();
            model.单据编码          = this.Tag.ToString();
            model.LoginUserCode = AppServer.LoginUserCode;
            model.MxDataXML     = ((DataTable)this.dbGridView_RK.DataSource).ToXml("ar");
            AppServer.UsingWcf(() =>
            {
                AppServer.wcfClient.STK_库存入库_Edit(ref model);
            });
            //
            this.Cursor = Cursors.Arrow;
            //
            if (model.ExResult != 0)
            {
                AppServer.ShowMsg_Error(model.ErrorMsg.Replace("\\n", "\n"));
                return;
            }
            else
            {
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
        }
Пример #6
0
        private void btnDelRole_Click(object sender, EventArgs e)
        {
            if (this.listView.SelectedItems.Count == 0)
            {
                return;
            }
            if (this.listView.SelectedItems[0].SubItems[3].Text == "")
            {
                AppServer.ShowMsg_Warn("您无权修改系统内置定义的角色!");
                return;
            }
            if (!AppServer.DialogMsg("确认要删除当前角色的定义吗?", "删除确认"))
            {
                return;
            }

            int iRoleID = int.Parse(this.listView.SelectedItems[0].SubItems[2].Text);

            if (iRoleID == 0)
            {
                return;
            }

            //开始删除
            base.Cursor = Cursors.WaitCursor;
            try
            {
                if (!AppServer.WcfService_Open())
                {
                    return;
                }

                var dtm = new Ref_WS_STK.DataType_Role();
                dtm.ExAction      = "Del";
                dtm.RoleID        = iRoleID;
                dtm.LoginUserCode = AppServer.LoginUserCode;

                AppServer.wcfClient.Sys_Role_Edit(ref dtm);

                if (dtm.ExResult != 0)
                {
                    AppServer.ShowMsg_SubmitError(dtm.ErrorMsg);
                    return;
                }
                //直接删除显示
                this.listView.Items.Remove(this.listView.SelectedItems[0]);
            }
            catch (Exception ex)
            {
                AppServer.ShowMsg_ExceptError(ex.Message);
                return;
            }
            finally
            {
                AppServer.WcfService_Close();
                base.Cursor = Cursors.Arrow;
            }
        }
Пример #7
0
        private void btnDelUser_Click(object sender, EventArgs e)
        {
            if ((dbGridView.Rows.Count == 0) || (dbGridView.SelectedRows.Count == 0))
            {
                return;
            }
            if (!AppServer.DialogMsg("确认要删除当前用户吗?", "删除确认"))
            {
                return;
            }

            string sUserCode = this.dbGridView.CurrentRow.Cells["UserCode"].Value.ToString().Trim();

            //开始删除
            base.Cursor = Cursors.WaitCursor;
            try
            {
                var dmt = new Ref_WS_STK.DataType_User();
                dmt.UserCode = sUserCode;
                dmt.ExAction = "Del";

                if (!AppServer.WcfService_Open())
                {
                    return;
                }
                //
                AppServer.wcfClient.Sys_User_Edit(ref dmt);

                if (dmt.ExResult != 0)
                {
                    AppServer.ShowMsg_Error(dmt.ErrorMsg);
                    return;
                }
                this.DataBinding_dbGridView(this.dbGridView.CurrentRow.Index - 1);
            }
            catch (Exception ex)
            {
                AppServer.ShowMsg_SubmitError(ex.Message);
                return;
            }
            finally
            {
                AppServer.WcfService_Close();
                base.Cursor = Cursors.Arrow;
            }
        }
Пример #8
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;
                    }
                }
            }
        }
        private void btnDel_Click(object sender, EventArgs e)
        {
            if (this.dbTreeView.SelectedNode.Parent == null)
            {
                return;
            }
            if (this.dbTreeView.SelectedNode.Level == 0)
            {
                return;
            }
            if (this.dbTreeView.SelectedNode.Nodes.Count > 0)
            {
                AppServer.ShowMsg("请先删除当前类别下的子类别后再删除当前类别!");
                return;
            }
            if (!AppServer.DialogMsg("确认要删除当前类别吗?"))
            {
                return;
            }
            //
            var model = new Ref_WS_STK.DataType_存货_类别();

            model.ExAction = "Del";
            model.类别编码     = this.dbTreeView.SelectedNode.ID;
            AppServer.UsingWcf(() =>
            {
                AppServer.wcfClient.BAS_存货_类别_Edit(ref model);
            });
            //
            if (model.ExResult != 0)
            {
                AppServer.ShowMsg_SubmitError(model.ErrorMsg);
                return;
            }
            DBTreeNode pnode = (DBTreeNode)this.dbTreeView.SelectedNode.Parent;

            this.dbTreeView.SelectedNode.Remove();
            this.dbTreeView.SelectedNode = pnode;
        }