protected void txtEmail_OnTextChanged(object sender, EventArgs e) { this.objCompanyClientContactDetailDT = this.objCompanyClientContactDetailBll.GetDataByCompanyEmail(int.Parse(this.hfCompanyID.Value), this.txtEmail.Text.Trim()); this.objStaffMasterDT = this.objStaffMasterBll.GetDataByCompanyEmail(int.Parse(this.hfCompanyID.Value), this.txtEmail.Text.Trim()); this.objContractorMasterDT = this.objContractorMasterBll.GetDataByCompanyEmail(int.Parse(this.hfCompanyID.Value), this.txtEmail.Text.Trim()); if (this.objCompanyClientContactDetailDT.Rows.Count > 0) { ScriptManager.RegisterClientScriptBlock(sender as Control, this.GetType(), "alert", "alert('Email Already Register With System To Some Client.')", true); this.txtEmail.Text = ""; this.txtEmail.Focus(); } else if (this.objStaffMasterDT.Rows.Count > 0) { ScriptManager.RegisterClientScriptBlock(sender as Control, this.GetType(), "alert", "alert('Email Already Register With System To Some Staff.')", true); this.txtEmail.Text = ""; this.txtEmail.Focus(); } else if (this.objContractorMasterDT.Rows.Count > 0) { ScriptManager.RegisterClientScriptBlock(sender as Control, this.GetType(), "alert", "alert('Email Already Register With System To Some Contractor.')", true); this.txtEmail.Text = ""; this.txtEmail.Focus(); } else { this.txtFirstName.Focus(); } }
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); }
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); }
public virtual CloudAccountDA.StaffMasterDataTable GetData() { this.Adapter.SelectCommand = this.CommandCollection[0]; CloudAccountDA.StaffMasterDataTable dataTable = new CloudAccountDA.StaffMasterDataTable(); this.Adapter.Fill(dataTable); return(dataTable); }
public virtual CloudAccountDA.StaffMasterDataTable UpdateWhenDelete(int?StaffID, bool?Active, bool?Deleted) { this.Adapter.SelectCommand = this.CommandCollection[7]; if (StaffID.HasValue) { this.Adapter.SelectCommand.Parameters[1].Value = StaffID.Value; } else { this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value; } if (Active.HasValue) { this.Adapter.SelectCommand.Parameters[2].Value = Active.Value; } else { this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value; } if (Deleted.HasValue) { this.Adapter.SelectCommand.Parameters[3].Value = Deleted.Value; } else { this.Adapter.SelectCommand.Parameters[3].Value = DBNull.Value; } CloudAccountDA.StaffMasterDataTable dataTable = new CloudAccountDA.StaffMasterDataTable(); this.Adapter.Fill(dataTable); return(dataTable); }
protected void btnSave_Click(object sender, EventArgs e) { try { if (!this.Page.IsValid) { return; } this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffID(int.Parse(this.hfStaffID.Value)); bool bActive = (bool)this.objStaffMasterDT.Rows[0]["Active"]; bool bArchived = (bool)this.objStaffMasterDT.Rows[0]["Archived"]; bool bDeleted = (bool)this.objStaffMasterDT.Rows[0]["Deleted"]; string sNotes = this.objStaffMasterDT.Rows[0]["Notes"].ToString(); int? iCountryID = new int?(); int? iStateID = new int?(); int? iCityID = new int?(); Decimal?dBillingRate = new Decimal?(); if (this.ddlCountry.SelectedIndex > 0) { iCountryID = new int?(int.Parse(this.ddlCountry.SelectedItem.Value)); } if (this.ddlState.SelectedIndex > 0) { iStateID = new int?(int.Parse(this.ddlState.SelectedItem.Value)); } if (this.ddlCity.SelectedIndex > 0) { iCityID = new int?(int.Parse(this.ddlCity.SelectedItem.Value)); } string s = this.objStaffMasterDT.Rows[0]["BillingRate"].ToString(); if (!string.IsNullOrEmpty(s)) { dBillingRate = new Decimal?(Decimal.Parse(s)); } if (this.txtCurrentPassword.Text.Trim().Length > 0 && this.txtCurrentPassword.Text.Trim().Length > 4 && this.txtCurrentPassword.Text.Trim().Length > 4) { MembershipUser user = Membership.GetUser(); if (user != null) { user.ChangePassword(this.txtCurrentPassword.Text.Trim(), this.txtNewPassword.Text.Trim()); } } if (this.objStaffMasterBll.UpdateStaff(int.Parse(this.hfStaffID.Value), int.Parse(this.hfCompanyID.Value), this.txtStaffEmail.Text.Trim(), this.txtStaffFirstName.Text.Trim(), this.txtStaffLastName.Text.Trim(), dBillingRate, this.txtUsername.Text.Trim(), this.txtAddress1.Text.Trim(), this.txtAddress2.Text.Trim(), iCountryID, iStateID, iCityID, this.txtZipCode.Text.Trim(), this.txtHomePhone.Text.Trim(), this.txtMobile.Text.Trim(), this.txtBussinessPhone.Text.Trim(), this.txtFax.Text.Trim(), sNotes, bActive, bArchived, bDeleted)) { this.Session["update"] = (object)1; this.DisplayAlert("Update Successfully.."); this.Response.Redirect("~/BillTransact/UpdateStaffProfile.aspx"); } else { this.DisplayAlert("Fail to Update Details."); } } catch (Exception ex) { this.DisplayAlert(ex.Message); } }
public virtual int Fill(CloudAccountDA.StaffMasterDataTable dataTable) { this.Adapter.SelectCommand = this.CommandCollection[0]; if (this.ClearBeforeFill) { dataTable.Clear(); } return(this.Adapter.Fill(dataTable)); }
private void SetRecord(string iD) { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffID(int.Parse(iD)); if (this.objStaffMasterDT.Rows.Count <= 0) { return; } this.hfStaffID.Value = this.objStaffMasterDT.Rows[0]["StaffID"].ToString(); this.hfCompanyID.Value = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString(); this.txtStaffEmail.Text = this.objStaffMasterDT.Rows[0]["Email"].ToString(); this.txtStaffFirstName.Text = this.objStaffMasterDT.Rows[0]["FirstName"].ToString(); this.txtStaffLastName.Text = this.objStaffMasterDT.Rows[0]["LastName"].ToString(); this.txtHomePhone.Text = this.objStaffMasterDT.Rows[0]["HomePhone"].ToString(); this.txtMobile.Text = this.objStaffMasterDT.Rows[0]["Mobile"].ToString(); this.txtUsername.Text = this.objStaffMasterDT.Rows[0]["UserName"].ToString(); this.txtAddress1.Text = this.objStaffMasterDT.Rows[0]["Address1"].ToString(); this.txtAddress2.Text = this.objStaffMasterDT.Rows[0]["Address2"].ToString(); this.txtZipCode.Text = this.objStaffMasterDT.Rows[0]["ZipCode"].ToString(); this.txtBussinessPhone.Text = this.objStaffMasterDT.Rows[0]["BussinessPhone"].ToString(); this.txtFax.Text = this.objStaffMasterDT.Rows[0]["Fax"].ToString(); string s1 = this.objStaffMasterDT.Rows[0]["CountryID"].ToString(); string s2 = this.objStaffMasterDT.Rows[0]["StateID"].ToString(); string s3 = this.objStaffMasterDT.Rows[0]["CityID"].ToString(); if (!string.IsNullOrEmpty(s1)) { this.objCountryMasterDT = this.objCountryMasterBll.GetDataByCountryID(int.Parse(s1)); if (this.objCountryMasterDT.Rows.Count > 0) { this.ddlCountry.Items.Add(this.objCountryMasterDT.Rows[0]["CountryID"].ToString()); this.ddlCountry.SelectedValue = this.objCountryMasterDT.Rows[0]["CountryID"].ToString(); } } if (!string.IsNullOrEmpty(s2)) { this.objStateMasterDT = this.objStateMasterBll.GetDataByStateID(int.Parse(s2)); if (this.objStateMasterDT.Rows.Count > 0) { this.ddlState.Items.Add(this.objStateMasterDT.Rows[0]["StateID"].ToString()); this.ddlState.SelectedValue = this.objStateMasterDT.Rows[0]["StateID"].ToString(); } } if (!string.IsNullOrEmpty(s3)) { this.objCityMasterDT = this.objCityMasterBll.GetDataByCityID(int.Parse(s3)); if (this.objCityMasterDT.Rows.Count > 0) { this.ddlCity.Items.Add(this.objCityMasterDT.Rows[0]["CityID"].ToString()); this.ddlCity.SelectedValue = this.objCityMasterDT.Rows[0]["CityID"].ToString(); } } this.txtUsername.Enabled = false; this.txtStaffEmail.Enabled = false; }
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 bool CheckEmail(string email) { this.objCompanyClientContactDetailDT = this.objCompanyClientContactDetailBll.GetDataByCompanyEmail(int.Parse(this.hfCompanyID.Value), email.Trim()); this.objCompanyClientMasterDT = this.objCompanyClientMasterBll.GetDataByCompanyEmail(int.Parse(this.hfCompanyID.Value), email.Trim()); this.objStaffMasterDT = this.objStaffMasterBll.GetDataByCompanyEmail(int.Parse(this.hfCompanyID.Value), email.Trim()); this.objContractorMasterDT = this.objContractorMasterBll.GetDataByCompanyEmail(int.Parse(this.hfCompanyID.Value), email.Trim()); this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyEmail(email.Trim()); if (this.objCompanyMasterDT.Rows.Count > 0) { return(this.hfCompanyID.Value == this.objCompanyMasterDT.Rows[0]["CompanyID"].ToString() ? true : true); } return(this.objCompanyClientMasterDT.Rows.Count > 0 || this.objCompanyClientContactDetailDT.Rows.Count > 0 || (this.objStaffMasterDT.Rows.Count > 0 || this.objContractorMasterDT.Rows.Count > 0)); }
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.StaffMasterDataTable DeleteByCompanyID(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.StaffMasterDataTable dataTable = new CloudAccountDA.StaffMasterDataTable(); this.Adapter.Fill(dataTable); return(dataTable); }
public virtual CloudAccountDA.StaffMasterDataTable GetDataByStaffUserName(string UserName) { this.Adapter.SelectCommand = this.CommandCollection[5]; if (UserName == null) { this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value; } else { this.Adapter.SelectCommand.Parameters[1].Value = UserName; } CloudAccountDA.StaffMasterDataTable dataTable = new CloudAccountDA.StaffMasterDataTable(); 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 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(); }
private void ViewRecord(string sId) { bool flag = false; this.objProjectMasterDT = this.objProjectMasterBll.GetDataByProjectID(int.Parse(sId)); if (this.objProjectMasterDT.Rows.Count > 0) { flag = this.objProjectMasterDT.Rows[0]["ClientID"].ToString() == this.hfClientID.Value; } if (this.objProjectMasterDT.Rows.Count > 0 && flag) { this.hfProjectID.Value = this.objProjectMasterDT.Rows[0]["ProjectID"].ToString(); this.lblProject.Text = this.objProjectMasterDT.Rows[0]["ProjectName"].ToString(); this.hfCompanyID.Value = this.objProjectMasterDT.Rows[0]["CompanyID"].ToString(); this.lblProjectManager.Text = this.objProjectMasterDT.Rows[0]["ProjectManager"].ToString(); if (string.IsNullOrEmpty(this.lblProjectManager.Text)) { return; } int iStaffID = int.Parse(this.lblProjectManager.Text); if (iStaffID == 0) { this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); this.lblProjectManager.Text = this.objCompanyMasterDT.Rows[0]["CompanyContactPerson"].ToString(); } else { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffID(iStaffID); if (this.objStaffMasterDT.Rows.Count <= 0) { return; } this.lblProjectManager.Text = (string)this.objStaffMasterDT.Rows[0]["FirstName"] + (object)" " + (string)this.objStaffMasterDT.Rows[0]["LastName"]; } } else { this.pnlViewAll.Visible = true; this.pnlView.Visible = false; this.BindGrid(); } }
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) { 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); }
public virtual CloudAccountDA.StaffMasterDataTable GetDataByCompanyIDAndEmail(int?CompanyID, string Email) { this.Adapter.SelectCommand = this.CommandCollection[3]; if (CompanyID.HasValue) { this.Adapter.SelectCommand.Parameters[1].Value = CompanyID.Value; } else { this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value; } if (Email == null) { this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value; } else { this.Adapter.SelectCommand.Parameters[2].Value = Email; } CloudAccountDA.StaffMasterDataTable dataTable = new CloudAccountDA.StaffMasterDataTable(); this.Adapter.Fill(dataTable); return(dataTable); }
protected void Page_Load(object sender, EventArgs e) { if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("staffProfile")).Attributes.Add("style", "background-color: lightgray;"); MembershipUser user = Membership.GetUser(); if (this.IsPostBack) { return; } if (user != null) { string str = user.ToString(); 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.SetRecord(this.hfStaffID.Value); this.pnlAdd.Visible = true; } } else { this.Response.Redirect("../MemberArea.aspx"); this.pnlAdd.Visible = false; } } this.divUpdate.Visible = this.Session["update"] != null; this.Session.Abandon(); }
private void ViewRecord(string iD) { this.objProjectMasterDT = this.objProjectMasterBll.GetDataByProjectID(int.Parse(iD)); if (this.objProjectMasterDT.Rows.Count <= 0) { return; } this.hfProjectID.Value = this.objProjectMasterDT.Rows[0]["ProjectID"].ToString(); this.aMethod.Attributes.Add("href", "ProjectMaster.aspx?cmd=add&ID=" + this.hfProjectID.Value); this.hfCompanyID.Value = this.objProjectMasterDT.Rows[0]["CompanyID"].ToString(); this.lblProjectName.Text = this.objProjectMasterDT.Rows[0]["ProjectName"].ToString(); this.lblManager.Text = this.objProjectMasterDT.Rows[0]["ProjectManager"].ToString(); this.lblMethod.Text = this.objProjectMasterDT.Rows[0]["BillingMethod"].ToString(); string str1 = "<b>Estimate:</b> " + this.objProjectMasterDT.Rows[0]["TimeEstimate"] + " hrs<br />"; string str2 = "width: 0;"; this.lblProDetails.Text = str1 + "<b>Progress:</b> 0%"; this.gvBudget.DataBind(); if (this.gvBudget.Rows.Count > 0) { string text = this.gvBudget.Rows[0].Cells[3].Text; str2 = "width: " + text + "%;"; this.lblProDetails.Text = str1 + "<b>Progress:</b> " + text + "%"; } this.divPro.Attributes.Add("style", str2); if (this.lblManager.Text == "0") { this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); this.lblManager.Text = this.objCompanyMasterDT.Rows[0]["CompanyContactPerson"].ToString(); } else { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffID(int.Parse(this.lblManager.Text)); this.lblManager.Text = (string)this.objStaffMasterDT.Rows[0]["FirstName"] + (object)" " + (string)this.objStaffMasterDT.Rows[0]["LastName"]; } }
private void SetPageData() { this.gvCurrentWeek.DataBind(); if (this.gvCurrentWeek.Rows.Count > 0) { this.lblCurrentWeek.Text = DateTime.Parse(this.gvCurrentWeek.Rows[0].Cells[0].Text).ToString("MMM dd/yy") + " - " + DateTime.Parse(this.gvCurrentWeek.Rows[0].Cells[1].Text).ToString("MMM dd/yy"); } this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); string str1 = this.objCompanyMasterDT.Rows[0]["CompanyContactPerson"].ToString(); StringBuilder stringBuilder1 = new StringBuilder(); stringBuilder1.Insert(0, str1); if (stringBuilder1.Length > 12) { str1 = stringBuilder1.ToString().Substring(0, 10) + "..."; } string sEntryFor1 = this.objCompanyMasterDT.Rows[0]["CompanyUserName"].ToString(); this.objTeamSummaryDT = this.objTeamSummaryBll.GetDataByMonth(int.Parse(this.hfCompanyID.Value), sEntryFor1); string str2 = "0.00"; if (this.objTeamSummaryDT.Rows.Count > 0) { str2 = this.objTeamSummaryDT.Rows[0]["Hours"].ToString(); } this.objTeamSummaryDT = this.objTeamSummaryBll.GetDataByWeek(int.Parse(this.hfCompanyID.Value), sEntryFor1); string str3 = "0.00"; if (this.objTeamSummaryDT.Rows.Count > 0) { str3 = this.objTeamSummaryDT.Rows[0]["Hours"].ToString(); } Label label1 = new Label(); label1.ID = "lblNameCmp" + str1; label1.Text = str1; Label label2 = label1; Label label3 = new Label(); label3.ID = "lblHoursMonthCmp" + str1; label3.Text = str2; Label label4 = label3; Label label5 = new Label(); label5.ID = "lblHoursWeekCmp" + str1; label5.Text = str3; Label label6 = label5; this.divName.Controls.Add((Control)label2); this.divHoursMonth.Controls.Add((Control)label4); this.divHoursWeek.Controls.Add((Control)label6); this.divName.Controls.Add((Control) new LiteralControl("<BR>")); this.divHoursMonth.Controls.Add((Control) new LiteralControl("<BR>")); this.divHoursWeek.Controls.Add((Control) new LiteralControl("<BR>")); this.objStaffMasterDT = this.objStaffMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objStaffMasterDT.Rows.Count <= 0) { return; } for (int index = 0; index < this.objStaffMasterDT.Rows.Count; ++index) { string sEntryFor2 = this.objStaffMasterDT.Rows[index]["UserName"].ToString(); string str4 = (string)this.objStaffMasterDT.Rows[index]["FirstName"] + (object)" " + (string)this.objStaffMasterDT.Rows[index]["LastName"]; StringBuilder stringBuilder2 = new StringBuilder(); stringBuilder2.Insert(0, str4); if (stringBuilder2.Length > 12) { str4 = stringBuilder2.ToString().Substring(0, 10) + "..."; } this.objTeamSummaryDT = this.objTeamSummaryBll.GetDataByMonth(int.Parse(this.hfCompanyID.Value), sEntryFor2); string str5 = "0.00"; if (this.objTeamSummaryDT.Rows.Count > 0) { str5 = this.objTeamSummaryDT.Rows[0]["Hours"].ToString(); } this.objTeamSummaryDT = this.objTeamSummaryBll.GetDataByWeek(int.Parse(this.hfCompanyID.Value), sEntryFor2); string str6 = "0.00"; if (this.objTeamSummaryDT.Rows.Count > 0) { str6 = this.objTeamSummaryDT.Rows[0]["Hours"].ToString(); } Label label7 = new Label(); label7.ID = "lblNameStaff" + str4; label7.Text = str4; Label label8 = label7; Label label9 = new Label(); label9.ID = "lblHoursMonthStaff" + str4; label9.Text = str5; Label label10 = label9; Label label11 = new Label(); label11.ID = "lblHoursWeekStaff" + str4; label11.Text = str6; Label label12 = label11; this.divName.Controls.Add((Control)label8); this.divHoursMonth.Controls.Add((Control)label10); this.divHoursWeek.Controls.Add((Control)label12); this.divName.Controls.Add((Control) new LiteralControl("<BR>")); this.divHoursMonth.Controls.Add((Control) new LiteralControl("<BR>")); this.divHoursWeek.Controls.Add((Control) new LiteralControl("<BR>")); } }
private void SetNewDefaultValues() { 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(); } } } int num = 30; this.objFreePackageSettingsDT = this.objFreePackageSettingsBll.GetAllDetail(); if (this.objFreePackageSettingsDT.Rows.Count > 0) { num = int.Parse(this.objFreePackageSettingsDT.Rows[0]["FreePackageDays"].ToString()); } this.objCompanyPackageMasterDT = this.objCompanyPackageMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objCompanyPackageMasterDT.Rows.Count == 0) { this.objCompanyPackageMasterBll.AddCompanyPackage(int.Parse(this.hfCompanyID.Value), 0, new DateTime?(DateTime.Now), new DateTime?(DateTime.Now.AddDays((double)num)), "FREE", new Decimal?(new Decimal(0)), "NONE", new DateTime?(), new DateTime?(DateTime.Now), true); } this.objAdminPermissionMasterDT = this.objAdminPermissionMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objAdminPermissionMasterDT.Rows.Count == 0) { this.objAdminPermissionMasterBll.AddAdminPermission(int.Parse(this.hfCompanyID.Value), true, true, true, false, false); } this.objMiscellaneousMasterDT = this.objMiscellaneousMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objMiscellaneousMasterDT.Rows.Count == 0) { this.objMiscellaneousMasterBll.AddMiscellaneous(int.Parse(this.hfCompanyID.Value), 15, "MM/dd/yyyy", true, true, true, "", true, false, "Both", "", "", "None", "Read/Write", 30, 10); } this.objClientPermissionMasterDT = this.objClientPermissionMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objClientPermissionMasterDT.Rows.Count == 0) { this.objClientPermissionMasterBll.AddClientPermission(int.Parse(this.hfCompanyID.Value), true, true, true, false, false, true, true); } this.objStaffPermissionMasterDT = this.objStaffPermissionMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objStaffPermissionMasterDT.Rows.Count == 0) { this.objStaffPermissionMasterBll.AddStaffPermission(int.Parse(this.hfCompanyID.Value), true, true, true, true, true, false, false, true, true, true, true, true); } this.objTemplateSettingsDT = this.objTemplateSettingsBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objTemplateSettingsDT.Rows.Count == 0) { this.objTemplateSettingsBll.AddTemplateSettings(int.Parse(this.hfCompanyID.Value), 1, "Invoice", "Estimate", "Credit", true); } this.objEmailNotificationsDT = this.objEmailNotificationsBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objEmailNotificationsDT.Rows.Count == 0) { this.objEmailNotificationsBll.AddEmailNotifications(int.Parse(this.hfCompanyID.Value), true, false, false, false); } this.objSMTPSettingsDT = this.objSMTPSettingsBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objSMTPSettingsDT.Rows.Count == 0) { this.objSMTPSettingsBll.AddSMTPSettings(int.Parse(this.hfCompanyID.Value), Common.CommonHandler.BaseMailFrom, Common.CommonHandler.BaseHost, Convert.ToInt32(Common.CommonHandler.BasePort), Common.CommonHandler.BaseEnableSSL, Common.CommonHandler.BasePassword, Common.CommonHandler.BaseUserName, "Best regards,<br />##companyName## (##companyEmail##)"); } this.objNewClientEmailTemplateDT = this.objNewClientEmailTemplateBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objNewClientEmailTemplateDT.Rows.Count == 0) { this.objNewClientEmailTemplateBll.AddClientTemplate(int.Parse(this.hfCompanyID.Value), "##companyName## is now invoicing you with Bill Transact", new StringBuilder("Welcome to ##companyName##'s secure online services. An account has been created for you.<br />To securely access your account, go to:<br />##login link##<br />Login using the following username and password:<br />Username: ##username##<br />Password: ##password##<br />").ToString()); } this.objNewCreditEmailTemplateDT = this.objNewCreditEmailTemplateBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objNewCreditEmailTemplateDT.Rows.Count == 0) { this.objNewCreditEmailTemplateBll.AddCreditTemplate(int.Parse(this.hfCompanyID.Value), "New Credit ##creditNumber## from ##companyName## , sent using Bill Transact", new StringBuilder("You have received credit in the amount of ##paymentAmt##. To view it and download a PDF copy for your records, click the link below.<br /><br />##creditLink##<br />").ToString()); } this.objNewEstimateEmailTemplateDT = this.objNewEstimateEmailTemplateBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objNewEstimateEmailTemplateDT.Rows.Count == 0) { this.objNewEstimateEmailTemplateBll.AddEstimateTemplate(int.Parse(this.hfCompanyID.Value), "New Estimate ##estimateNumber## from ##companyName## , sent using Bill Transact", new StringBuilder("To access your estimate from ##companyName## for ##paymentAmt##, go to:<br /><br /> ##estimateLink##<br />").ToString()); } this.objNewInvoiceEmailTemplateDT = this.objNewInvoiceEmailTemplateBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objNewInvoiceEmailTemplateDT.Rows.Count == 0) { this.objNewInvoiceEmailTemplateBll.AddInvoiceTemplate(int.Parse(this.hfCompanyID.Value), "New invoice ##invoiceNumber## from ##companyName## , sent using Bill Transact", new StringBuilder("To view your invoice from ##companyName## for ##invoiceAmt##, or to download a PDF copy for your records, click the link below:<br /><br />##someLink##<br /><br />").ToString()); } this.objNewStaffEmailTemplateDT = this.objNewStaffEmailTemplateBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value)); if (this.objNewStaffEmailTemplateDT.Rows.Count == 0) { this.objNewStaffEmailTemplateBll.AddStaffTemplate(int.Parse(this.hfCompanyID.Value), "##companyName## invites you to track time and expenses in Bill Transact", new StringBuilder("You are now part of ##companyName##'s team.<br />Click here to log in to your account:<br />##login link##<br /><br />Username: ##username##<br />Password: ##password##<br />").ToString()); } this.objNewPaymentEmailTemplateDT = this.objNewPaymentEmailTemplateBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value), "online"); if (this.objNewPaymentEmailTemplateDT.Rows.Count == 0) { this.objNewPaymentEmailTemplateBll.AddPaymentTemplate(int.Parse(this.hfCompanyID.Value), "online", true, "##companyName## has received your payment for invoice ##invoiceNumber## in Bill Transact", new StringBuilder("Thank you for your business.<br />We have received your payment in the amount of ##payment amount## for invoice ##invoice number##.<br />To view the paid invoice or download a PDF copy for your records, click the link below:<br /><br />##someLink##<br />").ToString()); } this.objNewPaymentEmailTemplateDT = this.objNewPaymentEmailTemplateBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value), "other"); if (this.objNewPaymentEmailTemplateDT.Rows.Count == 0) { this.objNewPaymentEmailTemplateBll.AddPaymentTemplate(int.Parse(this.hfCompanyID.Value), "other", false, "##companyName## has received your payment for invoice ##invoiceNumber## in Bill Transact", new StringBuilder("Thank you for your business.<br />We have received your payment in the amount of ##payment amount## for invoice ##invoice number##.<br />To view the paid invoice or download a PDF copy for your records, click the link below:<br /><br />##someLink##<br />").ToString()); } this.objLatePaymentReminderTemplateDT = this.objLatePaymentReminderTemplateBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value), 1); if (this.objLatePaymentReminderTemplateDT.Rows.Count == 0) { this.objLatePaymentReminderTemplateBll.AddLatePaymentReminder(int.Parse(this.hfCompanyID.Value), 1, false, 30, "Your payment for invoice ##invoiceNumber## is overdue in Bill Transact", new StringBuilder("Your invoice is now 30 days overdue. Please pay your invoice.<br /><br />To access your invoice from ##companyName##, go to:<br /><br />##someLink##<br />").ToString()); } this.objLatePaymentReminderTemplateDT = this.objLatePaymentReminderTemplateBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value), 2); if (this.objLatePaymentReminderTemplateDT.Rows.Count == 0) { this.objLatePaymentReminderTemplateBll.AddLatePaymentReminder(int.Parse(this.hfCompanyID.Value), 2, false, 60, "Your payment for invoice ##invoiceNumber## is overdue in Bill Transact", new StringBuilder("Your invoice is now 60 days overdue. Please pay your invoice.<br /><br />To access your invoice from ##companyName##, go to:<br /><br />##someLink##<br />").ToString()); } this.objLatePaymentReminderTemplateDT = this.objLatePaymentReminderTemplateBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value), 3); if (this.objLatePaymentReminderTemplateDT.Rows.Count == 0) { this.objLatePaymentReminderTemplateBll.AddLatePaymentReminder(int.Parse(this.hfCompanyID.Value), 3, false, 90, "Your payment for invoice ##invoiceNumber## is overdue in Bill Transact", new StringBuilder("Your invoice is now 90 days overdue. Please pay your invoice.<br /><br />To access your invoice from ##companyName##, go to:<br /><br />##someLink##<br />").ToString()); } this.objAutoBillEmailTemplateDT = this.objAutoBillEmailTemplateBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value), "Auto-bill"); if (this.objAutoBillEmailTemplateDT.Rows.Count == 0) { this.objAutoBillEmailTemplateBll.AddAutoBillEmail(int.Parse(this.hfCompanyID.Value), "Auto-bill", true, "New recurring invoice ##invoiceNumber## from ##companyName##, sent using Bill Transact", this.strBodyBill.ToString()); } this.objAutoBillEmailTemplateDT = this.objAutoBillEmailTemplateBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value), "Auto-paid"); if (this.objAutoBillEmailTemplateDT.Rows.Count == 0) { this.objAutoBillEmailTemplateBll.AddAutoBillEmail(int.Parse(this.hfCompanyID.Value), "Auto-paid", true, "New recurring invoice ##invoiceNumber## from ##companyName##, sent using Bill Transact", this.strBodyPaid.ToString()); } this.objAutoBillEmailTemplateDT = this.objAutoBillEmailTemplateBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value), "Card Expired"); if (this.objAutoBillEmailTemplateDT.Rows.Count == 0) { this.objAutoBillEmailTemplateBll.AddAutoBillEmail(int.Parse(this.hfCompanyID.Value), "Card Expired", true, "Action required: Your credit card on file with ##companyName## is expiring soon in Bill Transact", this.strBodyExpired.ToString()); } this.objAutoBillEmailTemplateDT = this.objAutoBillEmailTemplateBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value), "Card Failed"); if (this.objAutoBillEmailTemplateDT.Rows.Count != 0) { return; } this.objAutoBillEmailTemplateBll.AddAutoBillEmail(int.Parse(this.hfCompanyID.Value), "Card Failed", false, "Action required: Your credit card on file for invoice ##invoiceNumber## from ##companyName## needs updating in Bill Transact", this.strBodyFailed.ToString()); }
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("importExport")).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; } if (this.Request.QueryString["format"] != null) { switch (this.Request.QueryString["format"]) { case "csv": this.pnlCsv.Visible = true; this.pnlvCard.Visible = false; this.mvCsv.SetActiveView(this.csvFile); break; case "vcard": this.pnlCsv.Visible = false; this.pnlvCard.Visible = true; this.mvvCard.SetActiveView(this.vCardFile); break; default: this.pnlCsv.Visible = false; this.pnlvCard.Visible = false; this.Response.Redirect("ImportCompanyClients.aspx?format=csv"); break; } } else { this.pnlCsv.Visible = false; this.pnlvCard.Visible = false; this.Response.Redirect("ImportCompanyClients.aspx?format=csv"); } }
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("projects")).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.Response.Redirect("~/BillTransact/ProjectMasters.aspx"); this.hfCompanyID.Value = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString(); this.hfStaffID.Value = this.objStaffMasterDT.Rows[0]["StaffID"].ToString(); } } this.SetMiscValues(this.hfCompanyID.Value); } if (this.IsPostBack) { return; } this.divSave.Visible = this.Session["saveProject"] != null; this.divUpdate.Visible = this.Session["updateProject"] != null; this.Session.Abandon(); if (this.Request.QueryString["cmd"] != null) { switch (this.Request.QueryString["cmd"]) { case "view": if (this.Request.QueryString["ID"] == null) { break; } string iD = this.Request.QueryString["ID"]; this.pnlView.Visible = true; this.pnlViewAll.Visible = false; this.pnlAdd.Visible = false; this.ViewRecord(iD); break; case "add": if (this.Request.QueryString["ID"] != null) { this.SetRecord(this.Request.QueryString["ID"]); this.pnlAdd.Visible = true; this.pnlView.Visible = false; this.pnlViewAll.Visible = false; this.btnSubmit.Visible = false; this.btnUpdate.Visible = true; this.txtProjectName.Focus(); break; } this.Clear(); this.txtProjectName.Focus(); this.pnlViewAll.Visible = false; this.pnlAdd.Visible = true; this.pnlView.Visible = false; this.btnUpdate.Visible = false; this.btnSubmit.Visible = true; break; default: this.btnArchived.Visible = !this.CheckARQuery(); this.btnUnArchived.Visible = this.CheckARQuery(); this.btnDelete.Visible = !this.CheckDEQuery(); this.btnUnDelete.Visible = this.CheckDEQuery(); this.ATagStyle(); this.pnlViewAll.Visible = true; this.pnlAdd.Visible = false; this.pnlView.Visible = false; this.BindGrid(); break; } } else { this.btnArchived.Visible = !this.CheckARQuery(); this.btnUnArchived.Visible = this.CheckARQuery(); this.btnDelete.Visible = !this.CheckDEQuery(); this.btnUnDelete.Visible = this.CheckDEQuery(); this.ATagStyle(); this.pnlViewAll.Visible = true; this.pnlAdd.Visible = false; this.pnlView.Visible = false; this.BindGrid(); } }
protected void Page_Load(object sender, EventArgs e) { if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("home")).Attributes.Add("class", "active open"); ((HtmlControl)this.Master.FindControl("doyinGoSupport")).Attributes.Add("class", "active open"); if (this.IsPostBack) { foreach (int num in this.ControlIds) { FileUpload fileUpload = new FileUpload(); fileUpload.ID = "fileUpload" + (object)num; this.divAttach.Controls.Add((Control)fileUpload); this.divAttach.Controls.Add((Control) new LiteralControl("<br />")); } } 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.hfStaffID.Value = this.objStaffMasterDT.Rows[0]["StaffID"].ToString(); } } } if (this.IsPostBack) { return; } this.Session.Abandon(); if (this.Request.QueryString["cmd"] != null) { switch (this.Request.QueryString["cmd"]) { case "view": if (this.Request.QueryString["ID"] == null) { break; } string sId = this.Request.QueryString["ID"]; this.pnlView.Visible = true; this.pnlViewAll.Visible = false; this.pnlAdd.Visible = false; this.ViewRecord(sId); break; case "copied": if (this.Request.QueryString["ID"] == null) { break; } this.SetRecord(this.Request.QueryString["ID"]); this.pnlAdd.Visible = true; this.pnlView.Visible = false; this.pnlViewAll.Visible = false; this.btnSave.Visible = true; this.btnUpdate.Visible = false; this.ddlSupportDepartment.Focus(); break; case "add": if (this.Request.QueryString["ID"] != null) { this.SetRecord(this.Request.QueryString["ID"]); this.pnlAdd.Visible = true; this.pnlView.Visible = false; this.pnlViewAll.Visible = false; this.btnSave.Visible = false; this.btnUpdate.Visible = true; this.ddlSupportDepartment.Focus(); break; } this.Clear(); this.ddlSupportDepartment.Focus(); this.pnlViewAll.Visible = false; this.pnlView.Visible = false; this.pnlAdd.Visible = true; this.btnUpdate.Visible = false; this.btnSave.Visible = true; break; default: this.pnlViewAll.Visible = true; this.pnlView.Visible = false; this.pnlAdd.Visible = false; this.BindGrid(); break; } } else { this.pnlViewAll.Visible = true; this.pnlView.Visible = false; this.pnlAdd.Visible = false; this.BindGrid(); } }
private void BindGrid() { this.lblTeamName.Text = " Whole Team "; string str1 = "All Projects"; string str2 = "All Tasks"; if (this.ddlTeam.SelectedIndex > 0) { this.hfStaffID.Value = this.ddlTeam.SelectedItem.Value; if (this.ddlTeam.SelectedItem.Text.Contains(",")) { this.hfStaffID.Value = this.hfStaffID.Value.Replace("S", ""); this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffID(int.Parse(this.hfStaffID.Value)); if (this.objStaffMasterDT.Rows.Count > 0) { this.hfStaffID.Value = this.objStaffMasterDT.Rows[0]["UserName"].ToString(); this.lblTeamName.Text = (string)this.objStaffMasterDT.Rows[0]["FirstName"] + (object)" " + (string)this.objStaffMasterDT.Rows[0]["LastName"]; } } else { this.hfStaffID.Value = this.hfStaffID.Value.Replace("C", ""); this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(this.hfStaffID.Value)); if (this.objCompanyMasterDT.Rows.Count > 0) { this.hfStaffID.Value = this.objCompanyMasterDT.Rows[0]["CompanyUserName"].ToString(); this.lblTeamName.Text = this.objCompanyMasterDT.Rows[0]["CompanyContactPerson"].ToString(); } } } else { this.hfStaffID.Value = ""; } if (this.ddlProject.SelectedIndex > 0) { this.hfProjectID.Value = this.ddlProject.SelectedItem.Value; str1 = this.ddlProject.SelectedItem.Text; } else { this.hfProjectID.Value = ""; } if (this.ddlTask.SelectedIndex > 0) { this.hfTaskID.Value = this.ddlTask.SelectedItem.Value; str2 = this.ddlTask.SelectedItem.Text; } else { this.hfTaskID.Value = ""; } this.objdsTimesheet.DataBind(); this.gvTimeSheet.DataBind(); this.gridDiv.Visible = this.gvTimeSheet.Rows.Count > 0; this.CountHours(); this.gvTemp.DataBind(); if (this.gvTemp.Rows.Count > 0) { for (int index = 0; index < this.gvTemp.Rows.Count; ++index) { string s1 = DateTime.Parse(this.gvTemp.Rows[index].Cells[1].Text).ToString("dd"); string s2 = DateTime.Parse(this.gvTemp.Rows[index].Cells[1].Text).ToString("MM"); string text = this.gvTemp.Rows[index].Cells[0].Text; this.schedDay[int.Parse(s2), int.Parse(s1)] = text; } } this.lblInformation.Text = this.Calendar1.SelectedDate.ToString("MMMM dd, yyyy") + " - " + str1 + " - " + str2; }