public static AccountingYear GetAccountingYearById(int recordId)
        {
            DataRow AccountingYearRow = AccountingYearDataAccess.GetInstance.GetAccountingYearById(recordId);

            AccountingYear TheAccountingYear = DataRowToObject(AccountingYearRow);

            return(TheAccountingYear);
        }
        //public static AccountingYear DataRowToObject(DataRow dr)
        //{
        //    AccountingYear TheAccountingYear = new AccountingYear();

        //    TheAccountingYear.ACC_YEAR_ID = int.Parse(dr["ACC_YEAR_ID"].ToString());
        //    TheAccountingYear.CURRENT_START_DATE = dr["CURRENT_START_DATE"].ToString();
        //    TheAccountingYear.CURRENT_END_DATE = dr["CURRENT_END_DATE"].ToString();
        //    TheAccountingYear.PREVIOUS_START_DATE = dr["PREVIOUS_START_DATE"].ToString();
        //    TheAccountingYear.PREVIOUS_END_DATE = dr["PREVIOUS_END_DATE"].ToString();
        //    TheAccountingYear.BOOK_CLOSING_FLAG = dr["BOOK_CLOSING_FLAG"].ToString();
        //    TheAccountingYear.YEAR_CLOSING_FLAG = dr["YEAR_CLOSING_FLAG"].ToString();
        //    TheAccountingYear.STATUS_FLAG = dr["STATUS_FLAG"].ToString();
        //    TheAccountingYear.MOD_DATE = dr["MOD_DATE"].ToString();
        //    TheAccountingYear.AUTH_CODE = dr["AUTH_CODE"].ToString();
        //    TheAccountingYear.AddedBy = int.Parse(dr["AddedBy"].ToString());
        //    TheAccountingYear.SocietyID = int.Parse(dr["SocietyID"].ToString());
        //    //TheAccountingYear.SlNo = int.Parse(dr["SlNo"].ToString());
        //    //TheAccountingYear.ForMonth = dr["ForMonth"].ToString();
        //    return TheAccountingYear;
        //}

        public static AccountingYear DataRowToObjectForMonth(DataRow dr)
        {
            AccountingYear TheAccountingYear = new AccountingYear();

            TheAccountingYear.SlNo     = int.Parse(dr["SlNo"].ToString());
            TheAccountingYear.ForMonth = dr["ForMonth"].ToString();

            return(TheAccountingYear);
        }
        public static int GetAccountingYearIDByFlag(string flag)
        {
            DataRow AccountingYearRow = AccountingYearDataAccess.GetInstance.GetAccountingYearByFlag(flag);

            AccountingYear TheAccountingYear = DataRowToObject(AccountingYearRow);
            int            AccountsYearID    = TheAccountingYear.ACC_YEAR_ID;

            return(AccountsYearID);
        }
        public static AccountingYear DataRowToObject(DataRow dr)
        {
            AccountingYear TheAccountingYear = new AccountingYear();

            TheAccountingYear.AccountingYearID          = int.Parse(dr["AccountingYearID"].ToString());
            TheAccountingYear.AccountingYearDescription = dr["AccountingYearDescription"].ToString();
            TheAccountingYear.YearStartDate             = DateTime.Parse(dr["YearStartDate"].ToString()).ToString(MicroConstants.DateFormat);
            TheAccountingYear.YearEndDate = DateTime.Parse(dr["YearEndDate"].ToString()).ToString(MicroConstants.DateFormat);

            return(TheAccountingYear);
        }
        public int DeleteAccountingYear(AccountingYear TheAccountingYear)
        {
            int ReturnValue = 0;

            SqlCommand DeleteCommand = new SqlCommand();

            DeleteCommand.CommandType = CommandType.StoredProcedure;
            DeleteCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
            DeleteCommand.Parameters.Add(GetParameter("@AccountingYearID", SqlDbType.Int, TheAccountingYear.AccountingYearID));
            DeleteCommand.CommandText = "pFIN_AccountingYears_Delete";

            ExecuteStoredProcedure(DeleteCommand);
            ReturnValue = int.Parse(DeleteCommand.Parameters[0].Value.ToString());

            return(ReturnValue);
        }
        public static List <AccountingYear> GetAllMonthsFromCurrentAccountYear()
        {
            List <AccountingYear> AccountingYearList = new List <AccountingYear>();

            DataTable AccountingYearTable = new DataTable();

            AccountingYearTable = AccountingYearDataAccess.GetInstance.GetAllMonthsFromCurrentAccountYear();

            foreach (DataRow dr in AccountingYearTable.Rows)
            {
                AccountingYear TheAccountingYear = DataRowToObjectForMonth(dr);


                AccountingYearList.Add(TheAccountingYear);
            }
            return(AccountingYearList);
        }
        public static List <AccountingYear> GetAccountingYearList(string searchText)
        {
            List <AccountingYear> AccountingYearList = new List <AccountingYear>();

            DataTable AccountingYearTable = new DataTable();

            AccountingYearTable = AccountingYearDataAccess.GetInstance.GetAccountingYearList(searchText);

            foreach (DataRow dr in AccountingYearTable.Rows)
            {
                AccountingYear TheAccountingYear = DataRowToObject(dr);


                AccountingYearList.Add(TheAccountingYear);
            }

            return(AccountingYearList);
        }
        public int InsertAccountingYear(AccountingYear TheAccountingYear)
        {
            int ReturnValue = 0;

            SqlCommand InsertCommand = new SqlCommand();

            InsertCommand.CommandType = CommandType.StoredProcedure;
            InsertCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
            InsertCommand.Parameters.Add(GetParameter("@AccountingYearDescription", SqlDbType.VarChar, TheAccountingYear.AccountingYearDescription));
            InsertCommand.Parameters.Add(GetParameter("@YearStartDate", SqlDbType.DateTime, TheAccountingYear.YearStartDate));
            InsertCommand.Parameters.Add(GetParameter("@YearEndDate", SqlDbType.DateTime, TheAccountingYear.YearEndDate));
            InsertCommand.Parameters.Add(GetParameter("@AddedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));
            InsertCommand.CommandText = "pFIN_AccountingYears_Insert";

            ExecuteStoredProcedure(InsertCommand);
            ReturnValue = int.Parse(InsertCommand.Parameters[0].Value.ToString());

            return(ReturnValue);
        }
Exemplo n.º 9
0
        public AccountingYear GetAccountingYearById(int recordId)
        {
            // VICKY : GetAccountingYearById : CACHE THIS AS DONE IF AccountGroupManagement-GetAccountGroupList()

            string         Context     = string.Format("GetAccountingYearById_{0}", recordId);
            AccountingYear AccountYear = new AccountingYear();

            if (HttpRuntime.Cache[Context] == null)
            {
                AccountYear = AccountingYearIntegration.GetAccountingYearById(recordId);
                HttpRuntime.Cache[Context] = AccountYear;
            }
            else
            {
                AccountYear = ((AccountingYear)(HttpRuntime.Cache[Context]));
            }

            return(AccountYear);
        }
Exemplo n.º 10
0
        private static void CreateTestAccountingYears(IQuiltContextFactory quiltContextFactory)
        {
            using var ctx = quiltContextFactory.Create();

            var year = DateTime.Now.Year;

            var dbAccountingYear = ctx.AccountingYears.Where(r => r.Year == year).SingleOrDefault();

            if (dbAccountingYear == null)
            {
                dbAccountingYear = new AccountingYear()
                {
                    Year = year,
                    AccountingYearStatusCode = AccountingYearStatusTypeCodes.Open
                };
                _ = ctx.AccountingYears.Add(dbAccountingYear);

                _ = ctx.SaveChanges();
            }
        }
        public int UpdateAccountingYear(AccountingYear TheAccountingYear)
        {
            int ReturnValue = 0;

            SqlCommand UpdateCommand = new SqlCommand();

            UpdateCommand.CommandType = CommandType.StoredProcedure;

            UpdateCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
            UpdateCommand.Parameters.Add(GetParameter("@AccountingYearID", SqlDbType.Int, TheAccountingYear.AccountingYearID));
            UpdateCommand.Parameters.Add(GetParameter("@AccountingYearDescription", SqlDbType.VarChar, TheAccountingYear.AccountingYearDescription));
            UpdateCommand.Parameters.Add(GetParameter("@YearStartDate", SqlDbType.DateTime, TheAccountingYear.YearStartDate));
            UpdateCommand.Parameters.Add(GetParameter("@YearEndDate", SqlDbType.DateTime, TheAccountingYear.YearEndDate));
            UpdateCommand.CommandText = "pFIN_AccountingYears_Update";

            ExecuteStoredProcedure(UpdateCommand);
            ReturnValue = int.Parse(UpdateCommand.Parameters[0].Value.ToString());

            return(ReturnValue);
        }
Exemplo n.º 12
0
        public static AccountingYear GetAccountingYearIDByFlag(string flag)
        {
            DataRow AccountingYearRow = AccountingYearDataAccess.GetInstance.GetAccountingYearByFlag(flag);

            AccountingYear TheAccountingYear = new AccountingYear();

            TheAccountingYear.ACC_YEAR_ID         = int.Parse(AccountingYearRow["ACC_YEAR_ID"].ToString());
            TheAccountingYear.CURRENT_START_DATE  = AccountingYearRow["CURRENT_START_DATE"].ToString();
            TheAccountingYear.CURRENT_END_DATE    = AccountingYearRow["CURRENT_END_DATE"].ToString();
            TheAccountingYear.PREVIOUS_START_DATE = AccountingYearRow["PREVIOUS_START_DATE"].ToString();
            TheAccountingYear.PREVIOUS_END_DATE   = AccountingYearRow["PREVIOUS_END_DATE"].ToString();
            TheAccountingYear.BOOK_CLOSING_FLAG   = AccountingYearRow["BOOK_CLOSING_FLAG"].ToString();
            TheAccountingYear.YEAR_CLOSING_FLAG   = AccountingYearRow["YEAR_CLOSING_FLAG"].ToString();
            TheAccountingYear.STATUS_FLAG         = AccountingYearRow["STATUS_FLAG"].ToString();
            TheAccountingYear.MOD_DATE            = AccountingYearRow["MOD_DATE"].ToString();
            TheAccountingYear.AUTH_CODE           = AccountingYearRow["AUTH_CODE"].ToString();
            TheAccountingYear.AddedBy             = int.Parse(AccountingYearRow["AddedBy"].ToString());
            TheAccountingYear.SocietyID           = int.Parse(AccountingYearRow["SocietyID"].ToString());

            return(TheAccountingYear);
        }
Exemplo n.º 13
0
 public int DeleteAccountingYear(AccountingYear theAccountingYear)
 {
     return(AccountingYearIntegration.DeleteAccountingYear(theAccountingYear));
 }
Exemplo n.º 14
0
 public int UpdateAccountingYear(AccountingYear theAccountingYear)
 {
     return(AccountingYearIntegration.UpdateAccountingYear(theAccountingYear));
 }
Exemplo n.º 15
0
 public int InsertAccountingYear(AccountingYear theAccountingYear)
 {
     return(AccountingYearIntegration.InsertAccountingYear(theAccountingYear));
 }
 public static int DeleteAccountingYear(AccountingYear theAccountingYear)
 {
     return(AccountingYearDataAccess.GetInstance.DeleteAccountingYear(theAccountingYear));
 }