private void btnNew_Click(object sender, EventArgs e) { string KJQJ = ""; using (var Fm = new M03_期末管理.STK_期末结账_Select()) { if (Fm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var model = new Ref_WS_STK.DataType_会计期间(); model.ExAction = "New"; model.仓库编码 = Fm.PCKCode; AppServer.UsingWcf(() => { AppServer.wcfClient.BAS_会计期间_Edit(ref model); }); // if (model.ExResult != 0) { AppServer.ShowMsg(model.ErrorMsg); return; } else { AppServer.ShowMsg(String.Format("会计期间创建成功 {0}", model.会计期间)); this.DataBinding_cbx会计期间(); } } } }
private void btn结账_Click(object sender, EventArgs e) { using (var Fm = new M03_期末管理.STK_期末结账_Select()) { if (Fm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.Cursor = Cursors.WaitCursor; // var model = new Ref_WS_STK.DataType_会计期间(); model.ExAction = "JZ"; //结账 model.仓库编码 = Fm.PCKCode; AppServer.UsingWcf(() => { // AppServer.wcfClient.STK_期末结账_Edit(ref model); }); // this.Cursor = Cursors.Default; // if (model.ExResult != 0) { AppServer.ShowMsg_Error(model.ErrorMsg); } else { AppServer.ShowMsg("结账完成"); // this.DataBinding_cbx会计期间(); } } } }
private void DataBinding_dbGridView(int ARowIndex) { var model = new Ref_WS_STK.DataType_会计期间(); model.ExAction = "List"; model.仓库编码 = (string)this.cbx仓库编码.SelectedValue; model.年份 = this.dtp年份.Value.Year.ToString(); AppServer.UsingWcf(() => { this.dbGridView.DataSource = AppServer.wcfClient.BAS_会计期间_List(model).Tables[0]; }); // this.dbGridView.GoToRowByIndex(ARowIndex); }
private void btn结账_Click(object sender, EventArgs e) { string Period = ""; DataView dv = new DataView(this.dbGridView.DataSource as DataTable); dv.RowFilter = "结账标志 = 0"; if (dv.Count == 0) { AppServer.ShowMsg("对不起,没有找到未结账的会计期间"); return; } else { Period = dv[0]["会计期间"].ToString(); } // using (var Fm = new M03_期末管理.STK_期末结账_Select()) { Fm.SetValue(Period); if (Fm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.Cursor = Cursors.WaitCursor; // var model = new Ref_WS_STK.DataType_会计期间(); model.ExAction = "JZ"; //结账 model.仓库编码 = Fm.PCKCode; model.会计期间 = Period; AppServer.UsingWcf(() => { AppServer.wcfClient.BAS_会计期间_Edit(ref model); }); // this.Cursor = Cursors.Default; // if (model.ExResult != 0) { AppServer.ShowMsg_Error(model.ErrorMsg); } else { AppServer.ShowMsg(String.Format("{0}的账单已结账", Period)); } } } }
private void DataBinding_cbx会计期间() { var model = new Ref_WS_STK.DataType_会计期间(); model.ExAction = "AllFinish"; model.仓库编码 = (string)this.cbx仓库编码.SelectedValue; AppServer.UsingWcf(() => { this.cbx会计期间.ValueMember = "会计期间"; this.cbx会计期间.DisplayMember = "会计期间"; this.cbx会计期间.DataSource = AppServer.wcfClient.BAS_会计期间_List(model).Tables[0]; }); // if (this.cbx会计期间.Items.Count > 0) { this.cbx会计期间.SelectedIndex = 0; } }