protected void btnSave_Click(object sender, EventArgs e) { if (txtVehicleNo.Text.Trim() == "") { lblMsg.Text = "Please enter the Vehicle No"; Timer1.Enabled = true; return; } if (txtChassisNo.Text.Trim() == "") { lblMsg.Text = "Please enter the Chassis No"; Timer1.Enabled = true; return; } //if (Session["Mode"].ToString() == "NEW") //{ // if (CheckUserCodeAlreadyExist(txtUserCode.Text)) // { // lblMsg.Text = "Enetered User Code Already Exists"; // Timer1.Enabled = true; // return; // } //} try { ProposalUpload proposalUpload = new ProposalUpload(); proposalUpload.ProposalUploadId = Convert.ToInt32(txtProposalUploadId.Text == "" ? "0" : txtProposalUploadId.Text); proposalUpload.QuotationNo = txtQuotationNo.Text; proposalUpload.VehicleNo = txtVehicleNo.Text; proposalUpload.EngineNo = txtEngineNo.Text; proposalUpload.ChassisNo = txtChassisNo.Text; if (chkIsCoverNoteAvailable.Checked) { proposalUpload.IsCoverNoteAvailable = 1; } else { proposalUpload.IsCoverNoteAvailable = 0; } proposalUpload.CoverNotePeriod = txtCoverNotePeriod.Text; proposalUpload.AddressLine1 = txtAddressLine1.Text; proposalUpload.AddressLine2 = txtAddressLine2.Text; proposalUpload.AddressLine3 = txtAddressLine3.Text; proposalUpload.YearOfMake = txtYearOfMake.Text; proposalUpload.FirstRegDate = txtFirstRegDate.Text; proposalUpload.CubicCapacity = txtCubicCapacity.Text; string UserCode = ""; string UserBranch = ""; HttpCookie reqCookies = Request.Cookies["userInfo"]; if (reqCookies != null) { UserCode = reqCookies["UserCode"].ToString(); UserBranch = reqCookies["UserBranch"].ToString(); } proposalUpload.EnteredUser = UserCode; proposalUpload.EnteredUserBranchCode = UserBranch; ProposalUploadController proposalUploadController = new ProposalUploadController(); if (Session["Mode"].ToString() == "NEW") { proposalUploadController.InsertProposalUpload(proposalUpload); } else if (Session["Mode"].ToString() == "EDIT") { proposalUploadController.UpdateProposalUpload(proposalUpload); } ClearComponents(); // SearchData(); lblMsg.Text = "Successfully Saved"; Timer1.Enabled = true; ManageFormComponents("INITIAL"); //Response.Redirect("UserRegistration.aspx"); } catch (Exception ex) { lblMsg.Text = "Error While Saving"; Timer1.Enabled = true; } }