Example #1
0
        public static List <Savings> GetAll()
        {
            const string   GET_ALL = "select Id,MemberId,SavingsDate,SavingsAmt,SavingsId,CreatedBy from tbSavings where Deleted=0";
            List <Savings> ret     = new List <Savings>();
            SqlCommand     cmd     = new SqlCommand(GET_ALL);

            ret = SqlManager.Select <Savings>(cmd);
            return(ret);
        }
        public static List <Witness> GetAll()
        {
            const string   GET_ALL = "select Id,LoanId,WitnessName from tbWitness";
            List <Witness> ret     = new List <Witness>();
            SqlCommand     cmd     = new SqlCommand(GET_ALL);

            ret = SqlManager.Select <Witness>(cmd);
            return(ret);
        }
Example #3
0
        public static List <Comaker> GetAll()
        {
            const string   GET_ALL = "select Id,LoanId,Name,ContactNo,MemberId,Status from tbComaker";
            List <Comaker> ret     = new List <Comaker>();
            SqlCommand     cmd     = new SqlCommand(GET_ALL);

            ret = SqlManager.Select <Comaker>(cmd);
            return(ret);
        }
        public static List <Loan> GetAll()
        {
            const string GET_ALL = "select Id,MemberId,LoanId,Status,LoanAmt,Convert(varchar(11),CreatedDate,100) as CreatedDate,Convert(varchar(11),ApprovalDate,100) as ApprovalDate,InterestRate,Terms,TotalPaymentwInterest,ApprovedBy from tbLoan";
            List <Loan>  ret     = new List <Loan>();
            SqlCommand   cmd     = new SqlCommand(GET_ALL);

            ret = SqlManager.Select <Loan>(cmd);
            return(ret);
        }
        public static List <Admin> GetAll()
        {
            const string GET_ALL = "select Id,LoginId,AdminId,Fname,Mname,Lname,Position,ResidentialAddress,Gender,Birthdate,MaritalStatus,EmailAddress,ContactNo,EmergencyNo,Deleted,Url from tbAdmin where Deleted=0";
            List <Admin> ret     = new List <Admin>();
            SqlCommand   cmd     = new SqlCommand(GET_ALL);

            ret = SqlManager.Select <Admin>(cmd);
            return(ret);
        }
        public static List <Member> GetAll()
        {
            const string  GET_ALL = "select Id,LoginId,EmployeeId,Salutation,Fname,Mname,Lname,Position,ResidentialAddress,Gender,Birthdate,MaritalStatus,EmailAddress,ContactNo,EmergencyContactNo,SalaryAmt,Deleted,Url from tbMember where Deleted=0";
            List <Member> ret     = new List <Member>();
            SqlCommand    cmd     = new SqlCommand(GET_ALL);

            ret = SqlManager.Select <Member>(cmd);
            return(ret);
        }
Example #7
0
        public static List <Withdraw> GetAllPending()
        {
            const string    GET_ALL = "select Id,MemberId,WithdrawDate,WithdrawAmt,WithdrawId,Status,ApprovedBy from tbWithdraw where Status='Pending'";
            List <Withdraw> ret     = new List <Withdraw>();
            SqlCommand      cmd     = new SqlCommand(GET_ALL);

            ret = SqlManager.Select <Withdraw>(cmd);
            return(ret);
        }
        public static List <Login> GetAll(string email)
        {
            const string GET_ALL = @"select Id,Username,Hash,CreatedBy,ModifiedBy,CreatedDate,ModifiedDate,Level,Lockout,LastLogin from tbLogin where Username=@email and Lockout=0";
            List <Login> ret     = default(List <Login>);
            SqlCommand   com     = new SqlCommand(GET_ALL);

            com.Parameters.Add(new SqlParameter("@email", email));
            ret = SqlManager.Select <Login>(com);
            return(ret);
        }
        public static List <LoanReport> GetAll(int id)
        {
            const string      GET_ALL = "select Fname+' '+Mname+' '+Lname as Fullname,l.Id,l.MemberId,l.LoanId,Status,LoanAmt,CreatedDate,ApprovalDate,InterestRate,Terms,TotalPaymentwInterest,ApprovedBy from tbMember m inner join tbLoan l on m.Id=l.MemberId where l.Id=@Id and c.Status='Pending'";
            List <LoanReport> ret     = new List <LoanReport>();
            SqlCommand        cmd     = new SqlCommand(GET_ALL);

            cmd.Parameters.Add(new SqlParameter("Id", id));
            ret = SqlManager.Select <LoanReport>(cmd);
            return(ret);
        }
        public static List <Witness> GetAll(string lid)
        {
            const string   GET_ALL = "select Id,LoanId,WitnessName from tbWitness where LoanId=@LoanId";
            List <Witness> ret     = new List <Witness>();
            SqlCommand     cmd     = new SqlCommand(GET_ALL);

            cmd.Parameters.Add(new SqlParameter("LoanId", lid));
            ret = SqlManager.Select <Witness>(cmd);
            return(ret);
        }
Example #11
0
        public static List <Withdraw> Check(int id)
        {
            const string    GET_ALL = "select Id,MemberId,WithdrawDate,WithdrawAmt,WithdrawId,Status,ApprovedBy from tbWithdraw where MemberId=@MemberId and Status='Pending'";
            List <Withdraw> ret     = new List <Withdraw>();
            SqlCommand      cmd     = new SqlCommand(GET_ALL);

            cmd.Parameters.Add(new SqlParameter("MemberId", id));
            ret = SqlManager.Select <Withdraw>(cmd);
            return(ret);
        }
        public static Admin GetById(int id)
        {
            const string GET_ALL = "select Id,LoginId,AdminId,Fname,Mname,Lname,Position,ResidentialAddress,Gender,Birthdate,MaritalStatus,EmailAddress,ContactNo,EmergencyNo,Deleted,Url from tbAdmin  where LoginId=@Id and Deleted=0";
            Admin        ret     = new Admin();
            SqlCommand   cmd     = new SqlCommand(GET_ALL);

            cmd.Parameters.Add(new SqlParameter("Id", id));
            ret = SqlManager.Select <Admin>(cmd).First();
            return(ret);
        }
        public static Loan Get(int id)
        {
            const string GET_ALL = "select Id,MemberId,LoanId,Status,LoanAmt,Convert(varchar(11),CreatedDate,100) as CreatedDate,Convert(varchar(11),ApprovalDate,100) as ApprovalDate,InterestRate,Terms,TotalPaymentwInterest,ApprovedBy from tbLoan where Id=@Id and Status='Pending'";
            Loan         ret     = new Loan();
            SqlCommand   cmd     = new SqlCommand(GET_ALL);

            cmd.Parameters.Add(new SqlParameter("Id", id));
            ret = SqlManager.Select <Loan>(cmd).First();
            return(ret);
        }
        public static List <Loan> GetAll(string id)
        {
            const string GET_ALL = "select l.Id,l.MemberId,l.LoanId,l.Status,LoanAmt,Convert(varchar(11),CreatedDate,100) as CreatedDate,Convert(varchar(11),ApprovalDate,100) as ApprovalDate,InterestRate,Terms,TotalPaymentwInterest,ApprovedBy from tbLoan l inner join tbComaker c on l.LoanId=c.LoanId where c.MemberId=@MemberId and c.Status='Pending'";
            List <Loan>  ret     = new List <Loan>();
            SqlCommand   cmd     = new SqlCommand(GET_ALL);

            cmd.Parameters.Add(new SqlParameter("MemberId", id));
            ret = SqlManager.Select <Loan>(cmd);
            return(ret);
        }
        public static Member GetByLoginId(int id)
        {
            const string GET_ALL = "select Id,LoginId,EmployeeId,Salutation,Fname,Mname,Lname,Position,ResidentialAddress,Gender,Birthdate,MaritalStatus,EmailAddress,ContactNo,EmergencyContactNo,SalaryAmt,Deleted,Url from tbMember where LoginId=@Id and Deleted=0";
            Member       ret     = new Member();
            SqlCommand   cmd     = new SqlCommand(GET_ALL);

            cmd.Parameters.Add(new SqlParameter("Id", id));
            ret = SqlManager.Select <Member>(cmd).First();
            return(ret);
        }
        public static List <WithdrawList> GetAll(string status)
        {
            const string        GET_ALL = "select Id,MemberId,WithdrawAmt,Savings=(select SUM(SavingsAmt) from tbSavings where MemberId=w.MemberId),Status,ApprovedBy from tbWithdraw w where Status=@Status";
            List <WithdrawList> ret     = new List <WithdrawList>();
            SqlCommand          cmd     = new SqlCommand(GET_ALL);

            cmd.Parameters.Add(new SqlParameter("Status", status));
            ret = SqlManager.Select <WithdrawList>(cmd);
            return(ret);
        }
Example #17
0
        public static Savings GetById(int id)
        {
            const string GET_ALL = "select Id,MemberId,SavingsDate,SavingsAmt,SavingsId,CreatedBy from tbSavings where Id=@Id and Deleted=0";
            Savings      ret     = new Savings();
            SqlCommand   cmd     = new SqlCommand(GET_ALL);

            cmd.Parameters.Add(new SqlParameter("Id", id));
            ret = SqlManager.Select <Savings>(cmd).First();
            return(ret);
        }
Example #18
0
        public static List <Savings> GetAll(int id)
        {
            const string   GET_ALL = "select Id,MemberId,SavingsDate,SavingsAmt,SavingsId,CreatedBy from tbSavings where MemberId=@MemberId and Deleted=0 ";
            List <Savings> ret     = new List <Savings>();
            SqlCommand     cmd     = new SqlCommand(GET_ALL);

            cmd.Parameters.Add(new SqlParameter("MemberId", id));
            ret = SqlManager.Select <Savings>(cmd);
            return(ret);
        }
Example #19
0
        public static List <Comaker> GetCo(string id)
        {
            const string   GET_ALL = "select Id,LoanId,Name,ContactNo,MemberId,Status from tbComaker where LoanId=@LoanId and Status='Approved' ";
            List <Comaker> ret     = new List <Comaker>();
            SqlCommand     cmd     = new SqlCommand(GET_ALL);

            cmd.Parameters.Add(new SqlParameter("LoanId", id));
            ret = SqlManager.Select <Comaker>(cmd);
            return(ret);
        }
        public static Login Get(string uid, string uhash)
        {
            Login ret = default(Login);

            try
            {
                const string GET_RECORD = @"SELECT Id,Username,Hash,CreatedBy,ModifiedBy,CreatedDate,ModifiedDate,Level,Lockout,LastLogin FROM [tbLogin] WHERE Username = @Username and Hash=@Hash and Lockout=0";


                SqlCommand com = new SqlCommand(GET_RECORD);
                com.Parameters.Add(new SqlParameter("@Username", uid));
                com.Parameters.Add(new SqlParameter("@Hash", uhash));
                ret = SqlManager.Select <Login>(com).First();

                return(ret);
            }
            catch (InvalidOperationException)
            {
                return(ret);
            }
        }