protected void Butto2_Click(object sender, EventArgs e) { try { List <int> selectedRows = new List <int>(); foreach (GridViewRow gvr in GridView1.Rows) { if ((gvr.FindControl("CheckBox2") as CheckBox).Checked == true) { selectedRows.Add(gvr.Cells[0].Text.ToInt()); } } if (selectedRows.Count > 0) { VPNsRepository vpnir = new VPNsRepository(); vpnir.DeleteVPN(selectedRows); LoadvpnData(); PersonTools.ShowMessage(lblmessage, Resources.DashboardText.msgDeleteSuccessfull, Color.Green); } } catch { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errDeleteFailed, Color.Red); } }
protected void Button1_Click(object sender, EventArgs e) { EmailTypesRepository emailtype = new EmailTypesRepository(); if (emailtype.FindBytitle(TextBox1.Text) != null) { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errDuplicateUsername, Color.Red); return; } bool successfullCreateAccount = true; try { EmailType newEmailType = new EmailType(); newEmailType.EmailTypeTitle = TextBox1.Text.Trim(); EmailTypesRepository etir = new EmailTypesRepository(); etir.SaveEmailType(newEmailType); ClearForm(); } catch (System.Exception err) { successfullCreateAccount = false; PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errAddFailed, Color.Red); } if (successfullCreateAccount) { // ClearForm(); PersonTools.ShowMessage(lblmessage, Resources.DashboardText.msgAddSuccessfull, Color.Green); } }
protected void Button1_Click1(object sender, EventArgs e) { if (lbllevelid.Text.Length > 0) { try { EduLevelsRepository elir = new EduLevelsRepository(); if (elir.FindBytitle(TextBox1.Text) != null) { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errRepeatTitle, Color.Red); return; } EduLevel editlevel = new EduLevel(); if ((TextBox1.Text.Length > 0) && (TextBox1.Text != lbltitle.Text)) { editlevel.LevelTitle = TextBox1.Text; } editlevel.LevelID = lbllevelid.Text.ToInt(); elir.SaveEduLevel(editlevel); ClearForm(); PersonTools.ShowMessage(lblmessage, Resources.DashboardText.msgUpdateSuccessfull, Color.Green); } catch { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errUpdateFailed, Color.Red); } } }
protected void Button2_Click(object sender, EventArgs e) { try { List <int> selectedRows = new List <int>(); foreach (GridViewRow gvr in GridView1.Rows) { if ((gvr.FindControl("CheckBox2") as CheckBox).Checked == true) { selectedRows.Add(gvr.Cells[0].Text.ToInt()); } } if (selectedRows.Count > 0) { EmailContactsRepository dir = new EmailContactsRepository(); dir.DeleteEmailContact(selectedRows); LoadEmailContactData(Session["UserID"].ToString(), Session["UserTypeID"].ToString()); PersonTools.ShowMessage(lblmessage, Resources.DashboardText.msgDeleteSuccessfull, Color.Green); } } catch { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errDeleteFailed, Color.Red); } }
protected void Button1_Click(object sender, EventArgs e) { FacultiesRepositpry faculty = new FacultiesRepositpry(); if (faculty.FindBytitle(TextBox1.Text) != null) { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errDuplicateUsername, Color.Red); return; } bool successfullCreateAccount = true; try { Faculty newFaculty = new Faculty(); newFaculty.FacultyTitle = TextBox1.Text.Trim(); FacultiesRepositpry fir = new FacultiesRepositpry(); fir.SaveFaculty(newFaculty); ClearForm(); } catch (System.Exception err) { successfullCreateAccount = false; PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errAddFailed, Color.Red); } if (successfullCreateAccount) { // ClearForm(); PersonTools.ShowMessage(lblmessage, Resources.DashboardText.msgAddSuccessfull, Color.Green); } }
protected void Button1_Click(object sender, EventArgs e) { VPNsRepository vpn = new VPNsRepository(); if (vpn.FindByUsername(txtusername.Text) != null) { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errDuplicateUsername, Color.Red); return; } bool successfullCreateAccount = true; try { VPN newvpn = new VPN(); newvpn.DepartmentID = ddldepartment.SelectedValue.ToInt(); newvpn.UserTypeID = DropDownList1.SelectedValue.ToInt(); newvpn.UserID = ddluserid.SelectedValue.ToInt(); newvpn.Username = txtusername.Text; newvpn.Password = txtpass.Text; newvpn.VPNDescription = txtdes.Text; VPNsRepository vpnir = new VPNsRepository(); vpnir.Savevpn(newvpn); } catch (System.Exception err) { successfullCreateAccount = false; PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errAddFailed, Color.Red); } if (successfullCreateAccount) { // ClearForm(); PersonTools.ShowMessage(lblmessage, Resources.DashboardText.msgAddSuccessfull, Color.Green); } }
protected void Button1_Click(object sender, EventArgs e) { try { if (lbllecid.Text.Length > 0) { VLecturersRepository vLecirr = new VLecturersRepository(); if ((txtusername.Text.Length > 0) && (txtusername.Text != lblusername.Text)) { if (vLecirr.FindByuserName(txtusername.Text) != null) { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errRepeatuserTitle, Color.Red); return; } } PersonsAdmin person = new PersonsAdmin(); person.AdminID = lbllecid.Text.ToInt(); person.FirstName = txtname.Text; person.LastName = txtlastname.Text; if ((txtusername.Text.Length > 0) && (txtusername.Text != lblusername.Text)) { person.Username = txtusername.Text; } else { person.Username = lblusername.Text; } //person.Password = (txtpass.Text.Length > 0 ? FormsAuthentication.HashPasswordForStoringInConfigFile(txtpass.Text, "MD5") : person.Password); if (txtpass.Text.Length > 0) { person.Password = FormsAuthentication.HashPasswordForStoringInConfigFile(txtpass.Text, "MD5"); } else { person.Password = Session["pass"].ToString(); } person.Status = (chkActiveAccount.Checked == true ? 0 : 1); PersonTools.ShowMessage(lblmessage, Resources.DashboardText.msgUpdateSuccessfull, Color.Green); } } catch { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errUpdateFailed, Color.Red); } }
protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { lblmessage.Text = ""; if (txtsearch.Text.Length > 0) { if (DropDownList1.SelectedValue == "3") { try { EmailContactsRepository dir = new EmailContactsRepository(); Session["ecetid"] = dir.SearchpersonEmailTypeid(txtsearch.Text.ToInt(), Session["UserTypeID"].ToString().ToInt(), Session["UserID"].ToString().ToInt()); GridView1.DataSource = Session["ecetid"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", dir.EmailContactCount().ToString(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["ecetid"] as DataTable).Rows.Count.ToString(), Resources.DashboardText.SelectRecordCount); } catch { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errSearch, Color.Red); lblrecordcount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.SelectRecordCount); } } if (DropDownList1.SelectedValue == "4") { try { EmailContactsRepository dir = new EmailContactsRepository(); Session["eceaid"] = dir.SearchpersonEmailAddrress(txtsearch.Text.ToString(), Session["UserTypeID"].ToString().ToInt(), Session["UserID"].ToString().ToInt()); GridView1.DataSource = Session["eceaid"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", dir.EmailContactCount().ToString(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["eceaid"] as DataTable).Rows.Count.ToString(), Resources.DashboardText.SelectRecordCount); } catch { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errSearch, Color.Red); lblrecordcount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.SelectRecordCount); } } } else { LoadEmailContactData(Session["UserID"].ToString(), Session["UserTypeID"].ToString()); } }
protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { lblmessage.Text = ""; if (txtsearch.Text.Length > 0) { if (DropDownList1.SelectedValue == "0") { try { RolesRepository rrir = new RolesRepository(); Session["Roledatafindid"] = rrir.Searchid(txtsearch.Text.ToInt()); GridView1.DataSource = Session["Roledatafindid"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", rrir.Rolescount().ToString(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["Roledatafindid"] as DataTable).Rows.Count.ToString(), Resources.DashboardText.SelectRecordCount); } catch { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errSearch, Color.Red); lblrecordcount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.SelectRecordCount); } } if (DropDownList1.SelectedValue == "1") { try { RolesRepository rrir = new RolesRepository(); Session["Roledatafindtitle"] = rrir.SearchTitle(txtsearch.Text.ToString()); GridView1.DataSource = Session["Roledatafindtitle"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", rrir.Rolescount().ToString(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["Roledatafindtitle"] as DataTable).Rows.Count.ToString(), Resources.DashboardText.SelectRecordCount); } catch { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errSearch, Color.Red); lblrecordcount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.SelectRecordCount); } } } else { LoadRoleData(); } }
protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { lblmessage.Text = ""; if (txtsearch.Text.Length > 0) { if (DropDownList1.SelectedValue == "0") { try { WebServiceAccountsRepository pair = new WebServiceAccountsRepository(); Session["stddatafindid"] = pair.Searchid(txtsearch.Text.ToInt()); GridView1.DataSource = Session["stddatafindid"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", pair.webacountcount().ToString(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["stddatafindid"] as DataTable).Rows.Count.ToString(), Resources.DashboardText.SelectRecordCount); } catch { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errSearch, Color.Red); lblrecordcount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.SelectRecordCount); } } if (DropDownList1.SelectedValue == "1") { try { PersonsAdminsRepository pair = new PersonsAdminsRepository(); Session["stddatafindcode"] = pair.SearchFirstName(txtsearch.Text); GridView1.DataSource = Session["stddatafindcode"]; GridView1.DataBind(); lblrecordcount.Text = string.Format("{0} : {1}", pair.PersonAdmincount().ToString(), Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", (Session["stddatafindcode"] as DataTable).Rows.Count.ToString(), Resources.DashboardText.SelectRecordCount); } catch { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errSearch, Color.Red); lblrecordcount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.RecordCount); lblSelectedDataCount.Text = string.Format("{0} : {1}", "0", Resources.DashboardText.SelectRecordCount); } } else { LoadStdData(); } } }
protected void btnSubmitCaptcha_Click(object sender, EventArgs e) { bool success = false; if (Session["Captcha"] != null) { //Match captcha text entered by user and the one stored in session if (Convert.ToString(Session["Captcha"]) == txtCaptchaText.Text.Trim()) { success = true; } } lblStatus.Visible = true; if (success) { lblStatus.Text = "Success"; PersonsAdminsRepository perir = new PersonsAdminsRepository(); PersonsAdmin currentuser = perir.FindByUserName(tbxusername.Text); if (currentuser == null) { PersonTools.ShowMessage(lblStatus, Resources.DashboardText.errInvalidUserPass, Color.Red); return; } if (tbxpass.Text != currentuser.Password) { PersonTools.ShowMessage(lblStatus, Resources.DashboardText.errInvalidUserPass, Color.Red); return; } if (currentuser.Status.Value == 1) { PersonTools.ShowMessage(lblStatus, Resources.DashboardText.errAccountIsLocked, Color.Red); return; } Session["CurrentUser"] = currentuser; Redirector.Goto(Redirector.PageName.DepartmentsManager); } else { PersonTools.ShowMessage(lblStatus, Resources.DashboardText.errInvalidUserPass, Color.Red); } }
public DataTable GetAllEmp() { List <Employee> result = new List <Employee>(); using (PersonsDBEntities DC = conn.GetContext()) { IEnumerable <Employee> pl = from r in DC.Employees orderby r.EmployeeID select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
public DataTable GetAllFaculties() { List <Faculty> result = new List <Faculty>(); using (PersonsDBEntities DC = conn.GetContext()) { IEnumerable <Faculty> pl = from r in DC.Faculties orderby r.FacultyID select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
public DataTable GetAlldata() { List <PersonsAdmin> result = new List <PersonsAdmin>(); using (PersonsDBEntities DC = conn.GetContext()) { IEnumerable <PersonsAdmin> pl = from r in DC.PersonsAdmins orderby r.AdminID select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
public DataTable Getexeldatavstd() { List <VStudent> result = new List <VStudent>(); using (PersonsDBEntities DC = conn.GetContext()) { IEnumerable <VStudent> pl = from r in DC.VStudents orderby r.StudentID select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
public DataTable GetAllEduLevels() { List <EduLevel> result = new List <EduLevel>(); using (PersonsDBEntities DC = conn.GetContext()) { IEnumerable <EduLevel> pl = from r in DC.EduLevels orderby r.LevelID select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
public DataTable GetAllTendency() { List <VEduTendency> result = new List <VEduTendency>(); using (PersonsDBEntities DC = conn.GetContext()) { IEnumerable <VEduTendency> pl = from r in DC.VEduTendencies orderby r.TendencyID select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
public DataTable GetAlldata() { List <WebServiceAccount> result = new List <WebServiceAccount>(); using (PersonsDBEntities DC = conn.GetContext()) { IEnumerable <WebServiceAccount> pl = from r in DC.WebServiceAccounts orderby r.AccountID select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
public DataTable GetAllDepartment() { List <Department> result = new List <Department>(); using (PersonsDBEntities DC = conn.GetContext()) { IEnumerable <Department> pl = from r in DC.Departments orderby r.DepartmentID select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
public DataTable GetAllLec() { List <Lecturer> result = new List <Lecturer>(); using (PersonsDBEntities DC = conn.GetContext()) { IEnumerable <Lecturer> pl = from r in DC.Lecturers orderby r.LecturerID select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
public DataTable GetAllvpns() { List <VPN> result = new List <VPN>(); using (PersonsDBEntities DC = conn.GetContext()) { IEnumerable <VPN> pl = from r in DC.VPNs orderby r.VPNID select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
public DataTable GetAllTelContacts() { List <TelContact> result = new List <TelContact>(); using (PersonsDBEntities DC = conn.GetContext()) { IEnumerable <TelContact> pl = from r in DC.TelContacts orderby r.ID select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
protected void Button1_Click1(object sender, EventArgs e) { if (lblid.Text.Length > 0) { try { EmailContactsRepository ecrir = new EmailContactsRepository(); if ((TextBox2.Text.Length > 0) && (TextBox2.Text != lblemailaddrress.Text)) { if (ecrir.FindByEmailAddrress(TextBox2.Text) != null) { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errRepeatemailTitle, Color.Red); return; } } // EmailContactsRepository ecrir = new EmailContactsRepository(); EmailContact email = new EmailContact(); email.UserTypeID = Session["UserTypeID"].ToString().ToInt(); // email.UserID=ddluserid.SelectedValue.ToInt(); // email.EmailTypeID = ddlemailtype.SelectedValue.ToInt(); email.UserID = Session["UserID"].ToString().ToInt(); email.EmailTypeID = Session["newemailtype"].ToString().ToInt(); email.ID = lblid.Text.ToInt(); ecrir.SaveEmailContact(email); if ((TextBox2.Text.Length > 0) && (TextBox2.Text != lblemailaddrress.Text)) { email.EmailAddrress = TextBox2.Text.Trim(); } clearform(); PersonTools.ShowMessage(lblmessage, Resources.DashboardText.msgUpdateSuccessfull, Color.Green); } catch { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errUpdateFailed, Color.Red); } } }
protected void Button1_Click1(object sender, EventArgs e) { if (lblid.Text.Length > 0) { try { TelContactsRepository telir = new TelContactsRepository(); if ((TextBox2.Text.Length > 0) && (TextBox2.Text != lbltelnumber.Text)) { if (telir.FindBytelnumber(TextBox2.Text) != null) { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errRepeatetelTitle, Color.Red); return; } } TelContactsRepository ecrir = new TelContactsRepository(); TelContact tel = new TelContact(); tel.UserTypeID = DropDownList1.SelectedItem.Value.ToInt(); // tel.UserID = ddluserid.SelectedValue.ToInt(); tel.UserID = Session["newuserid"].ToString().ToInt(); tel.TelTypeID = Session["newteltype"].ToString().ToInt(); // tel.TelTypeID = ddlTeltype.SelectedValue.ToInt(); tel.ID = lblid.Text.ToInt(); if ((TextBox2.Text.Length > 0) && (TextBox2.Text != lbltelnumber.Text)) { tel.TelNumber = TextBox2.Text.Trim(); } ecrir.SavetelContact(tel); clearform(); PersonTools.ShowMessage(lblmessage, Resources.DashboardText.msgUpdateSuccessfull, Color.Green); } catch { PersonTools.ShowMessage(lblmessage, Resources.DashboardText.errUpdateFailed, Color.Red); } } }
public DataTable GetAntiList(int Levelid) { List <EduLevel> result = new List <EduLevel>(); using (PersonsDBEntities pb = conn.GetContext()) { IEnumerable <EduLevel> pl = from r in pb.EduLevels where r.LevelID == Levelid select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
public DataTable GetstdList(int stdid) { List <VStudent> result = new List <VStudent>(); using (PersonsDBEntities pb = conn.GetContext()) { IEnumerable <VStudent> pl = from r in pb.VStudents where r.StudentID == stdid select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
public DataTable GetAntiList(int departmentid) { List <Department> result = new List <Department>(); using (PersonsDBEntities pb = conn.GetContext()) { IEnumerable <Department> pl = from r in pb.Departments where r.DepartmentID == departmentid select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
public DataTable GetTelContactList(int TelContactid) { List <TelContact> result = new List <TelContact>(); using (PersonsDBEntities pb = conn.GetContext()) { IEnumerable <TelContact> pl = from r in pb.TelContacts where r.ID == TelContactid select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
public DataTable GettendencyList(int tendencyid) { List <VEduTendency> result = new List <VEduTendency>(); using (PersonsDBEntities pb = conn.GetContext()) { IEnumerable <VEduTendency> pl = from r in pb.VEduTendencies where r.TendencyID == tendencyid select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }
public DataTable GetstdList(int empid) { List <VEmployee> result = new List <VEmployee>(); using (PersonsDBEntities pb = conn.GetContext()) { IEnumerable <VEmployee> pl = from r in pb.VEmployees where r.EmployeeID == empid select r; result = pl.ToList(); } return(PersonTools.ToDataTable(result)); }