private void Get_OrganizationDetails(int OrgID) { try { BL_SuperAdmin objBL = new BL_SuperAdmin(); EWA_SuperAdmin objEWA = new EWA_SuperAdmin(); DataSet ds = objBL.Get_OrganizationDetails(OrgID); lbl_CollegeName.Text = ds.Tables[0].Rows[0]["OrgName"].ToString(); lbl_CollegeAddress.Text = ds.Tables[0].Rows[0]["Address"].ToString(); lbl_Number.Text = ds.Tables[0].Rows[0]["PhoneNo"].ToString(); lbl_website.Text = ds.Tables[0].Rows[0]["Website"].ToString(); lbl_CollegeName1.Text = ds.Tables[0].Rows[0]["OrgName"].ToString(); lbl_CollegeAddress1.Text = ds.Tables[0].Rows[0]["Address"].ToString(); lbl_Number1.Text = ds.Tables[0].Rows[0]["PhoneNo"].ToString(); lbl_website1.Text = ds.Tables[0].Rows[0]["Website"].ToString(); //Lbl_TrustName.Text = ds.Tables[0].Rows[0]["TrustName"].ToString(); } catch (Exception exp) { GeneralErr(exp.Message.ToString()); //throw exp; } }
private void Get_OrganizationDetails(int OrgID) { try { BL_SuperAdmin objBL = new BL_SuperAdmin(); EWA_SuperAdmin objEWA = new EWA_SuperAdmin(); DataSet ds = objBL.Get_OrganizationDetails(OrgID); string StaffPhoto = ds.Tables[0].Rows[0]["Logo"].ToString(); if (StaffPhoto != null && StaffPhoto != "") { Byte[] bytes = (Byte[])ds.Tables[0].Rows[0]["Logo"]; string base64String = Convert.ToBase64String(bytes, 0, bytes.Length); ImageButton_logo.ImageUrl = "data:image/png;base64," + base64String; } lbl_CollegeName.Text = ds.Tables[0].Rows[0]["OrgName"].ToString(); lbl_CollegeAddress.Text = ds.Tables[0].Rows[0]["Address"].ToString(); //Lbl_TrustName.Text = ds.Tables[0].Rows[0]["TrustName"].ToString(); } catch (Exception exp) { GeneralErr(exp.Message.ToString()); //throw exp; } }
//Update College Data #region [Update College Data] public void Update_College_Data(EWA_SuperAdmin objEWA) { DL_SuperAdmin objDL = new DL_SuperAdmin(); try { objDL.Update_College_Data(objEWA); } catch (Exception) { throw; } finally { objDL = null; } }
//Insert College Registration #region [Insert College Registration] public void insertNew_College_RegistrationBLL(EWA_SuperAdmin objEWA) { DL_SuperAdmin objDL = new DL_SuperAdmin(); try { objDL.insertNew_College_RegistrationDLL(objEWA); } catch (Exception) { throw; } finally { objDL = null; } }
private void AddCollegeToDropDown() { try { EWA_SuperAdmin clas1 = new EWA_SuperAdmin(); BL_SuperAdmin bcls = new BL_SuperAdmin(); DataSet ds = bcls.AddCollegeToDropDown(); DropDownList1.DataTextField = "OrgLabel"; DropDownList1.DataValueField = "OrgLabel"; DropDownList1.DataSource = ds; DropDownList1.DataBind(); DropDownList1.Items.Insert(0, "Select"); } catch (Exception exp) { } }
private void AddCollegeToDropDown() { try { EWA_SuperAdmin clas1 = new EWA_SuperAdmin(); BL_SuperAdmin bcls = new BL_SuperAdmin(); DataSet ds = bcls.AddCollegeToDropDown(); DDL_SelectCollege.DataTextField = "OrgLabel"; DDL_SelectCollege.DataValueField = "OrganizationId"; DDL_SelectCollege.DataSource = ds; DDL_SelectCollege.DataBind(); DDL_SelectCollege.Items.Insert(0, "Select"); } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
private void AddCollegeToDropDown() { try { if (ddlorg.Items.Count <= 0) { EWA_SuperAdmin clas1 = new EWA_SuperAdmin(); BL_SuperAdmin bcls = new BL_SuperAdmin(); DataSet ds = bcls.AddCollegeToDropDown(); ddlorg.DataTextField = "OrgLabel"; ddlorg.DataValueField = "OrganizationId"; ddlorg.DataSource = ds; ddlorg.DataBind(); ddlorg.Items.Insert(0, "Select Organisation"); } } catch (Exception ex) { } }
// Insert Data In tblOrganization Tabel #region [Insert Organization] public void insertNew_College_RegistrationDLL(EWA_SuperAdmin objEWA) { try { Connection concls = new Connection(); SqlCommand cmd = new SqlCommand("SP_CollegeRegistration"); concls.opencon(); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Action", "Save"); cmd.Parameters.AddWithValue("@orgID", objEWA.orgID); cmd.Parameters.AddWithValue("@OrgCode", objEWA.OrgCode); cmd.Parameters.AddWithValue("@OrgName", objEWA.OrgName); cmd.Parameters.AddWithValue("@OrgType", objEWA.OrgType); cmd.Parameters.AddWithValue("@OrgUniversity", objEWA.OrgUniversity); cmd.Parameters.AddWithValue("@OrgLabel", objEWA.OrgLabel); cmd.Parameters.AddWithValue("@PhoneNo", objEWA.PhoneNo); cmd.Parameters.AddWithValue("@FaxNo", objEWA.FaxNo); cmd.Parameters.AddWithValue("@Logo", objEWA.LogoImage); cmd.Parameters.AddWithValue("@LetterHead", objEWA.LetterHeadImage); cmd.Parameters.AddWithValue("@Website", objEWA.Website); cmd.Parameters.AddWithValue("@Email", objEWA.Email); cmd.Parameters.AddWithValue("@Address", objEWA.Address); cmd.Parameters.AddWithValue("@Country", objEWA.Country); cmd.Parameters.AddWithValue("@State", objEWA.State); cmd.Parameters.AddWithValue("@City", objEWA.City); cmd.Parameters.AddWithValue("@Pincode", objEWA.Pincode); cmd.Parameters.AddWithValue("@UniversityCode", objEWA.UniversityCode); cmd.Parameters.AddWithValue("@MSBTECode", objEWA.MSBTECode); cmd.Parameters.AddWithValue("@AICTECode", objEWA.AICTECode); cmd.Parameters.AddWithValue("@TrustName", objEWA.TrustName); concls.executenonquery(cmd); concls.closecon(); } catch (Exception) { throw; } }
protected void BtnSave_Click(object sender, EventArgs e) { BL_SuperAdmin objBL = new BL_SuperAdmin(); EWA_SuperAdmin objEWA = new EWA_SuperAdmin(); try { objEWA.orgID = Convert.ToInt32(TxtOrgID.Text); objEWA.OrgCode = TxtOrgCode.Text; objEWA.OrgName = TxtOrgName.Text; objEWA.OrgLabel = TxtOrgLabel.Text; objEWA.PhoneNo = TxtPhoneNo.Text; objEWA.FaxNo = TxtFax.Text; objEWA.Website = Txtwebsite.Text; objEWA.Email = TxtEmail.Text; objEWA.Address = TxtAddress.Text; objEWA.Country = ddlcountry.SelectedItem.Text; objEWA.State = ddlstate.SelectedItem.Text; objEWA.City = ddlcity.SelectedItem.Text; objEWA.Pincode = Convert.ToInt32(TxtPincode.Text); objEWA.UniversityCode = TxtUniversityCode.Text; objEWA.MSBTECode = TxtMSBTEcode.Text; objEWA.AICTECode = TxtAICTECode.Text; objEWA.DTECode = TxtDTEcode.Text; objEWA.TrustName = TxtTrustName.Text; objEWA.OrgType = rbl_OrganizationType.SelectedValue.ToString(); objEWA.OrgUniversity = DDL_University.SelectedValue.ToString(); // Code for store Logo Image int length = 0; byte[] imgLogobyte = null; byte[] imgLetterHeadbyte = null; if (FileLogoImage.HasFile) { length = FileLogoImage.PostedFile.ContentLength; imgLogobyte = new byte[length]; HttpPostedFile img1 = FileLogoImage.PostedFile; img1.InputStream.Read(imgLogobyte, 0, length); } objEWA.LogoImage = imgLogobyte; if (FileLetterHeadImage.HasFile) { length = FileLetterHeadImage.PostedFile.ContentLength; imgLetterHeadbyte = new byte[length]; HttpPostedFile img1 = FileLetterHeadImage.PostedFile; img1.InputStream.Read(imgLetterHeadbyte, 0, length); } objEWA.LetterHeadImage = imgLetterHeadbyte; objBL.insertNew_College_RegistrationBLL(objEWA); string emailmsg = SendEmails(); TxtOrgName.Text = ""; TxtPhoneNo.Text = ""; TxtAddress.Text = ""; TxtPincode.Text = ""; TxtTrustName.Text = ""; TxtUniversityCode.Text = ""; Txtwebsite.Text = ""; TxtEmail.Text = ""; TxtMSBTEcode.Text = ""; TxtFax.Text = ""; TxtAICTECode.Text = ""; TxtDTEcode.Text = ""; ddlcity.Items.Insert(0, new ListItem("Select", "0")); ddlcountry.Items.Insert(0, new ListItem("Select", "0")); ddlstate.Items.Insert(0, new ListItem("Select", "0")); DDL_University.Items.Insert(0, new ListItem("Select", "0")); int orgID1 = Get_orgID(); orgID1 = orgID1 + 1; TxtOrgID.Text = orgID1.ToString(); int orgCode = Get_orgCode(); TxtOrgCode.Text = "CLG/" + orgCode + 1; msgBox.ShowMessage("College Register Successfully !!!", "Information", UserControls.MessageBox.MessageStyle.Successfull); } catch (Exception ex) { msgBox.ShowMessage("College Registeration Failed !!!", "Information", UserControls.MessageBox.MessageStyle.Critical); } finally { } }
// Bind Country State City to Dropdownbox Data //#region Country_State_City Bind //protected void DDL_Country_SelectedIndexChanged(object sender, EventArgs e) //{ // Bind_ddlCountry(); // //try // //{ // // LoadStateDropDown(DDL_Country.SelectedValue); // //} // //catch (Exception exp) // //{ // // GeneralErr(exp.Message.ToString()); // //} //} //#endregion //Load State //#region[Load State] //private void LoadStateDropDown(string cid) //{ // try // { // if (DDL_Country.SelectedValue.Equals("Select") && DDL_Country.SelectedValue.Equals("")) // { // msgBox.ShowMessage("Please Select Country First.. !!!", "Information", UserControls.MessageBox.MessageStyle.Critical); // SetFocus(DDL_Country.Text); // } // else // { // DDL_State.DataTextField = "name"; // DDL_State.DataValueField = "cid"; // DataSet ds = ViewState["DatasetAll"] as DataSet; // DataView dv = new DataView(ds.Tables["State"]); // dv.RowFilter = "cid = " + cid; // DDL_State.DataSource = dv.ToTable(); // DDL_State.DataBind(); // DDL_State.Items.Insert(0, new ListItem(" Select ", "0")); // } // } // catch (Exception exp) // { // GeneralErr(exp.Message.ToString()); // } //} //#endregion //State Changed #region [State Changed] //protected void DDL_State_SelectedIndexChanged(object sender, EventArgs e) //{ // Bind_ddlState(); // //try // //{ // // LoadCityDropDown(DDL_State.SelectedValue); // //} // //catch (Exception exp) // //{ // // GeneralErr(exp.Message.ToString()); // //} //} #endregion //Load City //#region[Load City] //private void LoadCityDropDown(string p) //{ // //try // //{ // // if (DDL_Country.SelectedValue.Equals("Select") && DDL_Country.SelectedValue.Equals("") && DDL_State.SelectedValue.Equals("")) // // { // // msgBox.ShowMessage("Please Select Country First !!!", "Information", UserControls.MessageBox.MessageStyle.Critical); // // } // // else // // { // // DDL_City.DataTextField = "name"; // // DDL_City.DataValueField = "id"; // // DataSet ds = ViewState["DatasetAll"] as DataSet; // // DataView dv = new DataView(ds.Tables["City"]); // // dv.RowFilter = "sid = " + p; // // DDL_City.DataSource = dv.ToTable(); // // DDL_City.DataBind(); // // DDL_City.Items.Insert(0, new ListItem(" Select ", "0")); // // } // //} // //catch (Exception exp) // //{ // // GeneralErr(exp.Message.ToString()); // //} // Bind_ddlCity(); //} //#endregion // Update College Information #region UpdateCollegeData protected void BtnUpdate_Click(object sender, EventArgs e) { BL_SuperAdmin objBL = new BL_SuperAdmin(); EWA_SuperAdmin objEWA = new EWA_SuperAdmin(); try { string[] confirmValue = Request.Form["confirm_value"].Split(','); if (confirmValue[confirmValue.Length - 1] == "Yes") { objEWA.Action = "Update"; objEWA.orgID = Convert.ToInt32(TxtOrgID.Text); objEWA.OrgCode = TxtOrgCode.Text; objEWA.TrustName = TxtTrustName.Text; objEWA.OrgName = TxtOrgName.Text; objEWA.OrgLabel = TxtOrgLabel.Text; objEWA.PhoneNo = TxtPhoneNo.Text; objEWA.FaxNo = TxtFax.Text; objEWA.Website = Txtwebsite.Text; objEWA.Email = TxtEmail.Text; objEWA.Address = TxtAddress.Text; objEWA.Country = ddlcountry.SelectedItem.Text; objEWA.State = ddlstate.SelectedItem.Text; objEWA.City = ddlcity.SelectedItem.Text; objEWA.Pincode = Convert.ToInt32(TxtPincode.Text); objEWA.UniversityCode = TxtUniversityCode.Text; objEWA.MSBTECode = TxtMSBTEcode.Text; objEWA.AICTECode = TxtAICTECode.Text; objEWA.DTECode = TxtDTEcode.Text; // Code for store Logo Image int length = 0; byte[] imgLogobyte = null; byte[] imgLetterHeadbyte = null; if (FileLogoImage.HasFile) { length = FileLogoImage.PostedFile.ContentLength; imgLogobyte = new byte[length]; ViewState["Logo"] = imgLogobyte; HttpPostedFile img1 = FileLogoImage.PostedFile; img1.InputStream.Read(imgLogobyte, 0, length); } objEWA.LogoImage = (byte[])ViewState["Logo"]; if (FileLetterHeadImage.HasFile) { length = FileLetterHeadImage.PostedFile.ContentLength; imgLetterHeadbyte = new byte[length]; ViewState["LetterHead"] = imgLetterHeadbyte; HttpPostedFile img1 = FileLetterHeadImage.PostedFile; img1.InputStream.Read(imgLetterHeadbyte, 0, length); } objEWA.LetterHeadImage = (byte[])ViewState["LetterHead"]; objEWA.OrgUniversity = DDL_University.SelectedValue; objBL.Update_College_Data(objEWA); } } catch (Exception exp) { GeneralErr(exp.Message.ToString()); msgBox.ShowMessage("College Updation Failed.. !!!", "Information", UserControls.MessageBox.MessageStyle.Critical); } finally { msgBox.ShowMessage("College Data Updated Successfully !!!", "Information", UserControls.MessageBox.MessageStyle.Successfull); } }