Ejemplo n.º 1
0
        private static EmpBudgetSchedule GetItemFromReader(IDataReader dataReader)
        {
            EmpBudgetSchedule objItem = new EmpBudgetSchedule();

            objItem.Code = SqlHelper.GetString(dataReader, "Code");

            objItem.Empcode = SqlHelper.GetString(dataReader, "Empcode");

            objItem.IsEmp = SqlHelper.GetBoolean(dataReader, "IsEmp");

            objItem.Amt = SqlHelper.GetDecimal(dataReader, "Amt");

            objItem.PayDate = SqlHelper.GetDateTime(dataReader, "PayDate");

            objItem.PayType = SqlHelper.GetInt(dataReader, "PayType");

            objItem.EndDate = SqlHelper.GetDateTime(dataReader, "EndDate");

            objItem.CreatedUser = SqlHelper.GetString(dataReader, "CreatedUser");

            objItem.CreatedDate = SqlHelper.GetDateTime(dataReader, "CreatedDate");

            objItem.CurrencyID = SqlHelper.GetString(dataReader, "CurrencyID");
            objItem.frequency  = SqlHelper.GetInt(dataReader, "frequency");

            objItem.isExpense = SqlHelper.GetBoolean(dataReader, "isExpense");

            objItem.TranDesc = SqlHelper.GetString(dataReader, "TranDesc");


            objItem.Release = SqlHelper.GetBoolean(dataReader, "Release");

            return(objItem);
        }
Ejemplo n.º 2
0
        public static EmpBudgetSchedule UpdateItem(EmpBudgetSchedule model)
        {
            String result = String.Empty;

            using (var reader = SqlHelper.ExecuteReader(CommandType.StoredProcedure, "tblEmpBudgetSchedule_Update", CreateSqlParameter(model)))
            {
                while (reader.Read())
                {
                    result = (String)reader[0];
                }
            }
            return(GetItemByID(result));
        }
Ejemplo n.º 3
0
        public static EmpBudgetScheduleCollection GetAllItem()
        {
            EmpBudgetScheduleCollection collection = new EmpBudgetScheduleCollection();

            using (var reader = SqlHelper.ExecuteReader("tblEmpBudgetSchedule_GetAll", null))
            {
                while (reader.Read())
                {
                    EmpBudgetSchedule obj = new EmpBudgetSchedule();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
Ejemplo n.º 4
0
        public static EmpBudgetSchedule GetItemByID(String code)
        {
            EmpBudgetSchedule item = new EmpBudgetSchedule();
            var sqlParams          = new SqlParameter[1];

            sqlParams[0] = new SqlParameter("@Code", code);
            using (var reader = SqlHelper.ExecuteReader("tblEmpBudgetSchedule_GetByID", sqlParams))
            {
                while (reader.Read())
                {
                    item = GetItemFromReader(reader);
                }
            }
            return(item);
        }
Ejemplo n.º 5
0
        public static EmpBudgetScheduleCollection GetAllByUser(string CreatedUser, int PayType = 0)
        {
            EmpBudgetScheduleCollection collection = new EmpBudgetScheduleCollection();

            using (var reader = SqlHelper.ExecuteReader("tblEmpBudgetSchedule_GetAllByUser", new SqlParameter("@CreatedUser", CreatedUser),
                                                        new SqlParameter("@PayType", PayType)))
            {
                while (reader.Read())
                {
                    EmpBudgetSchedule obj = new EmpBudgetSchedule();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
Ejemplo n.º 6
0
 private static SqlParameter[] CreateSqlParameter(EmpBudgetSchedule model)
 {
     return(new SqlParameter[]
     {
         new SqlParameter("@Code", model.Code),
         new SqlParameter("@Empcode", model.Empcode),
         new SqlParameter("@IsEmp", model.IsEmp),
         new SqlParameter("@Amt", model.Amt),
         new SqlParameter("@PayDate", model.PayDate),
         new SqlParameter("@PayType", model.PayType),
         new SqlParameter("@EndDate", model.EndDate),
         new SqlParameter("@CreatedUser", model.CreatedUser),
         new SqlParameter("@CreatedDate", model.CreatedDate),
         new SqlParameter("@CurrencyID", model.CurrencyID),
         new SqlParameter("@frequency", model.frequency),
         new SqlParameter("@isExpense", model.isExpense),
         new SqlParameter("@TranDesc", model.TranDesc),
         new SqlParameter("@Release", model.Release),
     });
 }