コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int companyID = 0;
                int userID    = 0;
                //if (Session["CompanyID"] != null && Session["CompanyID"].ToString() != "")
                if (SessionControl.CompanyID != 0)
                {
                    //companyID = Convert.ToInt32(Session["CompanyID"]);
                    //userID = Convert.ToInt32(Session["UserID"]);

                    companyID = SessionControl.CompanyID.cxToInt32();
                    userID    = SessionControl.UserID.cxToInt32();

                    UsersXPagesDL _usersXPagesDL = new UsersXPagesDL(userID, companyID, CommonDL.GetPageID(), true);
                    if (_usersXPagesDL.IsAddorEdit)
                    {
                    }
                    else
                    {
                        Response.Redirect("~/Login.aspx", false);
                    }
                }
                else
                {
                    Response.Redirect("~/Login.aspx", false);
                }
                GridViewProperties.AssignGridViewProperties(gvRoleSettings);
                LoadDropDownList();
                gvRoleSettings.AllowPaging = false;
                btnSave.Visible            = false;
                btnCancel.Visible          = false;
            }
        }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         base.Response.Cache.SetCacheability(HttpCacheability.NoCache);
         if (!base.IsPostBack)
         {
             GridViewProperties.AssignGridViewProperties(gvReviewDetails);
             hfCompanyID.Value     = "11";
             hfUserID.Value        = "19";
             gvReviewDetails.Width = Unit.Percentage(97);
             LoadContactDropDown();
             string v = Request.QueryString["EnquiryReviewChecklistID"];
             if (v != null)
             {
                 hfEnquiryReviewChecklistID.Value = v;
                 GetEnquiryReviewChecklistDetails(Convert.ToInt32(hfEnquiryReviewChecklistID.Value));
             }
         }
     }
     catch (Exception exception1)
     {
         ErrorLog.LogErrorMessageToDB("AddEditEnquiryReviewCheckList.aspx", "", "Page_Load", exception1.Message.ToString(), new ACEConnection());
         throw;
     }
 }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         base.Response.Cache.SetCacheability(HttpCacheability.NoCache);
         if (!base.IsPostBack)
         {
             GridViewProperties.AssignGridViewProperties(gvPurchaseWorkOrder);
             hfCompanyID.Value         = "11";
             hfUserID.Value            = "19";
             gvPurchaseWorkOrder.Width = Unit.Percentage(97);
             LoadContactDropDown();
             string v = Request.QueryString["PurchaseOrderID"];
             trEnablePurchaseWorkOrder.Visible = false;
             if (v != null)
             {
                 hfPurchaseOrderID.Value = v;
                 GetPurchaseOrderDetails(Convert.ToInt32(hfPurchaseOrderID.Value));
             }
         }
     }
     catch (Exception exception1)
     {
         ErrorLog.LogErrorMessageToDB("AddEditPurchaseOrder.aspx", "", "Page_Load", exception1.Message.ToString(), new ACEConnection());
         throw;
     }
 }
コード例 #4
0
 /// <summary>
 /// Page_Load
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     _companyID  = Convert.ToInt32(Session["CompanyID"]);
     _userID     = Convert.ToInt32(Session["UserID"]);
     _dateFormat = Convert.ToString(Session["DateFormat"]);
     GridViewProperties.AssignGridViewProperties(gvErrorLog);
     if (_dateFormat == null || _dateFormat == "")
     {
         Response.Redirect("~/Login.aspx", false);
     }
     if (!IsPostBack)
     {
         if (Session["CompanyID"] != null && Session["CompanyID"].ToString() != "")
         {
             UsersXPagesDL _usersXPagesDL = new UsersXPagesDL(_userID, _companyID, CommonDL.GetPageID(), true);
             if (!_usersXPagesDL.IsAddorEdit)
             {
                 Response.Redirect("~/Login.aspx", false);
             }
             LoadErrorLogList();
         }
         //else
         //{
         //  Response.Redirect("~/Login.aspx", false);
         //}
     }
 }
コード例 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         GridViewProperties.AssignGridViewProperties(gvRole);
         LoadDropDownList();
     }
 }
コード例 #6
0
        /// <summary>
        /// Page_Load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    int companyID = 0;
                    int userID    = 0;

                    //if (Session["CompanyID"] != null && Session["CompanyID"].ToString() != "")
                    if (SessionControl.CompanyID != 0)
                    {
                        //companyID = Convert.ToInt32(Session["CompanyID"]);
                        //userID = Convert.ToInt32(Session["UserID"]);


                        companyID = SessionControl.CompanyID.cxToInt32();
                        userID    = SessionControl.UserID.cxToInt32();

                        //UsersXPagesDL _usersXPagesDL = new UsersXPagesDL(userID, companyID, CommonDL.GetPageID(), true);
                        //if (!_usersXPagesDL.IsAddorEdit)
                        //{
                        //  Response.Redirect("~/Login.aspx", false);
                        //}
                    }
                    else
                    {
                        Response.Redirect("~/Login.aspx", false);
                    }
                    // gvUserPageSettings.Visible = false;
                    GridViewProperties.AssignGridViewProperties(gvUserPageSettings);
                    LoadDropDownList();
                    gvUserPageSettings.AllowPaging = false;
                    // btnSave.Visible = false;
                    // btnCancel.Visible = false;
                    int CompanyID = 0;
                    //CompanyID = Convert.ToInt32(Session["CompanyID"]);
                    //_userID = Convert.ToInt32(Session["UserID"]);

                    CompanyID = SessionControl.CompanyID.cxToInt32();
                    _userID   = SessionControl.UserID.cxToInt32();
                    //  ddlCompany.Visible = false;
                    ddlCompany.SelectedValue = Convert.ToString(CompanyID);
                    ddlCompany_SelectedIndexChanged(sender, e);
                }
                else
                {
                    //_userID = Convert.ToInt32(Session["UserID"]);
                    _userID = SessionControl.UserID.cxToInt32();
                }
            }
            catch (Exception ex)
            {
                ErrorLog.LogErrorMessageToDB("UserPageSettings.aspx", "", "Page_Load", ex.Message, new ACEConnection());
            }
        }
コード例 #7
0
        /// <summary>
        /// Page_Load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    //if (Session["CompanyID"] == null && Session["CompanyID"].ToString() == "")
                    if (SessionControl.CompanyID == 0)
                    {
                        Response.Redirect("~/Login.aspx", false);
                    }

                    // Set ViewState Variables
                    ViewState["SortDirection"]  = "ASC";
                    ViewState["SortExpression"] = "UserName";

                    // Assign Common GridView Properties to all GridViews used in the page
                    GridViewProperties.AssignGridViewProperties(gvUserCompanies);

                    // Load the Employee


                    // Load the Roles
                    LoadRoleDropDown();

                    // Hide certain rows
                    trUserNameRow.Visible = false;
                    trPasswordRow.Visible = false;
                    trUserIDRow.Visible   = false;


                    if (Request.QueryString["UserID"] != null && Request.QueryString["UserID"] != "null")
                    {
                        // Get the UserID Querystring Value
                        int uID = Convert.ToInt32(Request.QueryString["UserID"]);
                        if (uID != 0)
                        {
                            GetUserDetails(uID, true);
                            trRoleRow.Visible = false;
                        }
                    }
                    else
                    {
                        chkValid.Checked        = true;
                        tcntAllUserTabs.Visible = true;
                    }

                    // Load several Drop Down Lists needed for the page
                    LoadDropDownLists();
                }
            }
            catch (Exception ex)
            {
                ErrorLog.LogErrorMessageToDB("AddEditUser.aspx", "", "Page_Load", ex.Message.ToString(), new ACEConnection());
            }
        }
コード例 #8
0
        /// <summary>
        /// Page_Load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //Commentedd on 17/04/2014
                //_companyID = Convert.ToInt32(Session["CompanyID"]);
                //_userID = Convert.ToInt32(Session["UserID"]);
                //_dateFormat = Convert.ToString(Session["DateFormat"]);

                _companyID  = SessionControl.CompanyID.cxToInt32();
                _userID     = SessionControl.UserID.cxToInt32();
                _dateFormat = SessionControl.DateFormat.ToString();

                if (_dateFormat == null || _dateFormat == "")
                {
                    Response.Redirect("~/Login.aspx", false);
                }

                ceDOB.Format = _dateFormat;
                ceDOJ.Format = _dateFormat;
                if (!IsPostBack)
                {
                    //commented on 17/04/2014
                    //if (Session["CompanyID"] != null && Session["CompanyID"].ToString() != "")
                    if (_companyID != 0)
                    {
                        UsersXPagesDL _usersXPagesDL = new UsersXPagesDL(_userID, _companyID, CommonDL.GetPageID(), true);
                        if (!_usersXPagesDL.IsAddorEdit)
                        {
                            Response.Redirect("~/Login.aspx", false);
                        }
                    }
                    else
                    {
                        Response.Redirect("~/Login.aspx", false);
                    }


                    // Set ViewState Variables
                    ViewState["SortDirection"]  = "ASC";
                    ViewState["SortExpression"] = "EmployeeCode";

                    // Page.Form.DefaultButton = btnSearch.UniqueID;
                    Page.Form.DefaultFocus = txtSearchID.UniqueID;

                    // Assign Common GridView Properties to all GridViews used in the page
                    GridViewProperties.AssignGridViewProperties(gvEmployeeDetails);
                    LoadDropDownList();
                    GetEmployeeDetails("", Convert.ToBoolean(rblReportOption.SelectedValue));
                }
            }
            catch (Exception ex)
            {
                ErrorLog.LogErrorMessageToDB("ManageEmployee.aspx", "", "Page_Load", ex.Message.ToString(), new ACEConnection());
            }
        }
コード例 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bool bl;

            try
            {
                base.Response.Cache.SetCacheability(HttpCacheability.NoCache);
                base.Page.Form.DefaultButton = this.btnSearch.UniqueID;
                base.Page.Form.DefaultFocus  = this.txtSearchID.UniqueID;
                bl = base.IsPostBack;
                if (!bl)
                {
                    Session["CompanyID"] = "11";
                    hfCompanyID.Value    = "11";
                    //hfUserID.Value = "19";
                    //base.ViewState["SortDirection"] = "ASC";
                    //base.ViewState["SortExpression"] = "SupplierName";
                    //this.hfCompanyID.Value = Convert.ToString(base.Session["CompanyID"]);
                    bl = this.hfCompanyID.Value != "";
                    if (!bl)
                    {
                        this.hfCompanyID.Value = "0";
                    }
                    GridViewProperties.AssignGridViewProperties(this.gvSupplierDetails);
                    bl = base.Request.QueryString["SupplierID"] == null ? true : !(base.Request.QueryString["SupplierID"] != "null");
                    if (!bl)
                    {
                        GetSupplierDetails(Convert.ToInt32(base.Request.QueryString["SupplierID"].ToString()), Convert.ToInt32(this.hfCompanyID.Value), true);
                        this.trSupplierDetailView.Visible    = true;
                        this.trSupplierDetailTabs.Visible    = true;
                        this.trUpdateCancelButtonRow.Visible = true;
                        this.trSearchAndAddRow.Visible       = false;
                        this.trGridRow.Visible = false;
                    }
                    else
                    {
                        GetSupplierDetails(0, Convert.ToInt32(this.hfCompanyID.Value), "");
                        this.trSupplierDetailView.Visible    = false;
                        this.trSupplierDetailTabs.Visible    = false;
                        this.trUpdateCancelButtonRow.Visible = false;
                        this.trSearchAndAddRow.Visible       = true;
                        this.trGridRow.Visible = true;
                    }
                }
            }
            catch (Exception exception1)
            {
                ErrorLog.LogErrorMessageToDB("ManageSuppliers.aspx", "", "Page_Load", exception1.Message.ToString(), new ACEConnection());
                throw;
            }
        }
コード例 #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     base.Response.Cache.SetCacheability(HttpCacheability.NoCache);
     if (!IsPostBack)
     {
         //lnkAddEnquiryRegisterList.Visible = false;
         //base.ViewState["SortDirection"] = "ASC";
         //base.ViewState["SortExpression"] = "EnquiryRegisterList";
         GridViewProperties.AssignGridViewProperties(gvWorkOrderDocument);
         hfCompanyID.Value         = "11";
         hfUserID.Value            = "19";
         gvWorkOrderDocument.Width = Unit.Percentage(97);
         LoadDropDownList();
     }
 }
コード例 #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         base.Response.Cache.SetCacheability(HttpCacheability.NoCache);
         if (!base.IsPostBack)
         {
             base.ViewState["SortDirection"]  = "ASC";
             base.ViewState["SortExpression"] = "Agent";
             GridViewProperties.AssignGridViewProperties(this.gvAgent);
             this.gvAgent.Width = Unit.Percentage(97);
             GetAgentDetails();
         }
     }
     catch (Exception exception1)
     {
         ErrorLog.LogErrorMessageToDB("ManageAgent.aspx", "", "Page_Load", exception1.Message.ToString(), new ACEConnection());
         throw;
     }
 }
コード例 #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         base.Response.Cache.SetCacheability(HttpCacheability.NoCache);
         if (!base.IsPostBack)
         {
             //base.ViewState["SortDirection"] = "ASC";
             //base.ViewState["SortExpression"] = "OrderAcceptanceChecklist";
             GridViewProperties.AssignGridViewProperties(gvOrderAcceptanceChecklist);
             hfCompanyID.Value = "11";
             hfUserID.Value    = "19";
             gvOrderAcceptanceChecklist.Width = Unit.Percentage(97);
             //LoadMaterialDropDown();
             GetOrderAcceptanceChecklistDetails();
         }
     }
     catch (Exception exception1)
     {
         ErrorLog.LogErrorMessageToDB("ManageOrderAcceptanceCheckList.aspx", "", "Page_Load", exception1.Message.ToString(), new ACEConnection());
         throw;
     }
 }
コード例 #13
0
        /// <summary>
        /// Page_Load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //_companyID = Convert.ToInt32(Session["CompanyID"]);
                //_userID = Convert.ToInt32(Session["UserID"]);

                _companyID = SessionControl.CompanyID.cxToInt32();
                _userID    = SessionControl.UserID.cxToInt32();

                ViewState["PageID"] = CommonDL.GetPageID();
                if (!IsPostBack)
                {
                    //if (Session["CompanyID"] != null && Session["CompanyID"].ToString() != "")
                    if (SessionControl.CompanyID != 0)
                    {
                        UsersXPagesDL _usersXPagesDL = new UsersXPagesDL(_userID, _companyID, CommonDL.GetPageID(), true);
                        if (!_usersXPagesDL.IsAddorEdit)
                        {
                            //Response.Redirect("~/Login.aspx", false);
                            gvUserDetails.Columns[10].Visible = false;
                        }
                    }
                    else
                    {
                        Response.Redirect("~/Login.aspx", false);
                    }
                    // Set ViewState Variables
                    ViewState["SortDirection"]  = "ASC";
                    ViewState["SortExpression"] = "UserName";

                    // Assign Common GridView Properties to all GridViews used in the page
                    GridViewProperties.AssignGridViewProperties(gvUserDetails);
                    GridViewProperties.AssignGridViewProperties(gvUserCompanies);


                    // Get the UserID QueryString Value [if QueryString exists]
                    if (Request.QueryString["UserID"] != null && Request.QueryString["UserID"] != "null")
                    {
                        // Get the details of the User with the UserID QueryString Value
                        GetUserDetails(Convert.ToInt32(Request.QueryString["UserID"].ToString()), true);

                        trUserDetailView.Visible        = true;
                        trUserDetailTabs.Visible        = true;
                        trUpdateCancelButtonRow.Visible = true;
                        trSearchAndAddRow.Visible       = false;
                        trGridRow.Visible = false;
                        tblUser.Visible   = false;
                    }
                    else
                    {
                        // Get the list of users
                        GetUserDetails(Convert.ToString(txtSearchID.Text.ToString()), Convert.ToBoolean(rblReportOption.SelectedValue));
                        // Show only the list of users and hide an individual user detail view
                        trUserDetailView.Visible        = false;
                        trUserDetailTabs.Visible        = false;
                        trUpdateCancelButtonRow.Visible = false;
                        trSearchAndAddRow.Visible       = true;
                        trGridRow.Visible = true;
                        tblUser.Visible   = true;
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorLog.LogErrorMessageToDB("ViewUser.aspx", "", "Page_Load", ex.Message.ToString(), new ACEConnection());
            }
        }