protected void Page_Load(object sender, EventArgs e) { if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("account")).Attributes.Add("style", "background-color: lightgray;"); ((HtmlControl)this.Master.FindControl("adminProfile")).Attributes.Add("class", "active open"); if (this.IsPostBack) { return; } MembershipUser user = Membership.GetUser(); if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); this.SetRecord(this.hfCompanyID.Value); } } else { this.Response.Redirect("../MemberArea.aspx"); } } this.divUpdate.Visible = this.Session["update"] != null; this.Session.Abandon(); }
public bool CheckCurrency() { MembershipUser user = Membership.GetUser(); string s = string.Empty; if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { s = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); } } else if (Roles.IsUserInRole(str, "Employee")) { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffUserName(str); if (this.objStaffMasterDT.Rows.Count > 0) { s = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString(); } } this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(s)); if (this.objCompanyMasterDT.Rows.Count > 0 && (string.IsNullOrEmpty(this.objCompanyMasterDT.Rows[0]["CurrencyID"].ToString()) || string.IsNullOrEmpty(this.objCompanyMasterDT.Rows[0]["CompanyAddressStreet1"].ToString()))) { return(true); } } return(false); }
public virtual CloudAccountDA.CompanyLoginMasterDataTable GetData() { this.Adapter.SelectCommand = this.CommandCollection[0]; CloudAccountDA.CompanyLoginMasterDataTable dataTable = new CloudAccountDA.CompanyLoginMasterDataTable(); this.Adapter.Fill(dataTable); return(dataTable); }
protected void btnAddCompanyAdmin_Click(object sender, EventArgs e) { if (Admin.RoleName == "MasterAdmin") { this.Response.Redirect("~/BillTransact/CompanyLoginMaster.aspx?cmd=add"); } else { if (!(Admin.RoleName == "Admin")) { return; } this.objCompanyPackageDetailsDT = this.objCompanyPackageDetailsBll.GetDataByCompanyActivePackage(int.Parse(this.hfCompanyID.Value)); int num = 0; if (this.objCompanyPackageDetailsDT.Rows.Count > 0) { this.objPackageMasterDT = this.objPackageMasterBll.GetDataByPackageID(int.Parse(this.objCompanyPackageDetailsDT.Rows[0]["PackageID"].ToString())); if (this.objPackageMasterDT.Rows.Count > 0) { num = int.Parse(this.objPackageMasterDT.Rows[0]["NoOfAdminUsersMax"].ToString()); } } this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objCompanyLoginMasterDT.Rows.Count < num) { this.Response.Redirect("~/BillTransact/CompanyLoginMaster.aspx?cmd=add"); } else { this.DisplayAlert("SORRY.!! You Can Not Create More Company Admin. To Create More Company Admin Please Upgrade From Current Package."); } } }
protected void ddlCompany_SelectedIndexChanged(object sender, EventArgs e) { this.lblError.Text = ""; this.hfCompanyID.Value = this.ddlCompany.SelectedItem.Value; this.objCompanyPackageDetailsDT = this.objCompanyPackageDetailsBll.GetDataByCompanyActivePackage(int.Parse(this.hfCompanyID.Value)); int num = 0; if (this.objCompanyPackageDetailsDT.Rows.Count > 0) { this.objPackageMasterDT = this.objPackageMasterBll.GetDataByPackageID(int.Parse(this.objCompanyPackageDetailsDT.Rows[0]["PackageID"].ToString())); if (this.objPackageMasterDT.Rows.Count > 0) { num = int.Parse(this.objPackageMasterDT.Rows[0]["NoOfAdminUsersMax"].ToString()); } } this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objCompanyLoginMasterDT.Rows.Count < num) { this.txtUserName.Focus(); } else { this.ddlCompany.SelectedIndex = 0; this.ddlCompany.Focus(); this.DisplayAlert("SORRY.!! Can Not Create More Company Admin. To Create More Company Admin Please Upgrade Company Package."); this.lblError.Text = "SORRY.!! Can Not Create More Company Admin. To Create More Company Admin Please Upgrade Company Package."; } }
protected void Page_Load(object sender, EventArgs e) { if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("setting")).Attributes.Add("style", "background-color: lightgray;"); ((HtmlControl)this.Master.FindControl("paypalSetting")).Attributes.Add("class", "active open"); MembershipUser user = Membership.GetUser(); if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); } } } if (this.IsPostBack) { return; } this.SetCompanyRecords(this.hfCompanyID.Value); }
private void SetWelcomeMessage() { MembershipUser user = Membership.GetUser(); if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); } } else if (Roles.IsUserInRole(str, "Employee")) { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffUserName(str); if (this.objStaffMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString(); } } } this.objMiscellaneousMasterDT = this.objMiscellaneousMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objMiscellaneousMasterDT.Rows.Count <= 0) { return; } this.lblStaffWelcomeMsg.Text = this.objMiscellaneousMasterDT.Rows[0]["WelcomeMessagesStaff"].ToString(); this.welcomeDiv.Visible = !string.IsNullOrEmpty(this.lblStaffWelcomeMsg.Text); }
protected void Page_Load(object sender, EventArgs e) { if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("timeTracking")).Attributes.Add("class", "active open"); ((HtmlControl)this.Master.FindControl("genrateInv")).Attributes.Add("class", "active open"); MembershipUser user = Membership.GetUser(); if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); } } } this.txtStartDate.Attributes.Add("readonly", "readonly"); this.txtEndDate.Attributes.Add("readonly", "readonly"); }
public virtual int Fill(CloudAccountDA.CompanyLoginMasterDataTable dataTable) { this.Adapter.SelectCommand = this.CommandCollection[0]; if (this.ClearBeforeFill) { dataTable.Clear(); } return(this.Adapter.Fill(dataTable)); }
protected void BtnUpgradeClick(object sender, EventArgs e) { MembershipUser user = Membership.GetUser(); if (user == null) { return; } this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(user.UserName); this.Response.Redirect("~/BillTransact/UpgradeCompanyPackage.aspx?CompanyID=" + this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString()); }
protected void Page_Load(object sender, EventArgs e) { if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("timeTracking")).Attributes.Add("class", "active open"); ((HtmlControl)this.Master.FindControl("timeSheet")).Attributes.Add("class", "active open"); MembershipUser user = Membership.GetUser(); if (user != null) { string str = user.ToString(); this.hfEntryFor.Value = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); } } else if (Roles.IsUserInRole(str, "Employee")) { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffUserName(str); if (this.objStaffMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString(); this.hfStaffID.Value = this.objStaffMasterDT.Rows[0]["StaffID"].ToString(); } } } if (this.IsPostBack) { return; } if (this.Request.QueryString["cmd"] != null && this.Request.QueryString["ID"] != null) { this.SetRecord(this.Request.QueryString["ID"]); } else { this.Calendar1.SelectedDate = DateTime.Today; this.Calendar2.SelectedDate = DateTime.Today; this.BindDropDown(); this.Calendar1_OnSelectionChanged(sender, e); this.Calendar2_OnSelectionChanged(sender, e); Timesheet.startOfWeek = DateTime.Today.AddDays((double)(-1 * (int)DateTime.Today.DayOfWeek)); Timesheet.endOfWeek = Timesheet.startOfWeek.AddDays(6.0); this.lblTitle1.Text = Timesheet.startOfWeek.ToString("MMMM dd") + " - " + Timesheet.endOfWeek.ToString("MMMM dd, yyyy"); this.FirstGridViewRow(); } }
private void ViewRecord(string i) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(i); if (this.objCompanyLoginMasterDT.Rows.Count <= 0) { return; } this.hfCompanyAdmin.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyLoginID"].ToString(); this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objCompanyMasterDT.Rows.Count > 0) { this.lblCompany.Text = this.objCompanyMasterDT.Rows[0]["CompanyName"].ToString(); } this.hfUserName.Value = this.lblUserName.Text = this.objCompanyLoginMasterDT.Rows[0]["CompanyUserName"].ToString(); this.lblEmail.Text = this.objCompanyLoginMasterDT.Rows[0]["CompanyEmail"].ToString(); this.lblStatus.Text = this.objCompanyLoginMasterDT.Rows[0]["CompanyStatus"].ToString(); MembershipUser user = Membership.GetUser(i); if (user != null && !user.IsLockedOut) { this.lblUserName.Text = user.UserName; this.lblPassword.Text = user.GetPassword(); } else { this.lblPassword.Text = "This User Account has been Locked."; this.lblPassword.ForeColor = Color.Red; this.btnUpdate.Enabled = false; this.chkLocked.Enabled = false; this.chkStatus.Enabled = false; } this.chkLocked.Checked = user != null && user.IsLockedOut; if (user == null) { return; } this.lblUserName.Text = user.UserName; this.lblEmail.Text = user.Email; this.chkStatus.Checked = user.IsApproved; this.lblStatus.Text = user.IsApproved.ToString(); this.lblCreateDate.Text = user.CreationDate.ToShortDateString(); this.lblLastLoginDate.Text = user.LastLoginDate.ToShortDateString(); string userName = user.UserName; this.chkStatus.Enabled = false; this.chkLocked.Enabled = false; this.hfUserName.Value = userName; }
protected void Page_Load(object sender, EventArgs e) { if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("expenseMenu")).Attributes.Add("class", "active open"); ((HtmlControl)this.Master.FindControl("importExpense")).Attributes.Add("class", "active open"); MembershipUser user = Membership.GetUser(); if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objCompanyMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyMasterDT.Rows[0]["CompanyID"].ToString(); this.hfCompanyName.Value = this.objCompanyMasterDT.Rows[0]["CompanyName"].ToString(); } } } else if (Roles.IsUserInRole(str, "Employee")) { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffUserName(str); if (this.objStaffMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString(); this.hfStaffID.Value = this.objStaffMasterDT.Rows[0]["StaffID"].ToString(); this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objCompanyMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyMasterDT.Rows[0]["CompanyID"].ToString(); this.hfCompanyName.Value = this.objCompanyMasterDT.Rows[0]["CompanyName"].ToString(); } } } } if (this.IsPostBack) { return; } this.mvCsv.SetActiveView(this.csvFile); }
public virtual CloudAccountDA.CompanyLoginMasterDataTable GetDataByCompanyUserName(string CompanyUserName) { this.Adapter.SelectCommand = this.CommandCollection[3]; if (CompanyUserName == null) { this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value; } else { this.Adapter.SelectCommand.Parameters[1].Value = CompanyUserName; } CloudAccountDA.CompanyLoginMasterDataTable dataTable = new CloudAccountDA.CompanyLoginMasterDataTable(); this.Adapter.Fill(dataTable); return(dataTable); }
public virtual CloudAccountDA.CompanyLoginMasterDataTable GetDataByCompanyID(int?CompanyID) { this.Adapter.SelectCommand = this.CommandCollection[1]; if (CompanyID.HasValue) { this.Adapter.SelectCommand.Parameters[1].Value = CompanyID.Value; } else { this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value; } CloudAccountDA.CompanyLoginMasterDataTable dataTable = new CloudAccountDA.CompanyLoginMasterDataTable(); this.Adapter.Fill(dataTable); return(dataTable); }
protected void Page_Load(object sender, EventArgs e) { MembershipUser user = Membership.GetUser(); if (user == null) { return; } string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count <= 0) { return; } this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objCompanyMasterDT.Rows.Count <= 0) { return; } this.hfCompanyID.Value = this.objCompanyMasterDT.Rows[0]["CompanyID"].ToString(); this.hfCompanyName.Value = this.objCompanyMasterDT.Rows[0]["CompanyName"].ToString(); } else { if (!Roles.IsUserInRole(str, "Employee")) { return; } this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffUserName(str); if (this.objStaffMasterDT.Rows.Count <= 0) { return; } this.hfCompanyID.Value = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString(); this.hfStaffID.Value = this.objStaffMasterDT.Rows[0]["StaffID"].ToString(); this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objCompanyMasterDT.Rows.Count <= 0) { return; } this.hfCompanyID.Value = this.objCompanyMasterDT.Rows[0]["CompanyID"].ToString(); this.hfCompanyName.Value = this.objCompanyMasterDT.Rows[0]["CompanyName"].ToString(); } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (!this.Page.IsValid) { return; } if (this.txtUserName.Text.Trim().Length > 0 && this.txtPassword.Text.Trim().Length > 0 && this.txtEmail.Text.Trim().Length > 0) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(this.txtUserName.Text); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.DisplayAlert("User Name Already Exist.."); CompanyLoginMaster.checkInDB = true; } else { CompanyLoginMaster.checkInDB = false; } if (!CompanyLoginMaster.checkInDB) { MembershipCreateStatus status; Membership.CreateUser(this.txtUserName.Text.Trim(), this.txtPassword.Text.Trim(), this.txtEmail.Text.Trim(), this.txtQuestion.Text.Trim(), this.txtAnswer.Text.Trim(), this.chkStatus.Checked, out status); Roles.AddUserToRole(this.txtUserName.Text, this.ddlRole.SelectedItem.Value); if (this.objCompanyLoginMasterBll.AddCompanyLogin(int.Parse(this.ddlCompany.SelectedItem.Value), this.txtUserName.Text.Trim(), this.txtEmail.Text, this.chkStatus.Checked) != 0 && status == MembershipCreateStatus.Success) { this.DisplayAlert("Details Added Successfully."); this.Response.Redirect("~/BillTransact/CompanyLoginMaster.aspx?cmd=view&ID=" + this.txtUserName.Text.Trim()); } else { this.DisplayAlert("Fail to Add New Details."); this.Clear(); } } else { this.DisplayAlert("Fail to Add New Details."); this.Clear(); } } else { this.DisplayAlert("Please Fill All Details...!"); } }
protected void Page_Load(object sender, EventArgs e) { MembershipUser user = Membership.GetUser(); if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); } } else if (Roles.IsUserInRole(str, "Employee")) { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffUserName(str); if (this.objStaffMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString(); } } Dbutility objDbutility = new Dbutility(); query = string.Format("SELECT CloudPackageID,CloudPackageName,CloudPackagePriceMonthly,CloudPackagePriceYearly,CloudPackageCurrency FROM CloudPackageMaster " + " Where CloudPackageID={0}", this.Request.QueryString["id"]); dtCloudPackageMaster = objDbutility.BindDataTable(query); if (dtCloudPackageMaster?.Rows.Count > 0) { hCloudPackageType.Value = Convert.ToString(dtCloudPackageMaster.Rows[0]["CloudPackageName"]); if (this.Request.QueryString["type"] == "M") { amount = Convert.ToString(dtCloudPackageMaster.Rows[0]["CloudPackagePriceMonthly"]); lblPaymentAmount.Text = String.Format("{0:0.00}", dtCloudPackageMaster.Rows[0]["CloudPackagePriceMonthly"]); } else { amount = Convert.ToString(dtCloudPackageMaster.Rows[0]["CloudPackagePriceMonthly"]); lblPaymentAmount.Text = String.Format("{0:0.00}", dtCloudPackageMaster.Rows[0]["CloudPackagePriceYearly"]); } lblPaymentAmount.Text = String.Format("{0} {1}", GetCurrency(Convert.ToString(dtCloudPackageMaster.Rows[0]["CloudPackageCurrency"])), lblPaymentAmount.Text); } } }
protected void Page_Load(object sender, EventArgs e) { if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("reports")).Attributes.Add("class", "active open"); MembershipUser user = Membership.GetUser(); if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); } } else if (Roles.IsUserInRole(str, "Employee")) { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffUserName(str); if (this.objStaffMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString(); } } this.imgLogo.ImageUrl = Doyingo.SetCompanyLogo(this.hfCompanyID.Value); this.SetMiscValues(this.hfCompanyID.Value); } if (this.IsPostBack) { return; } DateTime dateTime = new DateTime(DateTime.Now.Year, 1, 1); DateTime now = DateTime.Now; this.txtDateFrom.Text = dateTime.ToString(this.dateFormat); this.txtDateTo.Text = now.ToString(this.dateFormat); this.ceDateFrom.StartDate = new DateTime?(DateTime.Now); this.BindGrid(); }
public void SetDashboardCompanyAdmin() { MembershipUser user = Membership.GetUser(); if (user == null || !Roles.IsUserInRole(user.UserName, "Admin")) { return; } this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(user.UserName); this.objCompanyPackageDetailsDT = this.objCompanyPackageDetailsBll.GetDataByCompanyActivePackage(int.Parse(this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString())); if (this.objCompanyPackageDetailsDT.Rows.Count <= 0) { return; } string s = DateTime.Parse(this.objCompanyPackageDetailsDT.Rows[0]["PackageEndDate"].ToString()).ToShortDateString(); this.packageInfo.Visible = DateTime.Parse(s) <= DateTime.Parse(DateTime.Now.ToShortDateString()); this.dashboard.Visible = !(DateTime.Parse(s) <= DateTime.Parse(DateTime.Now.ToShortDateString())); }
protected void txtUserName_TextChanged(object sender, EventArgs e) { if (this.txtUserName.Text.Trim().Length <= 0) { return; } this.objUserDT = this.objUserBll.GetAllDetail(this.txtUserName.Text.Trim()); this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(this.txtUserName.Text.Trim()); if (this.objCompanyLoginMasterDT.Rows.Count > 0 && this.objUserDT.Rows.Count > 0) { this.DisplayAlert("UserName Already Assigned To Someone."); this.txtUserName.Text = ""; this.txtUserName.Focus(); } else { this.txtAnswer.Text = this.txtUserName.Text; this.txtEmail.Focus(); } }
protected void Page_Load(object sender, EventArgs e) { if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("reports")).Attributes.Add("class", "active open"); if (!this.IsPostBack) { this.ddlMonth.SelectedValue = DateTime.Now.Month.ToString(); this.ddlYear.Items.Add(new ListItem(DateTime.Now.Year.ToString(), DateTime.Now.Year.ToString())); this.ddlYear.SelectedValue = DateTime.Now.Year.ToString(); this.BindGrid(); } MembershipUser user = Membership.GetUser(); if (user == null) { return; } string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); } } else if (Roles.IsUserInRole(str, "Employee")) { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffUserName(str); if (this.objStaffMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString(); } } this.imgLogo.ImageUrl = Doyingo.SetCompanyLogo(this.hfCompanyID.Value); this.SetMiscValues(this.hfCompanyID.Value); }
protected void Page_Load(object sender, EventArgs e) { if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("reports")).Attributes.Add("class", "active open"); if (!this.IsPostBack) { this.ddlYear.Items.AddRange(Enumerable.ToArray <ListItem>(Enumerable.Select <int, ListItem>(Enumerable.Range(DateTime.Now.Year - 12, 13), (Func <int, ListItem>)(enumerable => new ListItem(enumerable.ToString((IFormatProvider)CultureInfo.InvariantCulture)))))); this.ddlYear.SelectedIndex = this.ddlYear.Items.IndexOf(this.ddlYear.Items.FindByText(DateTime.Now.Year.ToString((IFormatProvider)CultureInfo.InvariantCulture))); this.BindGrid(); } MembershipUser user = Membership.GetUser(); if (user == null) { return; } string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); this.imgLogo.ImageUrl = Doyingo.SetCompanyLogo(this.hfCompanyID.Value); } } else if (Roles.IsUserInRole(str, "Employee")) { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffUserName(str); if (this.objStaffMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString(); this.imgLogo.ImageUrl = Doyingo.SetCompanyLogo(this.hfCompanyID.Value); } } this.SetMiscValues(this.hfCompanyID.Value); }
protected void Page_Load(object sender, EventArgs e) { MembershipUser user = Membership.GetUser(); if (user == null) { return; } string str = user.ToString(); if (!Roles.IsUserInRole(str, "Admin")) { return; } this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count <= 0) { return; } this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("userManagement")).Attributes.Add("class", "active open"); ((HtmlControl)this.Master.FindControl("accountant")).Attributes.Add("class", "active open"); MembershipUser user = Membership.GetUser(); if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this._objCompanyLoginMasterDt = this._objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this._objCompanyLoginMasterDt.Rows.Count > 0) { this.hfCompanyID.Value = this._objCompanyLoginMasterDt.Rows[0]["CompanyID"].ToString(); } } } if (this.IsPostBack) { return; } this.dlClientByYou.DataBind(); if (this.dlClientByYou.Items.Count > 0) { this.btnAdd.Visible = false; this.btnRemove.Visible = true; } else { this.btnAdd.Visible = true; this.btnRemove.Visible = false; } this.SetSomeRecords(); }
protected void Page_Load(object sender, EventArgs e) { this._objContactMasterDt = this._objContactMasterBll.GetAllDetail(); if (this._objContactMasterDt.Rows.Count > 0) { string str1 = this._objContactMasterDt.Rows[0]["Phone1"].ToString(); string str2 = this._objContactMasterDt.Rows[0]["Email1"].ToString(); this.lblContact.Text = "<li>Call Us Now. : <a href=\"tele:" + str1 + "\">" + str1 + "</a></li><li>Get In Touch. : <a href=\"mailto:" + str2 + "\">" + str2 + "</a></li>"; } MembershipUser user = Membership.GetUser(); if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); } } else if (Roles.IsUserInRole(str, "Employee")) { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffUserName(str); if (this.objStaffMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString(); } } } this.objCompanyPackageMasterDT = this.objCompanyPackageMasterBll.GetDataByCompanyActivePackage(int.Parse(this.hfCompanyID.Value)); if (this.objCompanyPackageMasterDT.Rows.Count <= 0) { return; } this.lblBack.Visible = (DateTime.Parse(DateTime.Parse(this.objCompanyPackageMasterDT.Rows[0]["PackageEndDate"].ToString()).ToShortDateString()) - DateTime.Parse(DateTime.UtcNow.ToShortDateString())).TotalDays > 0.0; }
protected void Page_Load(object sender, EventArgs e) { if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("timeTracking")).Attributes.Add("class", "active open"); ((HtmlControl)this.Master.FindControl("teamTimeSheet")).Attributes.Add("class", "active open"); MembershipUser user = Membership.GetUser(); if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); } } else if (Roles.IsUserInRole(str, "Employee")) { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffUserName(str); if (this.objStaffMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString(); } } } this.SetPageData(); if (this.IsPostBack) { return; } this.Calendar1.SelectedDate = DateTime.Today; this.Calendar1_OnSelectionChanged(sender, e); }
protected void Page_Load(object sender, EventArgs e) { if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("pricing")).Attributes.Add("class", "current-menu-item current-menu-ancestor"); if (this.Request.QueryString["UserName"] != null) { MembershipUser user = Membership.GetUser(this.Request.QueryString["UserName"]); if (user != null) { this.verifiedEmailDiv.Visible = true; this.unverifiedEmailDiv.Visible = false; this.noEmailDiv.Visible = false; user.IsApproved = true; Membership.UpdateUser(user); this._objCompanyLoginMasterDt = this._objCompanyLoginMasterBll.GetDataByCompanyLoginName(user.UserName); if (this._objCompanyLoginMasterDt.Rows.Count <= 0) { return; } this._objCompanyLoginMasterBll.UpdateCompanyLogin(int.Parse(this._objCompanyLoginMasterDt.Rows[0]["CompanyLoginID"].ToString()), int.Parse(this._objCompanyLoginMasterDt.Rows[0]["CompanyID"].ToString()), this._objCompanyLoginMasterDt.Rows[0]["CompanyUserName"].ToString(), this._objCompanyLoginMasterDt.Rows[0]["CompanyEmail"].ToString(), true); } else { this.verifiedEmailDiv.Visible = false; this.unverifiedEmailDiv.Visible = true; this.noEmailDiv.Visible = false; } } else { this.noEmailDiv.Visible = true; this.verifiedEmailDiv.Visible = false; this.unverifiedEmailDiv.Visible = false; } }
private void AddAccountantToClient() { MembershipUser user = Membership.GetUser(); if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); } } } int iAccountantID = int.Parse(this.Request.QueryString["accId"]); DateTime dateTime = DateTime.Parse(this.Request.QueryString["Dated"]); int num = 0; this._objAccountantClientDetailDt = this._objAccountantClientDetailBll.GetDataByAccountantID(iAccountantID); if (this._objAccountantClientDetailDt.Rows.Count > 0) { for (int index = 0; index < this._objAccountantClientDetailDt.Rows.Count; ++index) { if (this.hfCompanyID.Value == this._objAccountantClientDetailDt.Rows[index]["CompanyID"].ToString()) { ++num; break; } } } if (num == 0) { this._objAccountantClientDetailBll.AddAccountantClient(iAccountantID, int.Parse(this.hfCompanyID.Value), false, true, new DateTime?(dateTime), new DateTime?(DateTime.Now)); } this.Response.Redirect("DefaultDoyingo.aspx"); }
protected void gvCompanyAdminUserRights_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(e.Row.Cells[1].Text)); if (this.objCompanyMasterDT.Rows.Count > 0) { string str = this.objCompanyMasterDT.Rows[0]["CompanyName"].ToString(); e.Row.Cells[1].Text = str; } } if (e.Row.RowType != DataControlRowType.DataRow) { return; } this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginID(int.Parse(e.Row.Cells[2].Text)); if (this.objCompanyLoginMasterDT.Rows.Count <= 0) { return; } string str1 = this.objCompanyLoginMasterDT.Rows[0]["CompanyUserName"].ToString(); e.Row.Cells[2].Text = str1; }