public void down() { try { IBLL.IClientBLL bll = new BLL.ClientBLL(); if (1 == 1) { int errId = 0; string errMsg = ""; bll.DownLoadBranch(out errId, out errMsg); if (errId != 0) { if (deleg != null) { mainCon.Invoke(deleg, -2, "下载机构档案异常:" + errMsg); } else { throw new Exception(errMsg); } } else { if (deleg != null) { mainCon.Invoke(deleg, 1, "下载机构档案完成"); } } } if (chk1 == true) { int errId = 0; string errMsg = ""; bll.DownLoadItemCls(out errId, out errMsg); if (errId != 0) { if (deleg != null) { mainCon.Invoke(deleg, -2, "下载品类档案异常:" + errMsg); } else { throw new Exception(errMsg); } } else { if (deleg != null) { mainCon.Invoke(deleg, 1, "下载品类档案完成"); } } bll.DownLoadItem(out errId, out errMsg); if (errId != 0) { if (deleg != null) { mainCon.Invoke(deleg, -2, "下载商品档案异常:" + errMsg); } else { throw new Exception(errMsg); } } else { if (deleg != null) { mainCon.Invoke(deleg, 1, "下载商品档案完成"); } } } if (chk2 == true) { int errId = 0; string errMsg = ""; bll.DownLoadOper(out errId, out errMsg); if (errId != 0) { if (deleg != null) { mainCon.Invoke(deleg, -2, "下载操作员档案异常:" + errMsg); } else { throw new Exception(errMsg); } } else { if (deleg != null) { mainCon.Invoke(deleg, 1, "下载操作员档案完成"); } } } if (chk3 == true) { int errId = 0; string errMsg = ""; bll.DownLoadStock(out errId, out errMsg); if (errId != 0) { if (deleg != null) { mainCon.Invoke(deleg, -2, "下载库存/成本异常:" + errMsg); } else { throw new Exception(errMsg); } } else { if (deleg != null) { mainCon.Invoke(deleg, 1, "下载库存/成本完成"); } } } if (chk4 == true) { int errId = 0; string errMsg = ""; bll.DownLoadSupCus(out errId, out errMsg); if (errId != 0) { if (deleg != null) { mainCon.Invoke(deleg, -2, "下载供应商/客户档案异常:" + errMsg); } else { throw new Exception(errMsg); } } else { if (deleg != null) { mainCon.Invoke(deleg, 1, "下载供应商/客户档案完成"); } } } if (chk5 == true) { int errId = 0; string errMsg = ""; bll.DownLoadSupPrice("", "", out errId, out errMsg); if (errId != 0) { if (deleg != null) { mainCon.Invoke(deleg, -2, "下载供应商价格异常:" + errMsg); } else { throw new Exception(errMsg); } } else { if (deleg != null) { mainCon.Invoke(deleg, 1, "下载供应商价格完成"); } } errId = 0; errMsg = ""; bll.DownLoadCusPrice("", "", out errId, out errMsg); if (errId != 0) { if (deleg != null) { mainCon.Invoke(deleg, -2, "下载客户价格异常:" + errMsg); } else { throw new Exception(errMsg); } } else { if (deleg != null) { mainCon.Invoke(deleg, 1, "下载客户价格完成"); } } } if (1 == 1) { int errId = 0; string errMsg = ""; bll.DownLoadSystemPars(out errId, out errMsg); if (errId != 0) { if (deleg != null) { mainCon.Invoke(deleg, -2, "下载系统参数异常:" + errMsg); } else { throw new Exception(errMsg); } } else { if (deleg != null) { mainCon.Invoke(deleg, 1, "下载系统参数完成"); } } } if (deleg != null) { mainCon.Invoke(deleg, 0, ""); } } catch (Exception ex) { Log.writeLog("frmDownload ->downThread()", ex.GetMessage(), ex.StackTrace); if (deleg != null) { mainCon.Invoke(deleg, -1, ex.GetMessage()); } } }
private void label14_Click(object sender, EventArgs e) { try { Cursor.Current = Cursors.WaitCursor; if (txt_branch_no.Text.Trim().Length == 0) { new MsgForm("机构编码不能为空").ShowDialog(); return; } string mo_ling = "0"; string weight_model = "1"; string input_cus_model = "1"; if (radioButton2.Checked) { mo_ling = "1"; } else if (radioButton3.Checked) { mo_ling = "2"; } else if (radioButton4.Checked) { mo_ling = "3"; } if (radioButton6.Checked) { weight_model = "2"; } if (radioButton8.Checked) { input_cus_model = "2"; } var can_input_qty = "1"; if (!chk_input_qty.Checked) { can_input_qty = "0"; } var is_continue_weight = "0"; if (chk_continue_weight.Checked) { is_continue_weight = "1"; } IBLL.ISysBLL bll = new BLL.SysBLL(); var lst = new List <Model.bt_par_setting>(); lst.Add(new Model.bt_par_setting { par_id = "mo_ling", par_val = mo_ling }); lst.Add(new Model.bt_par_setting { par_id = "weight_model", par_val = weight_model }); lst.Add(new Model.bt_par_setting { par_id = "branch_no", par_val = txt_branch_no.Text }); lst.Add(new Model.bt_par_setting { par_id = "jh", par_val = txt_jh.Text }); lst.Add(new Model.bt_par_setting { par_id = "input_cus_model", par_val = input_cus_model }); lst.Add(new Model.bt_par_setting { par_id = "print_count", par_val = txt_print_count.Text }); lst.Add(new Model.bt_par_setting { par_id = "can_input_qty", par_val = can_input_qty }); lst.Add(new Model.bt_par_setting { par_id = "is_continue_weight", par_val = is_continue_weight }); bll.UpdateParSetting(lst); Program.mo_ling = mo_ling; Program.weight_model = weight_model; Program.branch_no = txt_branch_no.Text; Program.jh = txt_jh.Text; Program.input_cus_model = input_cus_model; Program.print_count = Conv.ToInt(txt_print_count.Text); Program.can_input_qty = can_input_qty; Program.is_continue_weight = is_continue_weight; if (!SoftUpdate.PermissionsBalidation()) { IBLL.IClientBLL bll2 = new BLL.ClientBLL(); int errId = 0; string errMsg = ""; bll2.DownLoadOper(out errId, out errMsg); } var frm = new MsgForm("修改参数设置成功"); frm.ShowDialog(); this.DialogResult = DialogResult.OK; this.Close(); } catch (Exception ex) { new MsgForm(ex.GetMessage()).ShowDialog(); } finally { Cursor.Current = Cursors.Default; } }
private void WaitForm_Shown(object sender, EventArgs e) { if (this.op_type == "1") { try { IBLL.IClientBLL bll = new BLL.ClientBLL(); if (1 == 1) { int errId = 0; string errMsg = ""; bll.DownLoadBranch(out errId, out errMsg); if (errId != 0) { new MsgForm("下载机构档案异常:" + errMsg).ShowDialog(); Log.writeLog("WaitForm()", "下载机构档案异常:" + errMsg, null); } Application.DoEvents(); } if (1 == 1) { int errId = 0; string errMsg = ""; bll.DownLoadOper(out errId, out errMsg); if (errId != 0) { new MsgForm("下载操作员档案异常:" + errMsg).ShowDialog(); Log.writeLog("WaitForm()", "下载操作员档案异常:" + errMsg, null); } Application.DoEvents(); } if (1 == 1) { int errId = 0; string errMsg = ""; bll.DownLoadSystemPars(out errId, out errMsg); if (errId != 0) { new MsgForm("下载系统参数异常:" + errMsg).ShowDialog(); Log.writeLog("WaitForm()", "下载系统参数异常:" + errMsg, null); } Application.DoEvents(); } } catch (Exception ex) { new MsgForm("初始化数据异常:" + ex.GetMessage()).ShowDialog(); Log.writeLog("WaitForm()", "初始化数据异常:" + ex.GetMessage(), null); } finally { timer1.Stop(); DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } } else if (this.op_type == "2") { } }