/// <summary>
 /// Removes teacherSubject from given yearClassSection
 /// </summary>
 /// <param name="teahcerId">Id of corresponding teacher</param>
 /// <param name="subjectId">Id of corresponding subject</param>
 /// <param name="yearClassSectionId">Id of corresponding yearClassSection entry</param>
 /// <returns>Number of entries removed</returns>
 public int RemoveTeacherSubject(object teahcerId, object subjectId, object yearClassSectionId)
 {
     return(db.Execute("removeTeacherSubject", new Dictionary <string, object>()
     {
         { "@TId", teahcerId }, { "@SId", subjectId }, { "@YCSId", yearClassSectionId }
     }, true));
 }
 /// <summary>
 /// Removes all term exist in given YearClassSection
 /// </summary>
 /// <param name="yearClassSectionId">Id of corresponding yearClassSection entry</param>
 /// <returns>Number of entries deleted</returns>
 public int RemoveTermByYearClassSection(int yearClassSectionId)
 {
     return(db.Execute("removeTermByYCSId", new Dictionary <string, object>()
     {
         { "@YCSId", yearClassSectionId }
     }, true));
 }
Example #3
0
 /// <summary>
 /// Removes given class from given year
 /// </summary>
 /// <param name="yearId">Id of corresponding year entry</param>
 /// <param name="classId">Id of corresponding class entry</param>
 /// <returns>Number of entries removed</returns>
 public int RemoveClassFromYear(object yearId, object classId)
 {
     return(db.Execute("removeYCSByYIdCId", new Dictionary <string, object>()
     {
         { "@YId", yearId },
         { "@CId", classId }
     }, true));
 }
Example #4
0
        /// <summary>
        /// Deletes all branches from a user in the UserBranches table
        /// </summary>
        /// <param name="userId">The user's id</param>
        /// <returns></returns>
        public int Delete(string userId)
        {
            string commandText = "Delete from userbranches where UserId = @userId";
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("UserId", userId);

            return(_database.Execute(commandText, parameters));
        }
Example #5
0
        /// <summary>
        /// Deltes a role from the Roles table
        /// </summary>
        /// <param name="roleId">The role Id</param>
        /// <returns></returns>
        public int Delete(string roleId)
        {
            string commandText = "Delete from roles where Id = @id";
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("@id", roleId);

            return(_database.Execute(commandText, parameters));
        }
Example #6
0
        /// <summary>
        /// Sets the user's password hash
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="passwordHash"></param>
        /// <returns></returns>
        public int SetPasswordHash(string userId, string passwordHash)
        {
            string commandText = "Update users set PasswordHash = @pwdHash where Id = @id";
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("@pwdHash", passwordHash);
            parameters.Add("@id", userId);

            return(_database.Execute(commandText, parameters));
        }
Example #7
0
        /// <summary>
        /// Inserts a new Bank in the Bank table
        /// </summary>
        /// <param name="bank">The Bank's detail</param>
        /// <returns></returns>
        public int Insert(IdentityBank bank)
        {
            string commandText = "Insert into banks (Id, BankName, BankAcronym) values (@id, @name, @acronym)";
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("@name", bank.Name);
            parameters.Add("@id", bank.Id);
            parameters.Add("@acronym", bank.Acronym);

            return(_database.Execute(commandText, parameters));
        }
Example #8
0
        /// <summary>
        /// Deletes a login from a user in the UserLogins table
        /// </summary>
        /// <param name="user">User to have login deleted</param>
        /// <param name="login">Login to be deleted from user</param>
        /// <returns></returns>
        public int Delete(IdentityUser user, UserLoginInfo login)
        {
            string commandText = "Delete from UserLogins where UserId = @userId and LoginProvider = @loginProvider and ProviderKey = @providerKey";
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("UserId", user.Id);
            parameters.Add("loginProvider", login.LoginProvider);
            parameters.Add("providerKey", login.ProviderKey);

            return(_database.Execute(commandText, parameters));
        }
Example #9
0
        /// <summary>
        /// Inserts a new Account Number in the accountnumbers table
        /// </summary>
        /// <param name="AccountNumber">The account's detail</param>
        /// <returns></returns>
        public int Insert(IdentityAccountNumber accountno)
        {
            string commandText = "Insert into accountnumbers (Id, AccountNumber, AccountName, AccountBranch) values (@id, @accountNumber, @accountname, @accountbranch)";
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("@id", accountno.Id);
            parameters.Add("@accountNumber", accountno.AccountNumber);
            parameters.Add("@accountName", accountno.AccountName);
            parameters.Add("@accountbranch", accountno.AccountBranch);

            return(_database.Execute(commandText, parameters));
        }
 public int RemoveMarkPortionFromSubject(object markPortionId)
 {
     return(db.Execute("removeMarkPortionByMPId", new Dictionary <string, object>()
     {
         { "MPId", markPortionId }
     }, true));
 }
Example #11
0
 public int RemoveSubject(object subjectId, object yearId)
 {
     return(db.Execute("removeSubjectYear", new Dictionary <string, object>()
     {
         { "@SId", subjectId }, { "@YId", yearId }
     }, true));
 }
Example #12
0
        /// <summary>
        /// Inserts a upload data record in the UploadData table
        /// </summary>
        /// <param name="uploaddata">The upload data record</param>
        /// <returns></returns>
        public int Insert(UploadDataEntity uploaddata)
        {
            string commandText = "Insert into uploadsdata (Id, UploadId, Narration, Amount, AccountNumber, DebitOrCredit, PostingCode, TranDate, Status, TranID) values (@Id, @uploadId, @narration, @amount, @accountNo, @debitcredit, @postingCode, @tranDate, @status, @tranId)";
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("@Id", uploaddata.Id);
            parameters.Add("@uploadId", uploaddata.UploadId);
            parameters.Add("@narration", uploaddata.Narration);
            parameters.Add("@amount", uploaddata.Amount);
            parameters.Add("@accountNo", uploaddata.AccountNumber);
            parameters.Add("@debitcredit", uploaddata.Debit1Credit0);
            parameters.Add("@postingCode", uploaddata.PostingCode);
            parameters.Add("@tranDate", uploaddata.TranDate);
            parameters.Add("@status", uploaddata.Status);
            parameters.Add("@tranId", uploaddata.TranID);

            return(_database.Execute(commandText, parameters));
        }
Example #13
0
        /// <summary>
        /// Inserts a new Bank GL Account in the BankGLAccounts table
        /// </summary>
        /// <param name="bank">The Bank GL Account detail</param>
        /// <returns></returns>
        public int Insert(IdentityBankGLAccount bankGL)
        {
            string commandText = "Insert into bankglaccounts (Id, BankId, GLAccount) values (@id, @bankId, @glAccount)";
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("@bankId", bankGL.BankId);
            parameters.Add("@id", bankGL.Id);
            parameters.Add("@glAccount", bankGL.GLAccount);

            return(_database.Execute(commandText, parameters));
        }
Example #14
0
        /// <summary>
        /// Deletes all uploads linekd to branch in uploads table
        /// </summary>
        /// <param name="branchId">The branch Id</param>
        /// <returns></returns>
        public int DeleteBranchUploads(string branchId)
        {
            string commandText = "Delete from uploads where BranchId = @id";
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("@id", branchId);

            return(_database.Execute(commandText, parameters));
        }
Example #15
0
        /// <summary>
        /// Inserts a upload record in the uploads table
        /// </summary>
        /// <param name="upload">The upload record</param>
        /// <returns></returns>
        public int Insert(UploadEntity upload)
        {
            string commandText = "Insert into uploads (Id, UploaderId, BankId, BranchId, Status) values (@id, @uploaderId, @bankId, @branchId, @status)";
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("@id", upload.Id);
            parameters.Add("@uploaderId", upload.UploaderId);
            parameters.Add("@bankId", upload.BankId);
            parameters.Add("@branchId", upload.BranchId);
            parameters.Add("@status", upload.Status);

            return(_database.Execute(commandText, parameters));
        }