public virtual CloudAccountDA.CompanyClientContactDetailDataTable GetData()
 {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     CloudAccountDA.CompanyClientContactDetailDataTable dataTable = new CloudAccountDA.CompanyClientContactDetailDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MembershipUser user = Membership.GetUser();

            if (user != null)
            {
                this.objClientMasterDT = this.objClientMasterBll.GetDataByUsername(user.ToString());
                if (this.objClientMasterDT.Rows.Count > 0)
                {
                    this.hfClientID.Value  = this.objClientMasterDT.Rows[0]["CompanyClientID"].ToString();
                    this.hfCompanyID.Value = this.objClientMasterDT.Rows[0]["CompanyID"].ToString();
                    this.SetMenu();
                    this.Estimate.Visible = true;
                }
                this.objCompanyClientContactDetailDT = this.objCompanyClientContactDetailBll.GetDataByUsername(user.ToString());
                if (this.objCompanyClientContactDetailDT.Rows.Count > 0)
                {
                    this.hfClientContactID.Value = this.objCompanyClientContactDetailDT.Rows[0]["CompanyClientContactID"].ToString();
                    this.hfClientID.Value        = this.objCompanyClientContactDetailDT.Rows[0]["CompanyClientID"].ToString();
                    this.hfCompanyID.Value       = this.objCompanyClientContactDetailDT.Rows[0]["CompanyID"].ToString();
                    this.SetMenu();
                    this.Estimate.Visible = false;
                }
            }
            if (this.IsPostBack)
            {
                return;
            }
            this.SetCompanyLogo();
        }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         MembershipUser user = Membership.GetUser();
         if (user != null)
         {
             this.objClientMasterDT = this.objClientMasterBll.GetDataByUsername(user.ToString());
             if (this.objClientMasterDT.Rows.Count > 0)
             {
                 query = this.objClientMasterDT.Rows[0]["CompanyID"].ToString();
             }
             else
             {
                 this.objCompanyClientContactDetailDT = this.objCompanyClientContactDetailBll.GetDataByUsername(user.ToString());
                 if (this.objCompanyClientContactDetailDT.Rows.Count > 0)
                 {
                     query = this.objCompanyClientContactDetailDT.Rows[0]["CompanyID"].ToString();
                 }
             }
             SetCompanyLogo(query);
         }
         if (Request.UrlReferrer != null)
         {
             query = HttpUtility.ParseQueryString(Request.UrlReferrer.Query)["Status"];
             if (query.ToLower() == "success")
             {
                 query = HttpUtility.ParseQueryString(Request.UrlReferrer.Query)["OrderNo"];
                 Dbutility dbutility = new Dbutility();
                 query = dbutility.ExecuteQuery("Update InvoiceMaster Set InvoiceStatus='paid' Where OrderNo='" + query + "'");
             }
         }
     }
 }
コード例 #4
0
        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("mainHome")).Attributes.Add("class", "active open");
            MembershipUser user = Membership.GetUser();

            if (user == null)
            {
                return;
            }
            this.objCompanyClientMasterDT = this.objCompanyClientMasterBll.GetDataByUsername(user.ToString());
            if (this.objCompanyClientMasterDT.Rows.Count > 0)
            {
                this.hfClientID.Value   = this.objCompanyClientMasterDT.Rows[0]["CompanyClientID"].ToString();
                this.hfCompanyID.Value  = this.objCompanyClientMasterDT.Rows[0]["CompanyID"].ToString();
                this.lblClientInfo.Text = "Company Client";
            }
            this.objCompanyClientContactDetailDT = this.objCompanyClientContactDetailBll.GetDataByUsername(user.ToString());
            if (this.objCompanyClientContactDetailDT.Rows.Count > 0)
            {
                this.hfClientContactID.Value = this.objCompanyClientContactDetailDT.Rows[0]["CompanyClientContactID"].ToString();
                this.hfClientID.Value        = this.objCompanyClientContactDetailDT.Rows[0]["CompanyClientID"].ToString();
                this.hfCompanyID.Value       = this.objCompanyClientContactDetailDT.Rows[0]["CompanyID"].ToString();
                this.lblClientInfo.Text      = "Company Client Contact";
            }
            this.SetWelcomeMessage(this.hfCompanyID.Value);
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Master == null)
            {
                return;
            }
            ((HtmlControl)this.Master.FindControl("invoice")).Attributes.Add("class", "active open");
            ((HtmlControl)this.Master.FindControl("unpaidInvoice")).Attributes.Add("class", "active open");
            MembershipUser user = Membership.GetUser();

            if (user != null)
            {
                this.objCompanyClientMasterDT = this.objCompanyClientMasterBll.GetDataByUsername(user.ToString());
                if (this.objCompanyClientMasterDT.Rows.Count > 0)
                {
                    this.hfClientID.Value  = this.objCompanyClientMasterDT.Rows[0]["CompanyClientID"].ToString();
                    this.hfCompanyID.Value = this.objCompanyClientMasterDT.Rows[0]["CompanyID"].ToString();
                }
                this.objCompanyClientContactDetailDT = this.objCompanyClientContactDetailBll.GetDataByUsername(user.ToString());
                if (this.objCompanyClientContactDetailDT.Rows.Count > 0)
                {
                    this.hfClientContactID.Value = this.objCompanyClientContactDetailDT.Rows[0]["CompanyClientContactID"].ToString();
                    this.hfClientID.Value        = this.objCompanyClientContactDetailDT.Rows[0]["CompanyClientID"].ToString();
                    this.hfCompanyID.Value       = this.objCompanyClientContactDetailDT.Rows[0]["CompanyID"].ToString();
                }
                this.SetMiscValues(this.hfCompanyID.Value);
            }
            if (this.IsPostBack)
            {
                return;
            }
            this.BindGrid();
        }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Master == null)
            {
                return;
            }
            ((HtmlControl)this.Master.FindControl("Estimate")).Attributes.Add("class", "active open");
            ((HtmlControl)this.Master.FindControl("newEstimate")).Attributes.Add("class", "active open");
            MembershipUser user = Membership.GetUser();

            if (user != null)
            {
                this.objCompanyClientMasterDT = this.objCompanyClientMasterBll.GetDataByUsername(user.ToString());
                if (this.objCompanyClientMasterDT.Rows.Count > 0)
                {
                    this.hfClientID.Value  = this.objCompanyClientMasterDT.Rows[0]["CompanyClientID"].ToString();
                    this.hfCompanyID.Value = this.objCompanyClientMasterDT.Rows[0]["CompanyID"].ToString();
                }
                this.objCompanyClientContactDetailDT = this.objCompanyClientContactDetailBll.GetDataByUsername(user.ToString());
                if (this.objCompanyClientContactDetailDT.Rows.Count > 0)
                {
                    this.hfClientContactID.Value = this.objCompanyClientContactDetailDT.Rows[0]["CompanyClientContactID"].ToString();
                    this.hfClientID.Value        = this.objCompanyClientContactDetailDT.Rows[0]["CompanyClientID"].ToString();
                    this.hfCompanyID.Value       = this.objCompanyClientContactDetailDT.Rows[0]["CompanyID"].ToString();
                }
                this.SetMiscValues(this.hfCompanyID.Value);
            }
            if (this.IsPostBack)
            {
                return;
            }
            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.ViewRecord(id);
                    break;

                default:
                    this.pnlViewAll.Visible = true;
                    this.pnlView.Visible    = false;
                    this.BindGrid();
                    break;
                }
            }
            else
            {
                this.pnlViewAll.Visible = true;
                this.pnlView.Visible    = false;
                this.BindGrid();
            }
        }
コード例 #7
0
        private void ViewClientContactDetails(string cId)
        {
            this.objCompanyClientContactDetailDT = this.objCompanyClientContactDetailBll.GetDataByCompanyClientContactID(int.Parse(cId));
            if (this.objCompanyClientContactDetailDT.Rows.Count <= 0)
            {
                return;
            }
            this.hfClientContactID.Value = this.objCompanyClientContactDetailDT.Rows[0]["CompanyClientContactID"].ToString();
            this.hfClientID.Value        = this.objCompanyClientContactDetailDT.Rows[0]["CompanyClientID"].ToString();
            this.hfCompanyID.Value       = this.objCompanyClientContactDetailDT.Rows[0]["CompanyID"].ToString();
            this.txtEmail.Text           = this.objCompanyClientContactDetailDT.Rows[0]["Email"].ToString();
            this.txtFirstName.Text       = this.objCompanyClientContactDetailDT.Rows[0]["FirstName"].ToString();
            this.txtLastName.Text        = this.objCompanyClientContactDetailDT.Rows[0]["LastName"].ToString();
            this.txtHomePhone.Text       = this.objCompanyClientContactDetailDT.Rows[0]["HomePhone"].ToString();
            this.txtMobile.Text          = this.objCompanyClientContactDetailDT.Rows[0]["Mobile"].ToString();
            this.txtUsername.Text        = this.objCompanyClientContactDetailDT.Rows[0]["UserName"].ToString();
            MembershipUser user = Membership.GetUser(this.txtUsername.Text);

            if (user != null)
            {
                this.lblPasswordAdd.Text = user.GetPassword();
            }
            this.txtUsername.Enabled = false;
            this.txtEmail.Enabled    = false;
        }
 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 virtual int Fill(CloudAccountDA.CompanyClientContactDetailDataTable dataTable)
 {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if (this.ClearBeforeFill)
     {
         dataTable.Clear();
     }
     return(this.Adapter.Fill(dataTable));
 }
コード例 #10
0
 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));
 }
 public virtual CloudAccountDA.CompanyClientContactDetailDataTable DeleteByCompanyID(int?CompanyID)
 {
     this.Adapter.SelectCommand = this.CommandCollection[2];
     if (CompanyID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = CompanyID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     CloudAccountDA.CompanyClientContactDetailDataTable dataTable = new CloudAccountDA.CompanyClientContactDetailDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
 public virtual CloudAccountDA.CompanyClientContactDetailDataTable GetDataByUsername(string Username)
 {
     this.Adapter.SelectCommand = this.CommandCollection[7];
     if (Username == null)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = Username;
     }
     CloudAccountDA.CompanyClientContactDetailDataTable dataTable = new CloudAccountDA.CompanyClientContactDetailDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
コード例 #13
0
        protected string SetName(string id, string role)
        {
            switch (role)
            {
            case "Company":
                this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(id));
                return(this.objCompanyMasterDT.Rows[0]["CompanyContactPerson"].ToString());

            case "CompanyClientContact":
                this.objCompanyClientContactDetailDT = this.objCompanyClientContactDetailBll.GetDataByCompanyClientContactID(int.Parse(id));
                return((string)this.objCompanyClientContactDetailDT.Rows[0]["FirstName"] + (object)" " + (string)this.objCompanyClientContactDetailDT.Rows[0]["LastName"]);

            case "CompanyClient":
                this.objCompanyClientMasterDT = this.objCompanyClientMasterBll.GetDataByCompanyClientID(int.Parse(id));
                return((string)this.objCompanyClientMasterDT.Rows[0]["FirstName"] + (object)" " + (string)this.objCompanyClientMasterDT.Rows[0]["LastName"]);

            default:
                return(string.Empty);
            }
        }
コード例 #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objDbutility = new Dbutility();

            if (this.Master == null)
            {
                return;
            }
            ((HtmlControl)this.Master.FindControl("clientProfile")).Attributes.Add("style", "background-color: lightgray;");
            MembershipUser user = Membership.GetUser();

            if (user != null)
            {
                this.objCompanyClientMasterDT = this.objCompanyClientMasterBll.GetDataByUsername(user.ToString());
                if (this.objCompanyClientMasterDT.Rows.Count > 0)
                {
                    this.hfClientID.Value     = this.objCompanyClientMasterDT.Rows[0]["CompanyClientID"].ToString();
                    this.hfCompanyID.Value    = this.objCompanyClientMasterDT.Rows[0]["CompanyID"].ToString();
                    this.pnlAddClient.Visible = true;
                    this.ViewClientDetails(this.hfClientID.Value);
                }
                this.objCompanyClientContactDetailDT = this.objCompanyClientContactDetailBll.GetDataByUsername(user.ToString());
                if (this.objCompanyClientContactDetailDT.Rows.Count > 0)
                {
                    this.hfClientContactID.Value = this.objCompanyClientContactDetailDT.Rows[0]["CompanyClientContactID"].ToString();
                    this.hfClientID.Value        = this.objCompanyClientContactDetailDT.Rows[0]["CompanyClientID"].ToString();
                    this.hfCompanyID.Value       = this.objCompanyClientContactDetailDT.Rows[0]["CompanyID"].ToString();
                    this.pnlAddClient.Visible    = false;
                    this.ViewClientContactDetails(this.hfClientContactID.Value);
                }
            }
            if (this.IsPostBack)
            {
                return;
            }
            this.divUpdate.Visible        = this.Session["updateProfile"] != null;
            this.Session["updateProfile"] = (object)null;
            this.Session.Abandon();
        }
 public virtual CloudAccountDA.CompanyClientContactDetailDataTable GetDataByCompanyIDAndEmail(int?CompanyID, string Email)
 {
     this.Adapter.SelectCommand = this.CommandCollection[6];
     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.CompanyClientContactDetailDataTable dataTable = new CloudAccountDA.CompanyClientContactDetailDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
 public virtual int Update(CloudAccountDA.CompanyClientContactDetailDataTable dataTable)
 {
     return(this.Adapter.Update(dataTable));
 }
コード例 #17
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (this.pnlAddClient.Visible)
     {
         try
         {
             if (!this.Page.IsValid)
             {
                 return;
             }
             if (this.txtEmail.Text.Trim().Length > 0)
             {
                 int?iCountryID          = new int?();
                 int?iStateID            = new int?();
                 int?iCityID             = new int?();
                 int?iSecondaryCountryID = new int?();
                 int?iSecondaryStateID   = new int?();
                 int?iSecondaryCityID    = new int?();
                 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));
                 }
                 if (this.ddlCountrySecondary.SelectedIndex > 0)
                 {
                     iSecondaryCountryID = new int?(int.Parse(this.ddlCountrySecondary.SelectedItem.Value));
                 }
                 if (this.ddlStateSecondary.SelectedIndex > 0)
                 {
                     iSecondaryStateID = new int?(int.Parse(this.ddlStateSecondary.SelectedItem.Value));
                 }
                 if (this.ddlCitySecondary.SelectedIndex > 0)
                 {
                     iSecondaryCityID = new int?(int.Parse(this.ddlCitySecondary.SelectedItem.Value));
                 }
                 if (this.txtNewPassword.Text.Trim().Length >= 4)
                 {
                     if (this.txtNewPassword.Text.Trim() == this.txtConfPassword.Text.Trim())
                     {
                         MembershipUser user = Membership.GetUser(this.txtUsername.Text);
                         if (user != null)
                         {
                             user.ChangePassword(this.lblPasswordAdd.Text.Trim(), this.txtNewPassword.Text.Trim());
                             this.lblPasswordAdd.Text = this.txtNewPassword.Text.Trim();
                             Membership.UpdateUser(user);
                         }
                     }
                     else
                     {
                         this.DisplayAlert("Password & confirm password not match");
                     }
                 }
                 if (this.objCompanyClientMasterBll.UpdateClientProfile(int.Parse(this.hfClientID.Value), int.Parse(this.hfCompanyID.Value), this.txtEmail.Text, this.txtFirstName.Text.Trim(), this.txtLastName.Text.Trim(), this.txtHomePhone.Text.Trim(), this.txtMobile.Text.Trim(), this.txtUsername.Text.Trim(), this.txtAddress1.Text.Trim(), this.txtAddress2.Text.Trim(), iCountryID, iStateID, iCityID, this.txtZipCode.Text.Trim(), this.txtAddress1Secondary.Text.Trim(), this.txtAddress2Secondary.Text.Trim(), iSecondaryCountryID, iSecondaryStateID, iSecondaryCityID, this.txtZipCodeSecondary.Text.Trim(), this.txtBussinessPhone.Text.Trim(), this.txtFax.Text.Trim()))
                 {
                     this.Session["updateProfile"] = (object)1;
                     this.DisplayAlert("Profile is updated successfully");
                     this.Response.Redirect("~/Client/ClientProfile.aspx");
                 }
                 else
                 {
                     this.DisplayAlert("Some error occured while updating your profile please try after sometime..!");
                 }
             }
             else
             {
                 this.DisplayAlert("Fill All Required Feilds");
             }
         }
         catch (Exception ex)
         {
             this.DisplayAlert(ex.Message);
         }
     }
     else
     {
         try
         {
             if (!this.Page.IsValid)
             {
                 return;
             }
             if (this.txtEmail.Text.Trim().Length > 0)
             {
                 if (this.txtNewPassword.Text.Trim().Length >= 4)
                 {
                     if (this.txtNewPassword.Text.Trim() == this.txtConfPassword.Text.Trim())
                     {
                         MembershipUser user = Membership.GetUser(this.txtUsername.Text);
                         if (user != null)
                         {
                             user.ChangePassword(this.lblPasswordAdd.Text.Trim(), this.txtNewPassword.Text.Trim());
                             this.lblPasswordAdd.Text = this.txtNewPassword.Text.Trim();
                             Membership.UpdateUser(user);
                         }
                     }
                     else
                     {
                         this.DisplayAlert("Password & confirm password not match");
                     }
                 }
                 this.objCompanyClientContactDetailDT = this.objCompanyClientContactDetailBll.GetDataByCompanyClientContactID(int.Parse(this.hfClientContactID.Value));
                 if (this.objCompanyClientContactDetailBll.UpdateCompanyClientContact(int.Parse(this.hfClientContactID.Value), int.Parse(this.hfCompanyID.Value), int.Parse(this.hfClientID.Value), this.txtEmail.Text.Trim(), this.txtFirstName.Text.Trim(), this.txtLastName.Text.Trim(), this.txtHomePhone.Text.Trim(), this.txtMobile.Text.Trim(), bool.Parse(this.objCompanyClientContactDetailDT.Rows[0]["LoginCredentials"].ToString()), this.txtUsername.Text.Trim(), bool.Parse(this.objCompanyClientContactDetailDT.Rows[0]["LoginInfoSent"].ToString())))
                 {
                     this.Session["updateProfile"] = (object)1;
                     this.DisplayAlert("Profile is updated successfully");
                     this.Response.Redirect("~/Client/ClientProfile.aspx");
                 }
                 else
                 {
                     this.DisplayAlert("Some error occured while updating your profile please try after sometime..!");
                 }
             }
             else
             {
                 this.DisplayAlert("Fill All Required Feilds");
             }
         }
         catch (Exception ex)
         {
             this.DisplayAlert(ex.Message);
         }
     }
 }