private void display明細(CWork p_work) { GridView2.DataSource = null; GridView2.DataBind(); GridView1.DataSource = getDataTableByDisplay明細(p_work); GridView1.DataBind(); }
public async void Submit() { Work createdWork = await CWork.PostWorkAsync(this.CWork); //TODO: Error handling Messenger.Raise(new WindowActionMessage(WindowAction.Close, "ShowSubmitCommand")); }
private void search() { string l_strBDate = _txtBDate.Text.Trim(); string l_strEDate = _txtEDate.Text.Trim(); string l_strUserId = (Session[SealedGlobalPage.SESSIONKEY_LOGIN_USER_DATA] as CUser).f_userid帳號; //2011-08-31 增加完工日查詢 bool l_bool完工日 = false; if (_chk完工日.Checked) { l_bool完工日 = true; } //先查詢該人員所有業績單號 CConstruction[] l_CConstruction = _context.CFactoryManager.CConstructionFactory.get業績By施工人員(l_strUserId, l_strBDate, l_strEDate, l_bool完工日); if (l_CConstruction.Length <= 0) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "Error", "alert('無任何實績資料!請重新確認');", true); return; } CWork l_work = _context.CFactoryManager.CWorkFactory.createCWork(); l_work.tb施工人員業績 = l_CConstruction; //查詢所有單號資料 CWork[] l_works = _context.CFactoryManager.CWorkFactory.get工單資訊By施工人員檔(l_work); display(l_works); }
protected void Page_Load(object sender, EventArgs e) { _context = SealedGlobalPage.getContext(this); string l_workid = Request["workid"]; CWork l_work = _context.CFactoryManager.CWorkFactory.get工單資訊By單號(l_workid); display明細(l_work); }
private void display工單(CWork p_work) { _lbl工單種類.Text = p_work.f_type工單種類; _lbl工單種類1.Text = p_work.f_type工單種類; _lbl工單單號.Text = p_work.f_workid工單單號; _lbl工單單號1.Text = p_work.f_workid工單單號; _lbl引擎號碼.Text = p_work.f_engo引擎號碼; _lbl引擎號碼1.Text = p_work.f_engo引擎號碼; CUser l_user顧客名稱 = _context.CFactoryManager.CUserFactory.get高都員工檔(p_work.f_customerid顧客名稱); if (l_user顧客名稱 == null) { _lbl顧客名稱.Text = p_work.f_customerid顧客名稱; _lbl顧客名稱1.Text = p_work.f_customerid顧客名稱; } else { _lbl顧客名稱.Text = p_work.f_customerid顧客名稱 + "(" + l_user顧客名稱.f_username姓名 + ")"; _lbl顧客名稱1.Text = p_work.f_customerid顧客名稱 + "(" + l_user顧客名稱.f_username姓名 + ")";; } _lbl洗車種類.Text = p_work.f_workType洗車種類 + "(" + _context.CFactoryManager.CWorkTypeFactory. getCWorkTypeBy代碼(p_work.f_workType洗車種類).f_typename洗車種類名稱 + ")"; _lbl洗車種類1.Text = _lbl洗車種類.Text; _lbl金額.Text = p_work.f_money金額.ToString(); _lbl金額1.Text = p_work.f_money金額.ToString(); _lbl備註.Text = p_work.f_memo備註; _lbl備註1.Text = p_work.f_memo備註; if ("F1000".Equals(p_work.f_edituser開單人員)) { p_work.f_edituser開單人員 = "F1001"; } CUser l_user = _context.CFactoryManager.CUserFactory.get高都員工檔(p_work.f_edituser開單人員); if (!"".Equals(p_work.f_seruser服務專員)) { _lbl開單人員.Text = p_work.f_edituser開單人員 + "(" + l_user.f_username姓名 + ")" + " 專員:" + p_work.f_seruser服務專員; _lbl開單人員1.Text = p_work.f_edituser開單人員 + "(" + l_user.f_username姓名 + ")" + " 專員:" + p_work.f_seruser服務專員; } else { _lbl開單人員.Text = p_work.f_edituser開單人員 + "(" + l_user.f_username姓名 + ")"; _lbl開單人員1.Text = p_work.f_edituser開單人員 + "(" + l_user.f_username姓名 + ")"; } _lbl開單日期.Text = p_work.f_editdate開單日期; _lbl開單日期1.Text = p_work.f_editdate開單日期; _lbl介紹人.Text = p_work.f_introducer介紹人; _lbl介紹人1.Text = p_work.f_introducer介紹人; _lbl保險代碼.Text = p_work.f_insuranceid保險代碼; _lbl保險代碼1.Text = p_work.f_insuranceid保險代碼; _lbl工單所別.Text = p_work.f_branchid工單所別; _lbl工單所別1.Text = p_work.f_branchid工單所別; }
protected void Page_Load(object sender, EventArgs e) { _context = SealedGlobalPage.getContext(this); string l_strworkid = Request["id"]; CWork l_work = Session[l_strworkid] as CWork; display工單(l_work); }
protected void Page_Load(object sender, EventArgs e) { _context = SealedGlobalPage.getContext(this); CWork l_work = get登入的工單(); if (!Page.IsPostBack) { display工單(l_work); } }
private void display工單(CWork p_work) { _lbl工單號碼.Text = p_work.f_workid工單單號; _lbl引擎號碼.Text = p_work.f_engo引擎號碼; _lbl顧客名稱.Text = p_work.f_customerid顧客名稱; _lbl洗車種類.Text = p_work.f_workType洗車種類; _lbl金額.Text = p_work.f_money金額.ToString(); _lbl備註.Text = p_work.f_memo備註; _lbl開單人員.Text = p_work.f_edituser開單人員; //_lbl開單日期.Text = p_work.f_editdate開單日期; }
protected void _完工_Click(object sender, EventArgs e) { CWork l_work = get登入的工單(); l_work.f_closeDate完工日 = DateTime.Today.ToString("yyyy/MM/dd"); l_work.f_staus狀態 = "完工"; _context.CFactoryManager.CWorkFactory.update(l_work); ScriptManager.RegisterClientScriptBlock(this, typeof(FrmCloseWork), "OK", "alert('完工成功!');", true); ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", "window.location.href='./FrmUpdateIndex.aspx';", true); }
protected void _btn開立_Click(object sender, ImageClickEventArgs e) { //try //{ //使用者輸入的資料無誤再執行新增code if (使用者輸入資訊()) { CWork l_work = _context.CFactoryManager.CWorkFactory.createCWork(); l_work.f_workid工單單號 = _txt工單號碼.Text.Trim(); l_work.f_engo引擎號碼 = _txt引擎號碼.Text.ToUpper().Trim(); l_work.f_customerid顧客名稱 = _txt顧客名稱.Text.ToUpper(); l_work.f_workType洗車種類 = _ddl洗車種類.SelectedValue; l_work.f_money金額 = Convert.ToInt32(_txt金額.Text); l_work.f_memo備註 = _txt備註.Text.Trim();; l_work.f_edituser開單人員 = (Session[SealedGlobalPage.SESSIONKEY_LOGIN_USER_DATA] as CUser).f_userid帳號; l_work.f_editdate開單日期 = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); l_work.f_closeDate完工日 = ""; l_work.f_introducer介紹人 = _txt介紹人.Text.ToUpper(); l_work.f_type工單種類 = _lbl工單種類.Text; l_work.f_insuranceid保險代碼 = _rdo保險公司.SelectedValue; if ("保險".Equals(_lbl工單種類.Text)) { l_work.f_insurancetype保險型態 = _rdo保險型態.SelectedValue; } else { l_work.f_insurancetype保險型態 = ""; } l_work.f_staus狀態 = "待處理"; l_work.f_branchid工單所別 = (Session[SealedGlobalPage.SESSIONKEY_LOGIN_USER_DATA] as CUser).f_branchid所別; l_work.f_seruser服務專員 = _lbl服務專員.Text; _context.CFactoryManager.CWorkFactory.insert(l_work); CUser l_user = Session[SealedGlobalPage.SESSIONKEY_LOGIN_USER_DATA] as CUser; //新車才需要新增應收帳款還有業代的招攬附魔 Important !!! By Fox if ("新車".Equals(_lbl工單種類.Text) || ("新車保值計畫(TN覆膜)".Equals(_lbl工單種類.Text) && l_user.f_branch所別名稱.IndexOf("所") > 0)) { 新增應收帳款(l_work); } ScriptManager.RegisterClientScriptBlock(this, typeof(FrmInsertWork), "OK", "alert('開立完成!請列印工單留底');", true); ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", "window.location.href='./FrmIndex.aspx';", true); } //} //catch { ScriptManager.RegisterClientScriptBlock(this, typeof(FrmInsertWork), "OK", "alert('開立失敗!請檢察網路是否正常');", true); return; } }
private void 新增應收帳款(CWork p_work) { CInMoney l_InMoney = _context.CFactoryManager.CInMoneyFactory.createCInMoney(); l_InMoney.f_editdate帳款日期 = DateTime.Now.ToString("yyyy/MM/dd"); l_InMoney.f_isclose是否關帳 = "N"; l_InMoney.f_memo備註 = ""; l_InMoney.f_moneyid應收單號 = ""; l_InMoney.f_money應收金額 = p_work.f_money金額; l_InMoney.f_smid帳款人 = p_work.f_customerid顧客名稱; l_InMoney.f_type種類 = "洗車"; l_InMoney.f_workid工單單號 = p_work.f_workid工單單號; l_InMoney.f_yesmoney已沖金額 = 0; _context.CFactoryManager.CInMoneyFactory.insert(l_InMoney); }
private DataTable getDataTableByDisplay明細(CWork p_work) { string[] l_Msg = new string[] { "項次", "單號", "引擎號碼", "金額", "洗車總類" }; DataTable l_dt = CTools.getFilledColumnsDataTable(l_Msg); //for (int i = 0; i < p_欠款紀錄.Length; i++) //{ DataRow l_row = l_dt.NewRow(); l_row["項次"] = "1"; l_row["單號"] = p_work.f_workid工單單號; l_row["引擎號碼"] = p_work.f_engo引擎號碼; l_row["金額"] = p_work.f_money金額; l_row["洗車總類"] = p_work.f_workType洗車種類; l_dt.Rows.Add(l_row); //} return(l_dt); }
protected void _btn明細_Click(object sender, EventArgs e) { Button l_btn = (Button)sender; GridViewRow l_row = (GridViewRow)l_btn.Parent.Parent; string l_workid = ((Label)l_row.Cells[1].Controls[1]).Text; if ("F".Equals(l_workid.Substring(0, 1))) { CWork l_work = _context.CFactoryManager.CWorkFactory.get工單資訊By單號(l_workid); display明細(l_work); } else { CKGPartOrderDetail[] l_detail = _context.CFactoryManager. CKGPartOrderDetailFactory.get請購明細ByExchangeID(l_workid); display小百貨明細(l_detail); } }
protected void _btn加入選取人員_Click(object sender, EventArgs e) { List <CConstruction> l_listCConstruction = new List <CConstruction>(); //try //{ for (int i = 0; i < _check.Items.Count; i++) { if (_check.Items[i].Selected) { CConstruction l_construction = _context.CFactoryManager.CConstructionFactory.createCConstruction(); l_construction.f_workid工單單號 = _lbl工單號碼.Text; l_construction.f_smid施工人員 = _check.Items[i].Value; l_listCConstruction.Add(l_construction); } } //施工者通常都超過一名,直接一次insert效率比較好 _context.CFactoryManager.CConstructionFactory.insert_s(l_listCConstruction); CWork l_work = get工單(); l_work.f_staus狀態 = "施工中"; //加入施工人員後狀態更改狀態為[施工中] _context.CFactoryManager.CWorkFactory.update(l_work); //} //catch //{ // ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "Error", "alert('加入失敗!請洽系統管理者');", true); // return; //} ScriptManager.RegisterClientScriptBlock(this, typeof(FrmAddConstruction), "OK", "alert('加入施工人員完成!作業完成後,請記得維護完工');", true); ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", "window.location.href='./FrmUpdateIndex.aspx';", true); }
private DataTable getDataTableByDisplay明細(CWork p_work) { string[] l_Msg = new string[] { "項次", "單號", "金額", "引擎號碼", "顧客姓名", "洗車總類", "開單人員" }; DataTable l_dt = CTools.getFilledColumnsDataTable(l_Msg); //fix by fox CKGPartOrder lCustomerName = _context.CFactoryManager.CKGPartOrderFactory. get顧客姓名ByEngo(p_work.f_engo引擎號碼); DataRow l_row = l_dt.NewRow(); l_row["項次"] = "1"; l_row["單號"] = p_work.f_workid工單單號; l_row["引擎號碼"] = p_work.f_engo引擎號碼; l_row["顧客姓名"] = (lCustomerName == null) ? "" : lCustomerName.f_customername顧客姓名; l_row["金額"] = p_work.f_money金額; l_row["洗車總類"] = p_work.f_workType洗車種類; l_row["開單人員"] = _context.CFactoryManager.CUserFactory.get高都員工檔( p_work.f_edituser開單人員).f_username姓名; l_dt.Rows.Add(l_row); return(l_dt); }
private bool 使用者輸入資訊() { if ("新車".Equals(_lbl工單種類.Text) || "一般".Equals(_lbl工單種類.Text) || "試乘".Equals(_lbl工單種類.Text) || "購車周年".Equals(_lbl工單種類.Text)) { if (!"".Equals(_rdo保險公司.SelectedValue)) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", "alert('非保險件不得挑選保險公司');", true); return(false); } } if ("新車".Equals(_lbl工單種類.Text)) { if (_txt顧客名稱.Text.Trim().Length != 5) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", "alert('新車必需要輸入顧客姓名(員工編號為五碼)');", true); _txt顧客名稱.Focus(); return(false); } } if ("試乘".Equals(_lbl工單種類.Text)) { if (_lbl引擎號碼.Text.Equals(" *此車不是試乘車輛")) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", "alert('試乘工單必需為試乘車才能開立');", true); _txt引擎號碼.Focus(); return(false); } } if ("保險".Equals(_lbl工單種類.Text) || "保險公司介紹".Equals(_lbl工單種類.Text)) { if ("保險".Equals(_lbl工單種類.Text)) { //2011-05-05 新增保險件無法選擇小美容or覆膜 way if ("A".Equals(_ddl洗車種類0.SelectedValue) || "B".Equals(_ddl洗車種類0.SelectedValue)) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", "alert('保險件無法選擇小美容or覆膜');", true); _ddl洗車種類0.Focus(); return(false); } } if ("".Equals(_rdo保險公司.SelectedValue)) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", "alert('保險件須挑選保險公司');", true); _rdo保險公司.Focus(); return(false); } } if ("".Equals(_txt引擎號碼.Text.Trim())) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", "alert('請輸入引擎號碼');", true); _txt引擎號碼.Focus(); return(false); } if ("".Equals(_ddl洗車種類.SelectedValue)) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", "alert('請挑選洗車種類');", true); _txt引擎號碼.Focus(); return(false); } if ("是".Equals(_rdo是否招攬.SelectedValue)) { if (_txt介紹人.Text.Trim().Length != 5) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", "alert('招攬件請輸入介紹人員工編號為五碼');", true); return(false); } } //同一天不得開立兩次單 CWork l_work = _context.CFactoryManager.CWorkFactory.get判斷是否有同一天重複開單(_txt引擎號碼.Text.Trim(), DateTime.Today.ToString("yyyy/MM/dd")); if (l_work != null) { CUser l_user = _context.CFactoryManager.CUserFactory.get高都員工檔(l_work.f_edituser開單人員); ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", "alert('此引擎號碼今日已開過一次單!請重新確認!開單人員:" + l_work.f_edituser開單人員 + "_" + l_user.f_username姓名 + "');", true); return(false); } //201311114 只有高至助理能開速霸陸/馬自達的車 //if (!"B1201".Equals(l_work.f_edituser開單人員)) //{ // if ("C".Equals(_ddl洗車種類.SelectedValue) || // "J".Equals(_ddl洗車種類.SelectedValue) || // "P".Equals(_ddl洗車種類.SelectedValue) || // "T".Equals(_ddl洗車種類.SelectedValue) || // "K".Equals(_ddl洗車種類.SelectedValue) || // "H".Equals(_ddl洗車種類.SelectedValue) || // "F".Equals(_ddl洗車種類.SelectedValue)) // { // ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", "alert('只有高輊助理能開速霸陸/馬自達的車');", true); // return false; // } //} return(true); }