private void ShowInfo(int Id) { VAN_OA.Model.ReportForms.TB_GuestTrack model = guestTrackSer.GetModel(Id); lblGuestName.Text = model.GuestName; lblAE.Text = model.AEName; if (model.AEPer != null) { lblAE.Text += "---" + model.AEPer.ToString() + "%"; } if (model.GuestLiRun != null) { txtGuestLiRun.Text = model.GuestLiRun.ToString(); } if (model.GuestTotal != null) { txtGuestTotal.Text = model.GuestTotal.ToString(); } if (model.GuestDays != null) { txtGuestDays.Text = model.GuestDays.ToString(); } txtINSIDERemark.Text = model.INSIDERemark; lblProNo.Text = model.ProNo; lblContrPer.Text = model.LikeMan; lblEMail.Text = model.FoxOrEmail; lblQQ.Text = model.QQMsn; lblTel.Text = model.Phone; }
protected void btnUpdate_Click(object sender, EventArgs e) { if (this.FormCheck()) { try { string INSIDERemark = this.txtINSIDERemark.Text; int CreateUser = Convert.ToInt32(Session["currentUserId"]); DateTime CreateTime = DateTime.Now; VAN_OA.Model.ReportForms.TB_GuestTrack model = new VAN_OA.Model.ReportForms.TB_GuestTrack(); if (txtGuestTotal.Text.Trim() != "") { model.GuestTotal = decimal.Parse(this.txtGuestTotal.Text.Trim()); } if (txtGuestLiRun.Text.Trim() != "") { model.GuestLiRun = decimal.Parse(this.txtGuestLiRun.Text); } if (txtGuestDays.Text.Trim() != "") { model.GuestDays = decimal.Parse(this.txtGuestDays.Text.Trim()); } model.INSIDERemark = INSIDERemark; model.Id = Convert.ToInt32(base.Request["Id"]); if (this.guestTrackSer.UpdateINSIDE(model)) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('修改成功!');</script>"); } else { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('修改失败!');</script>"); } } catch (Exception ex) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('" + ex.Message + "!');</script>"); } } }
private void ShowInfo(int Id) { VAN_OA.Model.ReportForms.TB_GuestTrack model = guestTrackSer.GetModel(Id); this.txtTime.Text = model.Time.ToString(); this.txtGuestName.Text = model.GuestName; this.txtPhone.Text = model.Phone; this.txtLikeMan.Text = model.LikeMan; this.txtJob.Text = model.Job; this.txtFoxOrEmail.Text = model.FoxOrEmail; this.chkIfSave.Checked = model.IfSave; this.txtQQMsn.Text = model.QQMsn; this.txtGuestId.Text = model.GuestId; this.txtGuestAddress.Text = model.GuestAddress; this.txtGuestHttp.Text = model.GuestHttp; this.txtGuestShui.Text = model.GuestShui; this.txtGuestGong.Text = model.GuestGong; this.txtGuestBrandNo.Text = model.GuestBrandNo; this.txtGuestBrandName.Text = model.GuestBrandName; try { this.ddlAE.SelectedValue = model.AE.ToString(); } catch (Exception) { } try { this.ddlINSIDE.SelectedValue = model.INSIDE.ToString(); } catch (Exception) { } txtRemark.Text = model.Remark; //this.txtFristMeet.Text = model.FristMeet; //this.txtSecondMeet.Text = model.SecondMeet; //this.txtFaceMeet.Text = model.FaceMeet; //this.txtPrice.Text = model.Price.ToString(); //this.chkIfSuccess.Checked = model.IfSuccess; //this.txtMyAppraise.Text = model.MyAppraise; //this.txtManAppraise.Text = model.ManAppraise; if (model.GuestLiRun != null) { txtGuestLiRun.Text = model.GuestLiRun.ToString(); } if (model.GuestTotal != null) { txtGuestTotal.Text = model.GuestTotal.ToString(); } if (model.GuestDays != null) { txtGuestDays.Text = model.GuestDays.ToString(); } if (model.AEPer != null) { ddlAEPre.Text = model.AEPer.ToString(); } if (model.INSIDEPer != null) { ddlINSIDEPre.Text = model.INSIDEPer.ToString(); } txtINSIDERemark.Text = model.INSIDERemark; lblProNo.Text = model.ProNo; txtMouth.Text = model.QuartNo; txtYear.Text = model.YearNo; txtSimpGuestName.Text = model.SimpGuestName; }
protected void btnAdd_Click(object sender, EventArgs e) { if (this.FormCheck()) { try { DateTime Time = DateTime.Parse(this.txtTime.Text); string GuestName = this.txtGuestName.Text; string Phone = this.txtPhone.Text; string LikeMan = this.txtLikeMan.Text; string Job = this.txtJob.Text; string FoxOrEmail = this.txtFoxOrEmail.Text; bool IfSave = this.chkIfSave.Checked; string QQMsn = this.txtQQMsn.Text; string GuestId = this.txtGuestId.Text; string GuestAddress = this.txtGuestAddress.Text; string GuestHttp = this.txtGuestHttp.Text; string GuestShui = this.txtGuestShui.Text; string GuestGong = this.txtGuestGong.Text; string GuestBrandNo = this.txtGuestBrandNo.Text; string GuestBrandName = this.txtGuestBrandName.Text; int AE = int.Parse(ddlAE.SelectedItem.Value); int INSIDE = int.Parse(this.ddlINSIDE.SelectedItem.Value); string Remark = this.txtRemark.Text; //string FristMeet = this.txtFristMeet.Text; //string SecondMeet = this.txtSecondMeet.Text; //string FaceMeet = this.txtFaceMeet.Text; //decimal Price = 0; //if (txtPrice.Text != "") // Price = decimal.Parse(this.txtPrice.Text); //bool IfSuccess = this.chkIfSuccess.Checked; //string MyAppraise = this.txtMyAppraise.Text; //string ManAppraise = this.txtManAppraise.Text; int CreateUser = Convert.ToInt32(Session["currentUserId"]); DateTime CreateTime = DateTime.Now; VAN_OA.Model.ReportForms.TB_GuestTrack model = new VAN_OA.Model.ReportForms.TB_GuestTrack(); model.Time = Time; model.GuestName = GuestName; model.Phone = Phone; model.LikeMan = LikeMan; model.Job = Job; model.FoxOrEmail = FoxOrEmail; model.IfSave = IfSave; model.QQMsn = QQMsn; //model.FristMeet = FristMeet; //model.SecondMeet = SecondMeet; //model.FaceMeet = FaceMeet; //model.Price = Price; //model.IfSuccess = IfSuccess; //model.MyAppraise = MyAppraise; //model.ManAppraise = ManAppraise; model.CreateUser = CreateUser; model.CreateTime = CreateTime; model.GuestId = GuestId; model.GuestAddress = GuestAddress; model.GuestHttp = GuestHttp; model.GuestShui = GuestShui; model.GuestGong = GuestGong; model.GuestBrandNo = GuestBrandNo; model.GuestBrandName = GuestBrandName; model.AE = AE; model.INSIDE = INSIDE; model.Remark = Remark; model.SimpGuestName = txtSimpGuestName.Text; if (txtGuestTotal.Text.Trim() != "") { model.GuestTotal = decimal.Parse(this.txtGuestTotal.Text.Trim()); } if (txtGuestLiRun.Text.Trim() != "") { model.GuestLiRun = decimal.Parse(this.txtGuestLiRun.Text); } if (txtGuestDays.Text.Trim() != "") { model.GuestDays = decimal.Parse(this.txtGuestDays.Text.Trim()); } string INSIDERemark = this.txtINSIDERemark.Text; model.INSIDERemark = INSIDERemark; model.YearNo = txtYear.Text; model.QuartNo = txtMouth.Text; if (ddlINSIDEPre.Text != "") { model.INSIDEPer = Convert.ToDecimal(ddlINSIDEPre.Text); } if (ddlAEPre.Text != "") { model.AEPer = Convert.ToDecimal(ddlAEPre.Text); } if (this.guestTrackSer.Add(model) > 0) { base.Response.Redirect(Session["POUrl"].ToString()); //base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('添加成功!');</script>"); //this.txtTime.Text =""; //this.txtGuestName.Text = ""; //this.txtPhone.Text = ""; //this.txtLikeMan.Text = ""; //this.txtJob.Text = ""; //this.txtFoxOrEmail.Text = ""; //this.chkIfSave.Checked = true; //this.txtQQMsn.Text = ""; ////this.txtFristMeet.Text = ""; ////this.txtSecondMeet.Text = ""; ////this.txtFaceMeet.Text = ""; ////this.txtPrice.Text = ""; ////this.chkIfSuccess.Checked = true; ////this.txtMyAppraise.Text = ""; ////this.txtManAppraise.Text = ""; //this.txtGuestId.Text = ""; //this.txtGuestAddress.Text = ""; //this.txtGuestHttp.Text =""; //this.txtGuestShui.Text = ""; //this.txtGuestGong.Text = ""; //this.txtGuestBrandNo.Text = ""; //this.txtGuestBrandName.Text = ""; //txtRemark.Text = ""; //txtGuestTotal.Text = ""; //txtGuestLiRun.Text = ""; //txtGuestDays.Text = ""; //txtINSIDERemark.Text = ""; //txtYear.Text = ""; //txtMouth.Text = ""; //ddlAEPre.Text = ""; //ddlINSIDEPre.Text = ""; //model.INSIDERemark = INSIDERemark; //this.txtTime.Focus(); } else { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('添加失败!');</script>"); } } catch (Exception ex) { base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('" + ex.Message + "!');</script>"); } } }