protected void Button1_Click(object sender, EventArgs e) { WX.CRM.CustomerAgreement.MODEL agreement = WX.CRM.CustomerAgreement.GetModel("SELECT * FROM CRM_CustomerAgreement where TrackID=" + Request["TrackID"]); agreement.Content.value = FORM_CONTENT.Value; agreement.Update(); Response.Redirect("CRM_SingleM_ShowAgreement.aspx?AgreementID=" + agreement.id.ToString()); }
public void SetAgreement(WX.CRM.CustomerAgreement.MODEL agreementmodel, int pid) { decimal allfee = 0; for (int i = 0; i < Repeater2.Items.Count; i++) { if (((CheckBox)Repeater2.Items[i].FindControl("CheckBox2")).Checked) { try { allfee += Convert.ToDecimal(((TextBox)Repeater2.Items[i].FindControl("zdfee2")).Text); } catch { } } } agreementmodel.CustomerID.value = WX.Request.rCustomerID; agreementmodel.TrackID.value = pid; agreementmodel.TempID.value = 0; agreementmodel.AllFee.value = allfee; agreementmodel.OverFee.value = txtOverFee.Text; agreementmodel.Fee.value = Convert.ToDecimal(agreementmodel.AllFee.value) - Convert.ToDecimal(agreementmodel.OverFee.value); agreementmodel.OverTime.value = txtOverTime.Text; agreementmodel.Invoice.value = txtInvoice.Text; agreementmodel.OverInvoice.value = Convert.ToDecimal(agreementmodel.AllFee.value) - Convert.ToDecimal(agreementmodel.Invoice.value); agreementmodel.Addtime.value = txtAddtime.Text; agreementmodel.StartTime.value = txtStartTime.Text; agreementmodel.StopTime.value = txtStopTime.Text; if (DropProgram.SelectedValue != "0") { agreementmodel.ProgramID.value = DropProgram.SelectedValue; } int agreementid = 0; if (Request["TrackID"] != null && Request["TrackID"] != "") { agreementmodel.Update(); agreementid = agreementmodel.id.ToInt32(); WX.Main.ExecuteDelete("CRM_CustomerProducts", "PID=" + agreementid + " and Type", "2"); } else { agreementmodel.UserID.value = WX.Main.CurUser.UserID; agreementid = agreementmodel.Insert(true); } SetProduct(agreementid, 2); }