public int InsertUpdateAdminssion(clsAdmission objAdmissio) { try { using (aspccEntities db = new aspccEntities()) { var result = db.InsertUpdateAdmission(objAdmissio.Id, objAdmissio.fname, objAdmissio.Mname, objAdmissio.Lname, objAdmissio.Address, objAdmissio.MobileH, objAdmissio.MobileF, objAdmissio.MobileP, objAdmissio.Email, objAdmissio.AreId, objAdmissio.QualificationId, objAdmissio.StreamId, objAdmissio.OccupationId, objAdmissio.CourseId, objAdmissio.SchoolName, objAdmissio.BirthDate, objAdmissio.PreferTimeTO, objAdmissio.PreferTimeFrom, objAdmissio.Remark, objAdmissio.TotalFees, objAdmissio.DisCount, objAdmissio.NetFees, objAdmissio.NoOfInstallment, objAdmissio.Installment1Rs, objAdmissio.Installment1Date, objAdmissio.Installment2Rs, objAdmissio.Installment2Date, objAdmissio.Installment3Rs, objAdmissio.Installment3Date, objAdmissio.Installment4Rs, objAdmissio.Installment4Date, objAdmissio.Installment5Rs, objAdmissio.Installment5Date, objAdmissio.Installment6Rs, objAdmissio.Installment6Date, objAdmissio.Installment7Rs, objAdmissio.Installment7Date, objAdmissio.Installment8Rs, objAdmissio.Installment8Date, objAdmissio.Installment9Rs, objAdmissio.Installment9Date, objAdmissio.Installment10Rs, objAdmissio.Installment10Date, objAdmissio.ModBy, objAdmissio.AdmissionNo, objAdmissio.RegNo, objAdmissio.AdmissionDate); return(1); } } catch (Exception ex) { com.Loginsert("admin/AdmissionAddEdit", "InsertUpdateAdminssion", ex.StackTrace, ex.Message); return(0); } }
protected void btnsave_Click(object sender, EventArgs e) { try { if (Page.IsValid) { clsAdmission objadm = new clsAdmission(); if (Request.QueryString["id"] != null) { Admissionid = Convert.ToInt32(Request.QueryString["id"].ToString()); objadm.Id = Admissionid; } objadm.AdmissionNo = txtAdmissionNo.Text.Trim(); objadm.RegNo = txtRegNo.Text.Trim(); objadm.AdmissionDate = Comman.CommanUtils.convertDDMMYYYY(txtAdmissionDate.Text.Trim()); objadm.fname = txtFirstName.Text.Trim(); objadm.Mname = txtMiddelName.Text.Trim(); objadm.Lname = txtLastName.Text.Trim(); objadm.Address = txtAdress.InnerText.Trim(); objadm.MobileF = txtMobileF.Text.Trim(); objadm.MobileH = txtMobileH.Text.Trim(); objadm.MobileP = txtMobileP.Text.Trim(); objadm.Email = txtEmail.Text.Trim(); objadm.AreId = Convert.ToInt32(ddlArea.SelectedValue); objadm.QualificationId = txtQualification.Text.Trim(); objadm.StreamId = Convert.ToInt32(ddlStream.SelectedValue); objadm.OccupationId = Convert.ToInt32(ddloccupation.SelectedValue); string courseId = string.Empty; foreach (ListItem item in ddlCourse.Items) { if (item.Selected) { courseId += item.Value + ","; } } objadm.CourseId = courseId; objadm.SchoolName = txtSchoolName.Text.Trim(); objadm.BirthDate = Comman.CommanUtils.convertDDMMYYYY(txtBirthDate.Text.Trim()); objadm.PreferTimeFrom = txtFromTime.Text.Trim(); objadm.PreferTimeTO = txtToTime.Text.Trim(); objadm.Remark = txtRemark.InnerText.Trim(); objadm.TotalFees = Convert.ToDecimal(txtTotalFees.Text.Trim()); objadm.DisCount = Convert.ToInt32(txtDisCount.Text.Trim()); objadm.NoOfInstallment = Convert.ToInt32(txtNoofInstallment.Text.Trim()); objadm.NetFees = Convert.ToDecimal(txtNetFees.Text.Trim()); foreach (TextBox textBox in pnlInstallmentBoxes.Controls.OfType <TextBox>()) { if (textBox.ID == "txtdateInstallment1") { objadm.Installment1Date = Comman.CommanUtils.convertDDMMYYYY(textBox.Text); } if (textBox.ID == "txtrdInstallment1") { objadm.Installment1Rs = Convert.ToDecimal(string.IsNullOrEmpty(textBox.Text) ? "0" : textBox.Text); } if (textBox.ID == "txtdateInstallment2") { objadm.Installment2Date = Comman.CommanUtils.convertDDMMYYYY(textBox.Text); } if (textBox.ID == "txtrdInstallment2") { objadm.Installment2Rs = Convert.ToDecimal(string.IsNullOrEmpty(textBox.Text) ? "0" : textBox.Text); } if (textBox.ID == "txtdateInstallment3") { objadm.Installment3Date = Comman.CommanUtils.convertDDMMYYYY(textBox.Text); } if (textBox.ID == "txtrdInstallment3") { objadm.Installment3Rs = Convert.ToDecimal(string.IsNullOrEmpty(textBox.Text) ? "0" : textBox.Text); } if (textBox.ID == "txtdateInstallment4") { objadm.Installment4Date = Comman.CommanUtils.convertDDMMYYYY(textBox.Text); } if (textBox.ID == "txtrdInstallment4") { objadm.Installment4Rs = Convert.ToDecimal(string.IsNullOrEmpty(textBox.Text) ? "0" : textBox.Text); } if (textBox.ID == "txtdateInstallment5") { objadm.Installment5Date = Comman.CommanUtils.convertDDMMYYYY(textBox.Text); } if (textBox.ID == "txtrdInstallment5") { objadm.Installment5Rs = Convert.ToDecimal(string.IsNullOrEmpty(textBox.Text) ? "0" : textBox.Text); } if (textBox.ID == "txtdateInstallment6") { objadm.Installment6Date = Comman.CommanUtils.convertDDMMYYYY(textBox.Text); } if (textBox.ID == "txtrdInstallment6") { objadm.Installment6Rs = Convert.ToDecimal(string.IsNullOrEmpty(textBox.Text) ? "0" : textBox.Text); } if (textBox.ID == "txtdateInstallment7") { objadm.Installment7Date = Comman.CommanUtils.convertDDMMYYYY(textBox.Text); } if (textBox.ID == "txtrdInstallment7") { objadm.Installment7Rs = Convert.ToDecimal(string.IsNullOrEmpty(textBox.Text) ? "0" : textBox.Text); } if (textBox.ID == "txtdateInstallment8") { objadm.Installment8Date = Comman.CommanUtils.convertDDMMYYYY(textBox.Text); } if (textBox.ID == "txtrdInstallment8") { objadm.Installment8Rs = Convert.ToDecimal(string.IsNullOrEmpty(textBox.Text) ? "0" : textBox.Text); } if (textBox.ID == "txtdateInstallment9") { objadm.Installment9Date = Comman.CommanUtils.convertDDMMYYYY(textBox.Text); } if (textBox.ID == "txtrdInstallment9") { objadm.Installment9Rs = Convert.ToDecimal(string.IsNullOrEmpty(textBox.Text) ? "0" : textBox.Text); } if (textBox.ID == "txtdateInstallment10") { objadm.Installment10Date = Comman.CommanUtils.convertDDMMYYYY(textBox.Text); } if (textBox.ID == "txtrdInstallment10") { objadm.Installment10Rs = Convert.ToDecimal(string.IsNullOrEmpty(textBox.Text) ? "0" : textBox.Text); } } int result = objAdmOp.InsertUpdateAdmission(objadm); if (result > 0) { Response.Redirect("AdmissionList.aspx"); } else { lblErrorMsg.Text = "Please Try after some Time."; } } } catch (Exception ex) { lblErrorMsg.Text = "Please Try after some Time."; com.Loginsert(HttpContext.Current.Request.Url.AbsolutePath, "btnsave_Click", ex.StackTrace, ex.Message); } }