private void DataBinding_dbTreeView() { base.Cursor = Cursors.WaitCursor; try { var model = new Ref_WS_STK.DataType_存货_类别(); model.ExAction = "Tree"; model.类别状态 = 0; AppServer.UsingWcf(() => { this.dbTreeView.DataSource = AppServer.wcfClient.BAS_存货_类别_List(model).Tables[0]; }); // this.dbTreeView.ClearTrees(); this.dbTreeView.NodeID = "类别编码"; this.dbTreeView.NodePID = "上级编码"; this.dbTreeView.NodeTitle = "类别名称"; this.dbTreeView.BuildTrees(); this.dbTreeView.Nodes[0].Expand(); this.dbTreeView.SelectedNode = (DBTreeNode)this.dbTreeView.Nodes[0]; } catch (Exception ex) { AppServer.ShowMsg_ExceptError(ex.Message); return; } finally { AppServer.WcfService_Close(); base.Cursor = Cursors.Arrow; } }
private void DataBinding_cbx类别状态() { DataTable dt = null; // var model = new Ref_WS_STK.DataType_存货_类别(); model.ExAction = "LBZT"; AppServer.UsingWcf(() => { dt = AppServer.wcfClient.BAS_存货_类别_List(model).Tables[0]; }); // DataRow row = dt.NewRow(); row["ID"] = 0; row["类别状态名称"] = "所有的"; dt.Rows.Add(row); // DataView dv = new DataView(dt); dv.Sort = "ID ASC"; // this.cbx类别状态.ValueMember = "ID"; this.cbx类别状态.DisplayMember = "类别状态名称"; this.cbx类别状态.DataSource = dv; // this.cbx类别状态.SelectedIndex = 1; }
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; } }
private void DataBinding_cbx类别状态() { DataTable dt = null; // var model = new Ref_WS_STK.DataType_存货_类别(); model.ExAction = "LBZT"; AppServer.UsingWcf(() => { dt = AppServer.wcfClient.BAS_存货_类别_List(model).Tables[0]; }); // this.cbx存货状态.ValueMember = "ID"; this.cbx存货状态.DisplayMember = "类别状态名称"; this.cbx存货状态.DataSource = dt; }
private Boolean PostData() { if (this.txt类别名称.Text == "") { AppServer.ShowMsg("请输入类别名称"); this.txt类别名称.Focus(); return(false); } // try { var model = new Ref_WS_STK.DataType_存货_类别(); model.ExAction = this.Tag.ToString(); TY.Helper.FormHelper.DataBinding_DataSourceToModel(this, model); model.级编码 = this.txt上级类别名称.Tag.ToString(); model.类别编码 = this.txt类别名称.Tag.ToString(); model.类别状态 = this.cbx类别状态.SelectedValue.ToIntegerDef(); model.LoginUserCode = AppServer.LoginUserCode; AppServer.UsingWcf(() => { AppServer.wcfClient.BAS_存货_类别_Edit(ref model); }); if (model.ExResult != 0) { AppServer.ShowMsg_SubmitError(model.ErrorMsg); return(false); } // this.NewSortName = this.txt类别名称.Text; if (this.OnAddNewNodeEvent != null) { this.OnAddNewNodeEvent(model.级编码, model.类别编码, model.类别名称); } } catch (Exception ex) { AppServer.ShowMsg_ExceptError(ex.Message); return(false); } return(true); }
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; }
private void DataBinding_dbGridView(string ASortCode, int ARowIndex) { base.Cursor = Cursors.WaitCursor; try { var model = new Ref_WS_STK.DataType_存货_类别(); model.级编码 = ASortCode; model.类别状态 = this.cbx类别状态.SelectedValue.ToIntegerDef(); model.PageRows = 0; AppServer.UsingWcf(() => { this.dbGridView.DataSource = AppServer.wcfClient.BAS_存货_类别_List(model).Tables[0]; }); this.dbGridView.GoToRowByIndex(ARowIndex); } catch (Exception exp) { AppServer.ShowMsg_Error(exp.Message); } finally { base.Cursor = Cursors.Arrow; } }