Exemple #1
0
        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 now = DateTime.Now;

            this.txtDateFrom.Text = now.AddDays(-30.0).ToString(this.dateFormat);
            this.txtDateTo.Text   = now.ToString(this.dateFormat);
            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.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)
        {
            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)
        {
            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();
        }
Exemple #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        currentUser = Membership.GetUser(); //get current user that is logged in
        string userName = currentUser.ToString();

        lblUserName.Text       = userName;
        lblUserName.Visible    = false;
        lblDescription.Visible = false;

        LinkBtnMerit.Visible = false;
        //hide report and data list on load page
        CrystalReportViewerMerit.Visible = false;

        if (IsPostBack)
        {
            lblDescription.Text    = "Table below shows the merit bonus for your department members.";
            GridViewMerit.Visible  = true;
            lblDescription.Visible = true;

            LinkBtnMerit.Visible = true;
        }
    }
        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)
        {
            MembershipUser user = Membership.GetUser();

            if (user != null)
            {
                string str = user.ToString();
                if (Roles.IsUserInRole(str, "Accountant"))
                {
                    this._objAccountantMasterDt = this._objAccountantMasterBll.GetDataByAccountantEmail(str);
                    if (this._objAccountantMasterDt.Rows.Count > 0)
                    {
                        this.hfAccountantID.Value = this._objAccountantMasterDt.Rows[0]["AccountantID"].ToString();
                    }
                }
            }
            if (this.Request.QueryString["cmdId"] != null && this.Request.QueryString["Dated"] != null && this.Request.QueryString["addClient"] != null)
            {
                this.AddClientToAccountant();
            }
            this.SetSomeRecords();
        }
Exemple #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MembershipUser user = Membership.GetUser();

            if (user != null)
            {
                string str = user.ToString();
                if (Roles.IsUserInRole(str, "Accountant"))
                {
                    this.objAccountantMasterDT = this.objAccountantMasterBll.GetDataByAccountantEmail(str);
                    if (this.objAccountantMasterDT.Rows.Count > 0)
                    {
                        this.hfAccountantID.Value = this.objAccountantMasterDT.Rows[0]["AccountantID"].ToString();
                    }
                }
            }
            if (this.IsPostBack)
            {
                return;
            }
            this.ViewRecord();
        }
Exemple #9
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);
        }
Exemple #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Check that query isn't NULL  and DYNAMIC TITLE
        string qstr = Request.QueryString["user"];

        if (qstr == null)
        {
            Response.Redirect("~/404.aspx");
        }
        else
        {
            Page.Title = "PhotoSave / " + qstr + "'s profile";
        }



        MembershipUser currentUser   = Membership.GetUser();
        Guid           currentUserId = (Guid)currentUser.ProviderUserKey;


        //Check is user is already following
        string profileName = qstr;

        if (profileName != currentUser.ToString())
        {
            int folowedOrNot = Checks.checkIfFollowing(profileName);
            if (folowedOrNot >= 1)
            {
                BtnFollow.Enabled = false;
                BtnFollow.Text    = "Following";
            }
        }
        else
        {
            BtnFollow.Enabled = false;
            BtnFollow.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");
        }
Exemple #12
0
        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;
        }
Exemple #13
0
        private void AddUserToStatusChangeCheck(MembershipUser user)
        {
            var sql = "INSERT INTO RTAUserStatusChange ([User]) VALUES(@User)";

            using (
                var con =
                    new SqlConnection(
                        ConfigurationManager.ConnectionStrings["RTATipData"].ConnectionString))
            {
                try
                {
                    con.Open();
                    var command = new SqlCommand(sql, con);
                    command.Parameters.AddWithValue("@User", user.ToString().ToLower());
                    var res = command.ExecuteScalar();
                }
                catch (Exception exception)
                {
                    Console.WriteLine(exception.ToString());
                    throw new ArgumentNullException();
                }
            }
        }
Exemple #14
0
    //Check is user is already following


    public static int checkIfFollowing(object sesProfileName)
    {
        MembershipUser currentUser   = Membership.GetUser();
        Guid           currentUserId = (Guid)currentUser.ProviderUserKey;

        int FollowedOrNot;

        string ConString = getConnectionString();

        string SelectSqlCheckIfFollowed = "SELECT COUNT(FollowsId) FROM Cus_Followers2 WHERE FProfileName=@FProfileName AND ProfileName=@ProfileName";

        using (SqlConnection myConnection = new SqlConnection(ConString))
        {
            myConnection.Open();

            SqlCommand CheckIfFollowed = new SqlCommand(SelectSqlCheckIfFollowed, myConnection);


            CheckIfFollowed.Parameters.AddWithValue("@ProfileName", currentUser.ToString());
            CheckIfFollowed.Parameters.AddWithValue("@FProfileName", sesProfileName);
            FollowedOrNot = Convert.ToInt32(CheckIfFollowed.ExecuteScalar());
        }
        return(FollowedOrNot);
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         //System.Web.Security.Membership.GetUser().P
         MembershipUser user = System.Web.Security.Membership.GetUser();
         if (user != null)
         {
             string username = user.ToString();
             if (!Roles.IsUserInRole(username, "Admin"))
             {
                 Response.Redirect("Home.aspx");
             }
         }
         else
         {
             Response.Redirect("Home.aspx");
         }
     }
     catch (Exception err)
     {
         Response.Write(err);
     }
 }
        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();
        }
Exemple #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Master == null)
            {
                return;
            }
            ((HtmlControl)this.Master.FindControl("companyManagement")).Attributes.Add("class", "active open");
            ((HtmlControl)this.Master.FindControl("companyPackageInfo")).Attributes.Add("class", "active open");
            if (this.IsPostBack)
            {
                return;
            }
            if (Admin.RoleName != null)
            {
                MembershipUser user = Membership.GetUser();
                if (Admin.RoleName == "SuperAdmin")
                {
                    CompanyPackageInfo.ViewStatus = "True";
                    CompanyPackageInfo.AddStatus  = "True";
                }
                else if (Admin.RoleName == "MasterAdmin")
                {
                    if (user != null)
                    {
                        string str = user.ToString();
                        if (Roles.IsUserInRole(str, "MasterAdmin"))
                        {
                            this.objMasterAdminLoginMasterDT = this.objMasterAdminLoginMasterBll.GetDataByUserName(str);
                            if (this.objMasterAdminLoginMasterDT.Rows.Count > 0)
                            {
                                this.hfMasterAdminID.Value = this.objMasterAdminLoginMasterDT.Rows[0]["MasterAdminUserID"].ToString();
                            }
                        }
                    }
                    this.objMasterAdminRightsMasterDT = this.objMasterAdminRightsMasterBll.GetDataByViewPageRights(int.Parse(this.hfMasterAdminID.Value.Trim()), "CompanyPackageInfo");
                    CompanyPackageInfo.ViewStatus     = this.objMasterAdminRightsMasterDT.Rows.Count > 0 ? this.objMasterAdminRightsMasterDT.Rows[0]["ViewMode"].ToString() : "";
                    CompanyPackageInfo.AddStatus      = this.objMasterAdminRightsMasterDT.Rows.Count > 0 ? this.objMasterAdminRightsMasterDT.Rows[0]["AddMode"].ToString() : "";
                }
                else
                {
                    CompanyPackageInfo.ViewStatus = "";
                    CompanyPackageInfo.AddStatus  = "";
                }
            }
            if (CompanyPackageInfo.ViewStatus == "True")
            {
                if (this.Request.QueryString["cmd"] != null)
                {
                    switch (this.Request.QueryString["cmd"])
                    {
                    case "view":
                        if (this.Request.QueryString["ID"] == null || !(CompanyPackageInfo.ViewStatus == "True"))
                        {
                            break;
                        }
                        this.hfCompanyID.Value  = this.Request.QueryString["ID"];
                        this.pnlAdd.Visible     = false;
                        this.pnlViewAll.Visible = false;
                        this.pnlView.Visible    = true;
                        this.btnList.Visible    = true;
                        this.dlCompanyPackage.DataBind();
                        break;

                    case "add":
                        if (this.Request.QueryString["ID"] == null || !(CompanyPackageInfo.AddStatus == "True"))
                        {
                            break;
                        }
                        this.hfCompanyID.Value        = this.Request.QueryString["ID"];
                        this.pnlViewAll.Visible       = false;
                        this.pnlView.Visible          = false;
                        this.pnlAdd.Visible           = true;
                        this.ddlCompany.SelectedValue = this.hfCompanyID.Value;
                        if (string.IsNullOrEmpty(this.ddlCompany.SelectedValue))
                        {
                            this.Response.Redirect("CompanyPackageInfo.aspx");
                        }
                        this.ddlPackage.Focus();
                        break;

                    default:
                        this.BindGrid();
                        this.pnlViewAll.Visible = true;
                        this.pnlView.Visible    = false;
                        this.pnlAdd.Visible     = false;
                        break;
                    }
                }
                else
                {
                    this.BindGrid();
                    this.pnlViewAll.Visible = true;
                    this.pnlView.Visible    = false;
                    this.pnlAdd.Visible     = false;
                }
            }
            else
            {
                this.pnlViewAll.Visible = false;
                this.pnlView.Visible    = false;
                this.pnlAdd.Visible     = false;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Page.MaintainScrollPositionOnPostBack = true;
            if (this.Master == null)
            {
                return;
            }
            ((HtmlControl)this.Master.FindControl("Estimate")).Attributes.Add("class", "active open");
            ((HtmlControl)this.Master.FindControl("receivedEstimate")).Attributes.Add("class", "active open");
            MembershipUser user = Membership.GetUser();

            if (user != null)
            {
                string username = user.ToString();
                if (Roles.IsUserInRole(username, "Admin"))
                {
                    this.hfCompanyEmail.Value = username;
                }
            }
            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.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.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.pnlView.Visible    = false;
                this.BindGrid();
            }
        }
Exemple #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Master == null)
            {
                return;
            }
            ((HtmlControl)this.Master.FindControl("generalMaster")).Attributes.Add("class", "active open");
            ((HtmlControl)this.Master.FindControl("bussiness")).Attributes.Add("class", "active open");
            if (this.IsPostBack)
            {
                return;
            }
            if (Admin.RoleName != null)
            {
                MembershipUser user = Membership.GetUser();
                if (Admin.RoleName == "SuperAdmin")
                {
                    BussinessMaster.AddStatus    = "True";
                    BussinessMaster.EditStatus   = "True";
                    BussinessMaster.ViewStatus   = "True";
                    BussinessMaster.DeleteStatus = "True";
                }
                else if (Admin.RoleName == "MasterAdmin")
                {
                    if (user != null)
                    {
                        string str = user.ToString();
                        if (Roles.IsUserInRole(str, "MasterAdmin"))
                        {
                            this.objMasterAdminLoginMasterDT = this.objMasterAdminLoginMasterBll.GetDataByUserName(str);
                            if (this.objMasterAdminLoginMasterDT.Rows.Count > 0)
                            {
                                this.hfMasterAdminID.Value = this.objMasterAdminLoginMasterDT.Rows[0]["MasterAdminUserID"].ToString();
                            }
                        }
                    }
                    this.objMasterAdminRightsMasterDT = this.objMasterAdminRightsMasterBll.GetDataByViewPageRights(int.Parse(this.hfMasterAdminID.Value.Trim()), "BussinessMaster");
                    if (this.objMasterAdminRightsMasterDT.Rows.Count > 0)
                    {
                        BussinessMaster.AddStatus    = this.objMasterAdminRightsMasterDT.Rows[0]["AddMode"].ToString();
                        BussinessMaster.EditStatus   = this.objMasterAdminRightsMasterDT.Rows[0]["EditMode"].ToString();
                        BussinessMaster.ViewStatus   = this.objMasterAdminRightsMasterDT.Rows[0]["ViewMode"].ToString();
                        BussinessMaster.DeleteStatus = this.objMasterAdminRightsMasterDT.Rows[0]["DeleteMode"].ToString();
                    }
                    else
                    {
                        BussinessMaster.AddStatus    = "";
                        BussinessMaster.EditStatus   = "";
                        BussinessMaster.ViewStatus   = "";
                        BussinessMaster.DeleteStatus = "";
                    }
                }
                else if (Admin.RoleName == "Admin")
                {
                    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.hfCompanyLoginID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyLoginID"].ToString();
                            }
                        }
                    }
                    this.objCompanyAdminRightsMasterDT = this.objCompanyAdminRightsMasterBll.GetDataByViewPageRights(int.Parse(this.hfCompanyID.Value.Trim()), int.Parse(this.hfCompanyLoginID.Value.Trim()), "BussinessMaster");
                    if (this.objCompanyAdminRightsMasterDT.Rows.Count > 0)
                    {
                        BussinessMaster.AddStatus    = this.objCompanyAdminRightsMasterDT.Rows[0]["AddMode"].ToString();
                        BussinessMaster.EditStatus   = this.objCompanyAdminRightsMasterDT.Rows[0]["EditMode"].ToString();
                        BussinessMaster.ViewStatus   = this.objCompanyAdminRightsMasterDT.Rows[0]["ViewMode"].ToString();
                        BussinessMaster.DeleteStatus = this.objCompanyAdminRightsMasterDT.Rows[0]["DeleteMode"].ToString();
                    }
                    else
                    {
                        BussinessMaster.AddStatus    = "";
                        BussinessMaster.EditStatus   = "";
                        BussinessMaster.ViewStatus   = "";
                        BussinessMaster.DeleteStatus = "";
                    }
                }
                else
                {
                    BussinessMaster.AddStatus    = "";
                    BussinessMaster.EditStatus   = "";
                    BussinessMaster.ViewStatus   = "";
                    BussinessMaster.DeleteStatus = "";
                }
            }
            if (BussinessMaster.ViewStatus == "True")
            {
                if (this.Request.QueryString["cmd"] != null)
                {
                    switch (this.Request.QueryString["cmd"])
                    {
                    case "view":
                        if (this.Request.QueryString["ID"] == null || !(BussinessMaster.ViewStatus == "True"))
                        {
                            break;
                        }
                        string i = this.Request.QueryString["ID"];
                        this.pnlViewAll.Visible = false;
                        this.pnlAdd.Visible     = false;
                        this.pnlView.Visible    = true;
                        this.ViewRecord(i);
                        this.btnEdit.Visible         = BussinessMaster.EditStatus == "True";
                        this.btnAddBussiness.Visible = this.btnAdd.Visible = BussinessMaster.AddStatus == "True";
                        this.btnDelete.Visible       = BussinessMaster.DeleteStatus == "True";
                        this.btnListAll.Visible      = true;
                        this.btnUpdate.Visible       = false;
                        this.btnCancel.Visible       = false;
                        break;

                    case "add":
                        if (this.Request.QueryString["ID"] != null)
                        {
                            if (!(BussinessMaster.EditStatus == "True"))
                            {
                                break;
                            }
                            this.SetRecord(this.Request.QueryString["ID"]);
                            this.pnlAdd.Visible     = true;
                            this.pnlViewAll.Visible = false;
                            this.pnlView.Visible    = false;
                            this.btnUpdate.Visible  = true;
                            this.btnCancel.Visible  = true;
                            this.btnSubmit.Visible  = false;
                            this.btnReset.Visible   = false;
                            break;
                        }
                        if (!(BussinessMaster.AddStatus == "True"))
                        {
                            break;
                        }
                        this.Clear();
                        this.btnSubmit.Visible  = true;
                        this.btnReset.Visible   = true;
                        this.btnUpdate.Visible  = false;
                        this.btnCancel.Visible  = false;
                        this.pnlAdd.Visible     = true;
                        this.pnlViewAll.Visible = false;
                        this.pnlView.Visible    = false;
                        break;

                    default:
                        this.BindGrid();
                        this.pnlViewAll.Visible = true;
                        this.pnlView.Visible    = false;
                        this.pnlAdd.Visible     = false;
                        break;
                    }
                }
                else
                {
                    this.BindGrid();
                    this.pnlViewAll.Visible = true;
                    this.pnlView.Visible    = false;
                    this.pnlAdd.Visible     = false;
                    if (BussinessMaster.AddStatus == "False")
                    {
                        this.btnAddBussiness.Visible = this.btnAdd.Visible = false;
                    }
                    else
                    {
                        this.btnAddBussiness.Visible = this.btnAdd.Visible = true;
                    }
                }
            }
            else if (BussinessMaster.AddStatus == "True" && BussinessMaster.EditStatus == "False" && (BussinessMaster.ViewStatus == "False" && BussinessMaster.DeleteStatus == "False"))
            {
                this.pnlAdd.Visible     = true;
                this.btnUpdate.Visible  = false;
                this.btnCancel.Visible  = false;
                this.pnlViewAll.Visible = false;
                this.pnlView.Visible    = false;
            }
            else
            {
                this.pnlViewAll.Visible = false;
                this.pnlView.Visible    = false;
                this.pnlAdd.Visible     = false;
            }
        }
Exemple #20
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 + "'");
             }
         }
     }
 }
Exemple #21
0
        private void SetCompanyLogo()
        {
            MembershipUser user = Membership.GetUser();

            if (user != null)
            {
                string str1 = user.ToString();
                if (Roles.IsUserInRole(str1, "Admin"))
                {
                    this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str1);
                    if (this.objCompanyLoginMasterDT.Rows.Count > 0)
                    {
                        string str2 = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString();
                        this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString();
                        this.imgLogo.ImageUrl  = "../Handler/CompanyLogoFile.ashx?id=" + str2;
                    }
                }
                else if (Roles.IsUserInRole(str1, "Employee"))
                {
                    this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffUserName(str1);
                    if (this.objStaffMasterDT.Rows.Count > 0)
                    {
                        string str2 = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString();
                        this.hfCompanyID.Value = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString();
                        this.imgLogo.ImageUrl  = "../Handler/CompanyLogoFile.ashx?id=" + str2;
                    }
                }
                else
                {
                    this.imgLogo.ImageUrl = "../App_Themes/sky/uploads/logo.png";
                }
                if (this.hfCompanyID.Value.ToString() != "")
                {
                    this.objCompanyPackageMasterDT = this.objCompanyPackageMasterBll.GetDataByCompanyActivePackage(int.Parse(this.hfCompanyID.Value));
                }
                if (this.objCompanyPackageMasterDT.Rows.Count <= 0)
                {
                    return;
                }
                string s = this.objCompanyPackageMasterDT.Rows[0]["CloudPackageID"].ToString();
                if (s == "0")
                {
                    this.lblPackageName.Text = "Free Trial";
                }
                else
                {
                    this.objCloudPackageMasterDT = this.objCloudPackageMasterBll.GetDataByCloudPackageID(int.Parse(s));
                    if (this.objCloudPackageMasterDT.Rows.Count > 0)
                    {
                        this.lblPackageName.Text = this.objCloudPackageMasterDT.Rows[0]["CloudPackageName"].ToString() + " Package";
                    }
                }
                TimeSpan timeSpan = DateTime.Parse(DateTime.Parse(this.objCompanyPackageMasterDT.Rows[0]["PackageEndDate"].ToString()).ToShortDateString()) - DateTime.Parse(DateTime.UtcNow.ToShortDateString());
                if (timeSpan.TotalDays <= 0.0)
                {
                    this.Response.Redirect("UpgradePackage.aspx");
                }
                else
                {
                    this.lblDays.Text = timeSpan.TotalDays.ToString((IFormatProvider)CultureInfo.InvariantCulture);
                }
            }
            else
            {
                this.imgLogo.ImageUrl = "../App_Themes/sky/uploads/logo.png";
                this.LoginStatus1_OnLoggingOut((object)null, (LoginCancelEventArgs)null);
            }
        }
        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();
            }
        }
Exemple #23
0
        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");
            }
        }
Exemple #24
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("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();
            }
        }
        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();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            txtAboutDoyingo.Text = ddlAboutDoyingo.SelectedItem.Text;
            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");
            if (!this.IsPostBack)
            {
                if (this.Application["companyName"] != null && this.Application["emailAddress"] != null && (!string.IsNullOrEmpty(this.Application["companyName"].ToString()) && !string.IsNullOrEmpty(this.Application["emailAddress"].ToString())))
                {
                    this.txtUsername.Text = this.Application["emailAddress"].ToString();
                    this.mpUserData.Show();
                }
                MembershipUser user = Membership.GetUser();
                if (user != null)
                {
                    string username = user.ToString();
                    if (Roles.IsUserInRole(username, "Admin"))
                    {
                        Doyingo.RoleName = "Admin";
                    }
                    else if (Roles.IsUserInRole(username, "Employee"))
                    {
                        Doyingo.RoleName = "Employee";
                    }
                }
                if (Doyingo.RoleName != null)
                {
                    switch (Doyingo.RoleName)
                    {
                    case "MasterAdmin":
                        this.pnlMasterAdmin.Visible  = true;
                        this.pnlCompanyAdmin.Visible = false;
                        this.pnlEmployee.Visible     = false;
                        this.lblRole.Text            = "Master Admin";
                        this.Page.Title = "Master Admin Panel";
                        break;

                    case "Admin":
                        this.pnlMasterAdmin.Visible  = false;
                        this.pnlCompanyAdmin.Visible = true;
                        this.pnlEmployee.Visible     = false;
                        this.lblRole.Text            = " [Company Admin]";
                        this.Page.Title = "Company Admin Panel";
                        break;

                    case "Employee":
                        this.pnlMasterAdmin.Visible  = false;
                        this.pnlCompanyAdmin.Visible = false;
                        this.pnlEmployee.Visible     = true;
                        this.lblRole.Text            = " [Staff]";
                        this.Page.Title = "Staff Panel";
                        this.SetWelcomeMessage();
                        break;
                    }
                }
                else
                {
                    this.pnlMasterAdmin.Visible  = false;
                    this.pnlCompanyAdmin.Visible = false;
                    this.pnlEmployee.Visible     = false;
                }
            }
            if (this.Request.QueryString["accId"] != null && this.Request.QueryString["Dated"] != null && this.Request.QueryString["add"] != null)
            {
                this.AddAccountantToClient();
            }
            if (this.Request.QueryString["re"] == null)
            {
                return;
            }
            this.SetNewDefaultValues();
            this.Response.Redirect("DefaultDoyingo.aspx");
        }
        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());
        }
Exemple #28
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();
            }
        }
Exemple #29
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();
        }
Exemple #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Master == null)
            {
                return;
            }
            ((HtmlControl)this.Master.FindControl("companyManagement")).Attributes.Add("class", "active open");
            ((HtmlControl)this.Master.FindControl("companyRightsMaster")).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();
                    }
                }
            }
            if (this.Request.QueryString["cmd"] != null)
            {
                switch (this.Request.QueryString["cmd"])
                {
                case "view":
                    if (this.Request.QueryString["ID"] == null || this.Request.QueryString["CompanyAdminID"] == null)
                    {
                        break;
                    }
                    CompanyAdminRightsMaster.CompanyID      = this.Request.QueryString["ID"];
                    CompanyAdminRightsMaster.CompanyAdminID = this.Request.QueryString["CompanyAdminID"];
                    CompanyAdminRightsMaster.AddMode        = "Edit";
                    this.gridPanel.Visible = false;
                    this.addPanel.Visible  = true;
                    if (this.Request.QueryString["ModuleID"] != null)
                    {
                        CompanyAdminRightsMaster.CompanyAdminID = this.Request.QueryString["CompanyAdminID"];
                        CompanyAdminRightsMaster.ModuleID       = this.Request.QueryString["ModuleID"];
                        this.BindDropCompanyAdminGrid();
                        this.SetRecord(CompanyAdminRightsMaster.CompanyID, CompanyAdminRightsMaster.CompanyAdminID, CompanyAdminRightsMaster.ModuleID);
                    }
                    else
                    {
                        this.BindDropCompanyAdminGrid();
                        this.ViewRecord(CompanyAdminRightsMaster.CompanyID, CompanyAdminRightsMaster.CompanyAdminID);
                    }
                    this.ddlCompanyAdmin.Enabled = false;
                    this.btnListAll.Visible      = true;
                    this.btnSubmit.Visible       = false;
                    this.btnReset.Visible        = false;
                    this.btnUpdate.Visible       = false;
                    this.btnCancel.Visible       = false;
                    break;

                case "add":
                    if (this.Request.QueryString["ID"] != null && this.Request.QueryString["CompanyAdminID"] != null && this.Request.QueryString["ModuleID"] != null)
                    {
                        CompanyAdminRightsMaster.CompanyID      = this.Request.QueryString["ID"];
                        CompanyAdminRightsMaster.CompanyAdminID = this.Request.QueryString["CompanyAdminID"];
                        CompanyAdminRightsMaster.ModuleID       = this.Request.QueryString["ModuleID"];
                        this.BindDropCompanyAdminGrid();
                        CompanyAdminRightsMaster.AddMode = "Add";
                        this.SetRecord(CompanyAdminRightsMaster.CompanyID, CompanyAdminRightsMaster.CompanyAdminID, CompanyAdminRightsMaster.ModuleID);
                        this.addPanel.Visible        = true;
                        this.gridPanel.Visible       = false;
                        this.ddlCompanyAdmin.Enabled = false;
                        this.ddlModule.Enabled       = false;
                        this.btnUpdate.Visible       = true;
                        this.btnCancel.Visible       = true;
                        this.btnEdit.Visible         = false;
                        this.btnListAll.Visible      = false;
                        this.btnSubmit.Visible       = false;
                        this.btnReset.Visible        = false;
                        break;
                    }
                    this.SubBindGrid();
                    this.BindDropCompanyAdminGrid();
                    this.btnEdit.Visible             = false;
                    this.btnListAll.Visible          = false;
                    this.btnUpdate.Visible           = false;
                    this.btnCancel.Visible           = false;
                    this.addPanel.Visible            = true;
                    this.gridPanel.Visible           = false;
                    CompanyAdminRightsMaster.AddMode = "Add";
                    if (user == null)
                    {
                        break;
                    }
                    string str1 = user.ToString();
                    if (!Roles.IsUserInRole(str1, "Admin"))
                    {
                        break;
                    }
                    this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str1);
                    if (this.objCompanyLoginMasterDT.Rows.Count <= 0)
                    {
                        break;
                    }
                    this.hfCompanyID.Value             = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString();
                    this.ddlCompanyAdmin.SelectedValue = this.hfCompanyID.Value;
                    this.ddlCompanyAdmin_SelectedIndexChanged((object)null, (EventArgs)null);
                    this.ddlCompanyAdmin.Enabled = false;
                    break;

                default:
                    this.BindGrid();
                    this.gridPanel.Visible = true;
                    this.addPanel.Visible  = false;
                    break;
                }
            }
            else
            {
                this.BindGrid();
                this.gridPanel.Visible = true;
                this.addPanel.Visible  = false;
            }
        }