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);
        }
        public eLoginResult Login(string UserName, string Password)
        {
            Interface_DataAccess Da = new ClsBase().pDa;

            try
            {
                Da.Connect();

                //Administrator Login
                if (UserName.ToUpper() == "Administrator".ToUpper())
                {
                    string System_Password = Da.GetSystemParameter("Administrator_Password", "Administrator");
                    if (System_Password != "")
                    {
                        string Decrypted_Password = System_Password;
                        if (Decrypted_Password == Password)
                        {
                            this.AdministratorLogin();
                            return(eLoginResult.Administrator);
                        }
                        else
                        {
                            return(eLoginResult.WrongPassword);
                        }
                    }
                    else
                    {
                        throw new CustomException("Administrator Password is not set. Contact your System Administrator.");
                    }
                }

                //User Login
                QueryCondition Qc = new QueryCondition();
                Qc.Add("UserName", UserName, typeof(string).ToString());
                DataTable Dt = Da.GetQuery("uvw_User", "", Qc, "UserID");
                if (Dt.Rows.Count > 0)
                {
                    string Decrypted_Password = (string)Do_Methods.IsNull(Dt.Rows[0]["Password"], "");

                    if (Decrypted_Password == Password)
                    {
                        this.mDrUser = Dt.Rows[0];
                        return(eLoginResult.LoggedIn);
                    }
                    else
                    {
                        return(eLoginResult.WrongPassword);
                    }
                }

                return(eLoginResult.WrongUser);
            }
            catch (Exception ex)
            { throw ex; }
            finally
            { Da.Close(); }
        }
示例#3
0
        protected string Details_PrepareOpen(Int64 ID)
        {
            DataTable Dt  = Do_Methods_Query.GetQuery("System_Modules", "", "System_ModulesID = " + this.mSystem_ModulesID.ToString());
            string    Url = "";

            if (Dt.Rows.Count > 0)
            {
                Url = "~/" + (string)Do_Methods.IsNull(Dt.Rows[0]["PageUrl_Details"], "");
            }

            this.Session[Layer01_Constants_Web.CnsSession_Keys] = null;

            QueryCondition Qc = new QueryCondition();

            Qc.Add(this.mObj_Base.pHeader_TableKey, "=", ID, typeof(Int64).ToString());
            Dt = this.List(Qc);
            if (Dt.Rows.Count > 0)
            {
                this.Session[Layer01_Constants_Web.CnsSession_Keys] = this.mObj_Base.GetKeys(Dt.Rows[0]);
            }

            return(Url);
        }