public void Populate_UserInfo() { if (formView.CurrentMode == FormViewMode.Insert) { Guid bxId = Guid.Empty; Guid.TryParse(hfBxId.Value, out bxId); Tiyi.JD.SQLServerDAL.BaoxiuBill bxBill = bll_baoxiu.GetBaoxiuBill(bxId); if (bxBill == null) { return; } TextBox tbUserName = formView.FindControl("tbUserName") as TextBox; tbUserName.Text = bxBill.UserName; TextBox tbUserMobilePhone = formView.FindControl("tbUserMobilePhone") as TextBox; tbUserMobilePhone.Text = bxBill.UserMobilePhone; TextBox tbUserMobileShort = formView.FindControl("tbUserMobileShort") as TextBox; tbUserMobileShort.Text = bxBill.UserMobileShort; TextBox tbFaultPhenomenon = formView.FindControl("tbFaultPhenomenon") as TextBox; tbFaultPhenomenon.Text = bxBill.FaultPhenomenon; TextBox tbAddress = formView.FindControl("tbAddress") as TextBox; tbAddress.Text = bxBill.DepName + bxBill.Address; } }
private void Init_Load() { if (Request.QueryString["id"] != null) { hfBxId.Value = Request.QueryString["id"]; Guid bxId = Guid.Empty; Guid.TryParse(hfBxId.Value, out bxId); Tiyi.JD.SQLServerDAL.BaoxiuBill bill = bll_bxdManage.GetBaoxiuBill(bxId); LoadAppInfo(bill.AppId); LoadBillInfo(bxId); if (bll_bxdManage.IsPaidang(bxId)) { SEA_Paigong1.ChangeMode(FormViewMode.ReadOnly); Tiyi.JD.SQLServerDAL.PaigongBill pgBill = bll_bxdManage.GetPgBill_ByBxId(bxId); SEA_Paigong1.Init_Load(pgBill.PgId); } else { SEA_Paigong1.ChangeMode(FormViewMode.Insert); SEA_Paigong1.Init_LoadBxId(bxId); } } Load_Wxg(); }
public void LoadBillInfo(Guid bxId) { Tiyi.JD.SQLServerDAL.BaoxiuBill bill = bll_bxdManage.GetBaoxiuBill(bxId); if (bill == null) { return; } ltlProductSN.Text = bill.ProductSN; ltlApp.Text = bill.BigClass + " " + bill.AppType; ltlAddress.Text = bill.DepName + bill.Address; ltlUserName.Text = bill.UserName; ltlUserMobilePhone.Text = bill.UserMobilePhone; }
protected void CommandButton_Click(object sender, CommandEventArgs e) { if (e.CommandName == "CancelBill") { Guid bxdId = Guid.Empty; Guid.TryParse(hfBxdId.Value, out bxdId); Tiyi.JD.SQLServerDAL.BaoxiuBill bill = bll_bxdManage.GetBaoxiuBill(bxdId); bill.HandleResult = "管理员取消了此报修单,原因:" + tbHandleResult.Text; bill.IsCanceled = true; bll_bxdManage.UpdateBaoxiuBill(bill); Response.Redirect("BxdList.aspx"); } if (e.CommandName == "GoBack") { Response.Redirect("BxdList.aspx"); } }
protected void PaigongBillView_ItemCommand(object sender, FormViewCommandEventArgs e) { Guid bxId = Guid.Empty; Guid.TryParse(hfBxId.Value, out bxId); if (e.CommandName == "InsertBill") { Tiyi.JD.SQLServerDAL.BaoxiuBill bxBill = bll_baoxiu.GetBaoxiuBill(bxId); if (bxBill == null) { return; } Tiyi.JD.SQLServerDAL.PaigongBill pgBill = new Tiyi.JD.SQLServerDAL.PaigongBill(); pgBill.BxId = bxBill.BxId; pgBill.AppId = bxBill.AppId; pgBill.ProductSN = bxBill.ProductSN; pgBill.BigClass = bxBill.BigClass; pgBill.AppType = bxBill.AppType; pgBill.DepName = bxBill.DepName; TextBox tbUserName = formView.FindControl("tbUserName") as TextBox; pgBill.UserName = tbUserName.Text; TextBox tbUserMobilePhone = formView.FindControl("tbUserMobilePhone") as TextBox; pgBill.UserMobilePhone = tbUserMobilePhone.Text; TextBox tbUserMobileShort = formView.FindControl("tbUserMobileShort") as TextBox; pgBill.UserMobileShort = tbUserMobileShort.Text; TextBox tbAddress = formView.FindControl("tbAddress") as TextBox; pgBill.Address = tbAddress.Text; TextBox tbFaultPhenomenon = formView.FindControl("tbFaultPhenomenon") as TextBox; pgBill.FaultPhenomenon = tbFaultPhenomenon.Text; TextBox tbRemark = formView.FindControl("tbRemark") as TextBox; pgBill.Remark = tbRemark.Text; DropDownList ddlWxg = formView.FindControl("ddlWxg") as DropDownList; Guid wxgId = Guid.Empty; Guid.TryParse(ddlWxg.SelectedValue, out wxgId); Tiyi.JD.SQLServerDAL.Repairman wxg = bll_wxg.GetRepairmanById(wxgId); if (wxg != null) { pgBill.WxgId = wxgId; pgBill.WxgRealName = wxg.RealName; pgBill.WxgMobilePhone = wxg.MobilePhone; pgBill.WxgMobileShort = wxg.MobileShort; } Tiyi.JD.SQLServerDAL.PaigongBill newBill = bll_Paigong.CreatePaigongBill(pgBill); if (newBill != null && BillCreated != null) { hfPgId.Value = newBill.PgId.ToString(); BillInsertedEventArgs args = new BillInsertedEventArgs(newBill); BillCreated(this, args); } } if (e.CommandName == "UpdateBill") { Guid pgId = Guid.Empty; Guid.TryParse(hfPgId.Value, out pgId); Tiyi.JD.SQLServerDAL.PaigongBill pgBill = bll_Paigong.GetPaigongBill(pgId); TextBox tbUserName = formView.FindControl("tbUserName") as TextBox; pgBill.UserName = tbUserName.Text; TextBox tbUserMobilePhone = formView.FindControl("tbUserMobilePhone") as TextBox; pgBill.UserMobilePhone = tbUserMobilePhone.Text; TextBox tbUserMobileShort = formView.FindControl("tbUserMobileShort") as TextBox; pgBill.UserMobileShort = tbUserMobileShort.Text; TextBox tbAddress = formView.FindControl("tbAddress") as TextBox; pgBill.Address = tbAddress.Text; TextBox tbFaultPhenomenon = formView.FindControl("tbFaultPhenomenon") as TextBox; pgBill.FaultPhenomenon = tbFaultPhenomenon.Text; TextBox tbRemark = formView.FindControl("tbRemark") as TextBox; pgBill.Remark = tbRemark.Text; DropDownList ddlWxg = formView.FindControl("ddlWxg") as DropDownList; Guid wxgId = Guid.Empty; Guid.TryParse(ddlWxg.SelectedValue, out wxgId); Tiyi.JD.SQLServerDAL.Repairman wxg = bll_wxg.GetRepairmanById(wxgId); if (wxg != null) { pgBill.WxgId = wxgId; pgBill.WxgRealName = wxg.RealName; pgBill.WxgMobilePhone = wxg.MobilePhone; pgBill.WxgMobileShort = wxg.MobileShort; } bll_Paigong.UpdatePaigongBill(pgBill); if (Updated != null) { Updated(this, new EventArgs()); } } if (e.CommandName == "InsertCancel" || e.CommandName == "UpdateCancel") { if (Updated != null) { Updated(this, new EventArgs()); } } if (e.CommandName == "EditBill") { formView.ChangeMode(FormViewMode.Edit); } if (e.CommandName == "WxRemind") { Guid pgId = Guid.Empty; Guid.TryParse(hfPgId.Value, out pgId); Tiyi.JD.SQLServerDAL.PaigongBill pgBill = bll_Paigong.GetPaigongBill(pgId); Tiyi.Weixin.Work.Article article = new Tiyi.Weixin.Work.Article(); article.Title = "收到维修派工单"; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.AppendLine("设备类型:" + pgBill.BigClass + pgBill.AppType); sb.AppendLine("详细地址:" + pgBill.Address); sb.AppendLine("联系方式:" + pgBill.UserName + " " + pgBill.UserMobilePhone + " (短号:" + pgBill.UserMobileShort + ")"); sb.AppendLine("派工时间:" + DateTime.Now.ToString() + "\n"); sb.AppendLine("故障现象:" + pgBill.FaultPhenomenon); sb.AppendLine("备注信息:" + pgBill.Remark); article.Description = sb.ToString(); article.Url = ""; System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer(); string articleJson = js.Serialize(article); ws_wxSender.SendArticleToUser("101527", articleJson, "34"); Literal ltlSendWxResult = formView.FindControl("ltlSendWxResult") as Literal; ltlSendWxResult.Text = "微信提醒发送成功"; } }