void Page_Load(object sender, EventArgs e)
        {
            if (!this.CheckIsLoaded())
            {
                try
                {
                    this.mCurrentUser      = this.mMaster.pCurrentUser;
                    this.mSystem_ModulesID = (Int64)this.ViewState[CnsSystem_ModulesID];
                    this.mIsReadOnly       = this.pIsReadOnly;
                    this.mObjID            = (string)this.ViewState[CnsObjID];
                    this.mObj_Base         = (ClsBase)this.Session[this.mObjID];

                    if (!this.IsPostBack)
                    {
                        this.SetupPage();
                        this.Save_Redirected();
                    }

                    this.SetupPage_ControlAttributes();
                }
                catch (Exception ex)
                {
                    Layer01_Methods_Web.ErrorHandler(ex, this.Server);
                    throw ex;
                }
            }
        }
        //ClsBaseObjs mBO_Details_Person = new ClsBaseObjs();

        #endregion

        #region _Constructor

        public ClsContactPerson(ClsSysCurrentUser pCurrentUser = null)
        {
            this.Setup(pCurrentUser, "ContactPerson");
            //this.Setup_AddTableDetail("ContactPerson_Details", "uvw_ContactPerson_Details");
            this.Setup_AddListDetail("ContactPerson_Details", new ClsContactPerson_Details(pCurrentUser));
            this.Setup_EnableCache();
        }
 public ClsItem(ClsSysCurrentUser pCurrentUser)
 {
     this.Setup(pCurrentUser, "Item", "uvw_Item");
     this.Setup_AddTableDetail("Item_Part", "uvw_Item_Part", "IsNull(IsDeleted,0) = 0");
     this.Setup_AddTableDetail("Item_Location", "uvw_Item_Location", "IsNull(IsDeleted,0) = 0");
     this.Setup_AddTableDetail("Item_Supplier", "uvw_Item_Supplier", "IsNull(IsDeleted,0) = 0");
 }
        public ClsContactPerson_Details(ClsSysCurrentUser CurrentUser)
        {
            base.Setup("ContactPerson_Details", "uvw_ContactPerson_Details");

            //[-]

            List <Do_Constants.Str_ForeignKeyRelation> FetchKeys = new List <Do_Constants.Str_ForeignKeyRelation>();

            FetchKeys.Add(new Do_Constants.Str_ForeignKeyRelation("ContactPersonID", "ContactPersonID"));

            List <Do_Constants.Str_ForeignKeyRelation> ForeignKeys = new List <Do_Constants.Str_ForeignKeyRelation>();

            ForeignKeys.Add(new Do_Constants.Str_ForeignKeyRelation("PersonID", "PersonID"));

            base.Setup_AddListObject(
                "Person"
                , new ClsPerson(null)
                , new List <object>()
            {
                CurrentUser
            }
                , "uvw_Person_ContactPerson_Details"
                , FetchKeys
                , ForeignKeys);
        }
        public ClsCustomer_ShippingAddress(ClsSysCurrentUser CurrentUser)
        {
            QueryCondition Qc = new QueryCondition();

            Qc.Add("IsDeleted", "0", "0");
            base.Setup("Customer_ShippingAddress", "uvw_Customer_ShippingAddress", Qc);

            //[-]

            List <Do_Constants.Str_ForeignKeyRelation> FetchKeys = new List <Do_Constants.Str_ForeignKeyRelation>();

            FetchKeys.Add(new Do_Constants.Str_ForeignKeyRelation("CustomerID", "CustomerID"));

            List <Do_Constants.Str_ForeignKeyRelation> ForeignKeys = new List <Do_Constants.Str_ForeignKeyRelation>();

            ForeignKeys.Add(new Do_Constants.Str_ForeignKeyRelation("AddressID", "AddressID"));

            base.Setup_AddListObject(
                "Address"
                , new ClsAddress(null)
                , new List <object>()
            {
                CurrentUser
            }
                , "uvw_Address_Customer_ShippingAddress"
                , FetchKeys
                , ForeignKeys);
        }
Example #6
0
 public ClsDocumentItem(ClsSysCurrentUser pCurrentUser = null, string pViewName = "")
 {
     if (pViewName == "")
     {
         pViewName = "uvw_DocumentItem_Details";
     }
     this.Setup(pCurrentUser, "DocumentItem");
     this.Setup_AddTableDetail("DocumentItem_Details", pViewName, "IsNull(IsDeleted,0) = 0");
 }
Example #7
0
 public ClsEmployee(ClsSysCurrentUser pCurrentUser)
 {
     this.Setup(
         Layer01_Common.Common.Layer01_Constants.eSystem_LookupPartyType.Employee
         , pCurrentUser
         , "Employee"
         , "uvw_Employee");
     this.Setup_AddTableDetail("Employee_Leave", "", "IsNull(IsDeleted,0) = 0");
 }
Example #8
0
        public void Setup(ClsAddress pObj_Address)
        {
            ClsSysCurrentUser CurrentUser = (ClsSysCurrentUser)this.Session[Layer01_Constants_Web.CnsSession_CurrentUser];

            this.mObjID       = CurrentUser.GetNewPageObjectID();
            this.mObj_Address = pObj_Address;

            this.ViewState[CnsObjID] = this.mObjID;
            this.Session[this.mObjID + CnsObj_Address] = this.mObj_Address;
            this.SetupPage();
        }
        public ClsCustomer(ClsSysCurrentUser CurrentUser)
        {
            //this.Setup(Layer01_Common.Common.Layer01_Constants.eSystem_LookupPartyType.Customer, CurrentUser, "Customer", "uvw_Customer");
            this.Setup(Layer01_Common.Common.Layer01_Constants.eSystem_LookupPartyType.Customer, CurrentUser, "Customer", "Materialized_Customer", "Materialized_Customer");
            this.Setup_AddTableDetail("Customer_Receipt", "", "IsNull(IsDeleted,0) = 0");
            //this.Setup_AddTableDetail("Customer_ShippingAddress", "uvw_Customer_ShippingAddress", "IsNull(IsDeleted,0) = 0");
            this.Setup_AddListDetail("Customer_ShippingAddress", new ClsCustomer_ShippingAddress(CurrentUser));
            this.Setup_EnableCache();

            this.mObj_ContactPerson = new ClsContactPerson(this.mCurrentUser);
            //this.mObj_ShippingAddress = new ClsCustomer_ShippingAddress(CurrentUser);
        }
        protected virtual void Page_Load(object sender, EventArgs e)
        {
            this.mCurrentUser    = this.mMaster.pCurrentUser;
            this.mSessionPageObj = (Collection)this.Session[this.mMaster.pObjID + CnsSessionPageObj];

            if (!this.IsPostBack)
            {
                this.ViewState[CnsSystem_ModulesID] = this.mSystem_ModulesID;
            }
            else
            {
                this.mSystem_ModulesID = (Int64)this.ViewState[CnsSystem_ModulesID];
            }
        }
Example #11
0
        private void LoadMenu()
        {
            ClsSysCurrentUser CurrentUser = this.mMaster.pCurrentUser;
            DataTable         Dt_Menu;

            if (CurrentUser.pIsAdmin)
            {
                Dt_Menu = Do_Methods_Query.GetQuery("uvw_System_Modules", "", "IsNull(IsHidden,0) = 0", "Parent_OrderIndex, OrderIndex");
            }
            else
            {
                List <QueryParameter> Sp = new List <QueryParameter>();
                Sp.Add(new QueryParameter(@"@UserID", CurrentUser.pDrUser["UserID"]));
                Dt_Menu = Do_Methods_Query.ExecuteQuery("usp_System_Modules_Load", Sp).Tables[0];
            }

            this.trvMenus.Nodes.Clear();

            foreach (DataRow Dr in Dt_Menu.Rows)
            {
                if ((Int64)Do_Methods.IsNull(Dr["Parent_System_ModulesID"], 0) == 0)
                {
                    TreeNode Node = new TreeNode();
                    Node.Text = @"&nbsp" + Dr["Name"];
                    //Node.ImageUrl = "";
                    if ((string)Do_Methods.IsNull(Dr["PageUrl_List"], "") != "")
                    {
                        string Arguments = (string)Do_Methods.IsNull(Dr["Arguments"], "");
                        if (Arguments != "")
                        {
                            Arguments = @"?" + Arguments;
                        }
                        Node.NavigateUrl = @"~/" + Dr["PageUrl_List"] + Arguments;
                    }
                    else
                    {
                        Node.SelectAction = TreeNodeSelectAction.None;
                    }

                    this.trvMenus.Nodes.Add(Node);

                    DataRow[] ArrDr = Dt_Menu.Select("Parent_System_ModulesID = " + ((Int64)Do_Methods.IsNull(Dr["System_ModulesID"], 0)).ToString());
                    if (ArrDr.Length > 0)
                    {
                        this.AddNode(ref Dt_Menu, Node, (Int64)Do_Methods.IsNull(Dr["System_ModulesID"], 0));
                    }
                }
            }
        }
        protected void Page_Init(object sender, System.EventArgs e)
        {
            this.mServerRoot = this.ResolveUrl(@"~/");
            ClsSysCurrentUser CurrentUser = this.pCurrentUser;
            bool IsLoggedIn = false;

            if (CurrentUser != null)
            {
                IsLoggedIn = CurrentUser.pIsLoggedIn;
            }
            else
            {
                this.pCurrentUser_New();
            }
        }
        public void Setup(
            Keys Keys
            , Layer01_Common.Common.Layer01_Constants.eSystem_Modules pSystem_ModulesID
            , ClsBase pObjBase
            , string pModuleName = "")
        {
            this.mSystem_ModulesID = (Int64)pSystem_ModulesID;
            this.ViewState[CnsSystem_ModulesID] = pSystem_ModulesID;
            this.ViewState[CnsModuleName]       = pModuleName;
            this.mObj_Base = pObjBase;
            this.mObj_Base.Load(Keys);

            this.mCurrentUser         = this.mMaster.pCurrentUser;
            this.mObjID               = this.mCurrentUser.GetNewPageObjectID();
            this.ViewState[CnsObjID]  = this.mObjID;
            this.Session[this.mObjID] = this.mObj_Base;
        }
Example #14
0
        protected virtual void Setup(ClsSysCurrentUser pCurrentUser, string pTableName = "", string pViewName = "")
        {
            this.mCurrentUser      = pCurrentUser;
            this.mHeader_TableName = pTableName;
            this.mHeader_TableKey  = this.mHeader_TableName + "ID";
            if (pViewName == "")
            {
                pViewName = pTableName;
            }
            this.mHeader_ViewName = pViewName;

            DataTable Dt_Def = Methods_Query.GetTableDef(this.mHeader_TableName);

            DataRow[] ArrDr = Dt_Def.Select("IsPk = 1");
            foreach (DataRow Dr in ArrDr)
            {
                this.mHeader_Key.Add((string)Dr["ColumnName"]);
            }
        }
        void Login()
        {
            this.Master.pCurrentUser_New();
            ClsSysCurrentUser CurrentUser = this.Master.pCurrentUser;

            switch (CurrentUser.Login(this.Txt_Username.Text, this.Txt_Password.Text))
            {
            case ClsSysCurrentUser.eLoginResult.LoggedIn:
            case ClsSysCurrentUser.eLoginResult.Administrator:
                CurrentUser.pIsLoggedIn = true;
                this.Response.Redirect(@"~/Modules_Page/Default.aspx");
                break;

            default:
                this.Panel_Msg.Visible = true;
                this.Lbl_Msg.Text      = "User Name or Password is incorrect. Please try again.";
                this.Lbl_Msg.Visible   = true;
                break;
            }
        }
Example #16
0
        public string Show(ClsCustomer pObj_Customer, Int64 pTmpKey = 0)
        {
            ClsSysCurrentUser CurrentUser = (ClsSysCurrentUser)this.Session[Layer01_Constants_Web.CnsSession_CurrentUser];

            this.mObjID        = CurrentUser.GetNewPageObjectID();
            this.mObj_Customer = pObj_Customer;
            this.mTmpKey       = pTmpKey;

            this.ViewState[CnsObjID] = this.mObjID;
            this.Session[this.mObjID + CnsObj_Customer] = this.mObj_Customer;
            this.ViewState[CnsTmpKey] = this.mTmpKey;

            this.SetupPage();

            StringBuilder Sb_Js = new StringBuilder();

            Sb_Js.Append("var EODialog = eo_GetObject('" + this.EODialog_ShippingAddress.ClientID + "'); ");
            Sb_Js.Append("EODialog.show(true); ");

            return(Sb_Js.ToString());
        }
        void Page_Load(object sender, EventArgs e)
        {
            ClsSysCurrentUser CurrentUser = this.pCurrentUser;

            if (!CurrentUser.pIsLoggedIn)
            {
                if (!this.mIsPageLogin)
                {
                    this.Session.Clear();
                    this.pCurrentUser_New();
                    this.Response.Redirect("~/Modules_Page/Page_Login.aspx");
                    return;
                }
            }
            else
            {
                if (this.mIsPageLogin)
                {
                    this.Response.Redirect("~/Modules_Page/Default.aspx");
                }
            }
        }
Example #18
0
        public string Show(ref ClsContactPerson pObj_ContactPerson, Int64 pTmpKey = 0)
        {
            ClsSysCurrentUser CurrentUser = (ClsSysCurrentUser)this.Session[Layer01_Constants_Web.CnsSession_CurrentUser];

            this.mObjID             = CurrentUser.GetNewPageObjectID();
            this.mObj_ContactPerson = pObj_ContactPerson;
            this.mTmpKey            = pTmpKey;

            this.ViewState[CnsObjID] = this.mObjID;
            this.Session[this.mObjID + CnsObj_ContactPerson] = this.mObj_ContactPerson;
            this.ViewState[CnsTmpKey] = this.mTmpKey;
            this.Page_Load(null, null);

            //[-]

            //[-]

            System.Text.StringBuilder Sb_Js = new System.Text.StringBuilder();
            Sb_Js.Append("var EODialog = eo_GetObject('" + this.EODialog_ContactPerson.ClientID + "');");
            Sb_Js.Append("EODialog.show(true); ");

            return(Sb_Js.ToString());
        }
Example #19
0
 public ClsRights(ClsSysCurrentUser pCurrentUser = null)
 {
     this.Setup(pCurrentUser, "Rights", "uvw_Rights");
     this.Setup_AddTableDetail("Rights_Details", "", "1 = 0");
 }
 protected virtual new void Setup(ClsSysCurrentUser CurrentUser, string TableName, string ViewName = "", string ViewName_Item = "")
 {
     base.Setup(CurrentUser, TableName, ViewName);
     this.mObj_DocumentItem = new ClsDocumentItem(this.mCurrentUser, ViewName_Item);
 }
Example #21
0
 public ClsSalesOrder(ClsSysCurrentUser pCurrentUser = null)
 {
     this.Setup(pCurrentUser, "TransactionSalesOrder", "uvw_TransactionSalesOrder", "uvw_TransactionSalesOrder_DocumentItem_Desc");
 }
        public void Setup(
            string Name
            , DataTable Dt
            , string Key      = ""
            , bool AllowSort  = false
            , bool HasDelete  = false
            , bool IsReadOnly = false)
        {
            ClsSysCurrentUser Obj_CurrentUser = (ClsSysCurrentUser)this.Session[Layer01_Constants_Web.CnsSession_CurrentUser];

            this.mObjID     = Obj_CurrentUser.GetNewPageObjectID();
            this.mDt_Source = Dt;

            this.ViewState[CnsObjID] = this.mObjID;
            this.Session[this.mObjID + CnsDt_Source] = this.mDt_Source;

            //[-]

            DataRow Dr_Bind       = Do_Methods_Query.GetSystemBindDefinition(Name);
            string  Bind_TableKey = (string)Do_Methods.IsNull(Dr_Bind["TableKey"], "");
            List <ClsBindGridColumn_EO> List_Gc = Layer01_Methods_Web_EO.GetBindGridColumn_EO(Name);

            foreach (ClsBindGridColumn_EO Gc in List_Gc)
            {
                if (Gc.mEnabled)
                {
                    Gc.mEnabled = !IsReadOnly;
                }
            }

            if (!IsReadOnly)
            {
                if (HasDelete)
                {
                    ClsBindGridColumn_EO Gc =
                        new ClsBindGridColumn_EO(
                            ""
                            , ""
                            , 80
                            , ""
                            , Layer01_Common.Common.Layer01_Constants.eSystem_Lookup_FieldType.FieldType_Delete);
                    Gc.mFieldText           = "Delete";
                    Gc.mClientSideBeginEdit = "EOGrid_RowEdit";
                    List_Gc.Add(Gc);
                }
            }

            if (Key.Trim() == "")
            {
                Key = Bind_TableKey;
            }

            this.EOGrid_List.EnableKeyboardNavigation = true;
            this.EOGrid_List.StyleSetIDField          = "Item_Style";
            Layer01_Methods_Web_EO.BindEOGrid(ref this.EOGrid_List, Dt, List_Gc, Key, AllowSort);

            this.ViewState[CnsKey]       = Key;
            this.ViewState[CnsHasDelete] = HasDelete;

            //[-]

            this.Page_Load(null, null);
        }
Example #23
0
 protected override void Setup(ClsSysCurrentUser CurrentUser, string TableName, string ViewName = "", string CacheTableName = "")
 {
     throw new NotImplementedException();
 }
Example #24
0
 protected override void Setup(Layer01_Common.Common.Layer01_Constants.eSystem_LookupPartyType PartyType, ClsSysCurrentUser CurrentUser, String TableName, String ViewName = "", String CacheTableName = "")
 {
     base.Setup(PartyType, CurrentUser, TableName, ViewName);
     this.mObj_Person = new ClsPerson(this.mCurrentUser);
 }
 public ClsRowProperty(ClsSysCurrentUser pCurrentUser = null)
 {
     this.Setup(pCurrentUser, "RowProperty");
 }
Example #26
0
 protected virtual void Setup(ClsSysCurrentUser CurrentUser, string TableName, string ViewName = "", QueryCondition Qc_LoadCondition = null, List <string> CustomKeys = null)
 {
     base.Setup(TableName, ViewName, Qc_LoadCondition, CustomKeys);
     this.mCurrentUser = CurrentUser;
 }
 public ClsUser(ClsSysCurrentUser pCurrentUser = null)
 {
     this.Setup(pCurrentUser, "User", "uvw_User");
     this.Setup_AddTableDetail("User_Rights", "", "1 = 0");
 }
Example #28
0
 public ClsPerson(ClsSysCurrentUser pCurrentUser = null)
 {
     this.Setup(pCurrentUser, "Person", "uvw_Person");
 }
 public ClsDocument(ClsSysCurrentUser pCurrentUser = null)
 {
     this.Setup(pCurrentUser, "Document", "uvw_Document");
 }
 protected virtual void Setup(ClsSysCurrentUser CurrentUser, String TableName, String ViewName = "", String CacheTableName = "")
 {
     base.Setup(TableName, ViewName);
     this.mCacheTableName = CacheTableName;
     this.mCurrentUser    = CurrentUser;
 }