public override DataTable List(QueryCondition Condition, string Sort, long Top, int Page)
        {
            if (Condition == null)
            { Condition = this.mDa.CreateQueryCondition(); }

            Condition.Add("IsDeleted", "= 0", typeof(bool).ToString(), "0");

            if (!this.mCurrentUser.CheckAccess(Layer02_Constants.eSystem_Modules.Question, Layer02_Constants.eAccessLib.eAccessLib_View))
            { Condition.Add("RecruitmentTestUserID_CreatedBy", "= " + this.mCurrentUser.pUserID, typeof(Int64).ToString(), "0"); }

            return base.mDa.List("uvw_RecruitmentTestQuestions_Ex", Condition, Sort, Top, Page);
        }
        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 override long List_Count(QueryCondition Condition = null)
        {
            if (Condition == null)
            { Condition = this.mDa.CreateQueryCondition(); }
            Condition.Add("IsApproved", "0", typeof(bool).ToString(), "0");

            return base.List_Count(Condition);
        }
        public override DataTable List(QueryCondition Condition, string Sort, long Top, int Page)
        {
            if (Condition == null)
            { Condition = this.mDa.CreateQueryCondition(); }
            Condition.Add("IsApproved", "0", typeof(bool).ToString(), "0");

            this.mDt_List = base.List(Condition, Sort, Top, Page);
            this.mDt_List.Columns.Add("IsSelected", typeof(bool));
            this.AddRequired(this.mDt_List);
            return this.mDt_List;
        }
        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;
        }
Esempio n. 6
0
 public override long List_Count(QueryCondition Condition = null)
 {
     if (Condition == null)
     { Condition = Do_Methods.CreateQueryCondition(); }
     Condition.Add("IsDeleted", "=", typeof(bool).ToString(), "0");
     return base.List_Count(Condition);
 }
        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(); }
        }