public BaseMonthlyInformation GetDetails(int yearTypeID, int monthTypeID, int mainOfficeTypeID)
        {
            BaseMonthlyInformation baseMonthlyInformation = new BaseMonthlyInformation();

            SqlParameter[] parametersBaseMonthlyInformation = new SqlParameter[]
            {
                new SqlParameter("@YearTypeID", yearTypeID),
                new SqlParameter("@MonthTypeID", monthTypeID),
                new SqlParameter("@MainOfficeTypeID", mainOfficeTypeID)
            };
            using (DataTable table = SqlDBHelper.ExecuteParamerizedSelectCommand("BaseMonthlyInformation_GetDetails", CommandType.StoredProcedure, parametersBaseMonthlyInformation))
            {
                if (table.Rows.Count == 1)
                {
                    DataRow row = table.Rows[0];

                    baseMonthlyInformation.YearTypeID                 = (row["YearTypeID"] != DBNull.Value) ? Convert.ToInt32(row["YearTypeID"]) : 0;
                    baseMonthlyInformation.MonthTypeID                = (row["MonthTypeID"] != DBNull.Value) ? Convert.ToInt32(row["MonthTypeID"]) : 0;
                    baseMonthlyInformation.MainOfficeTypeID           = (row["MainOfficeTypeID"] != DBNull.Value) ? Convert.ToInt32(row["MainOfficeTypeID"]) : 0;
                    baseMonthlyInformation.ValueToScore               = (row["ValueToScore"] != DBNull.Value) ? Convert.ToDecimal(row["ValueToScore"]) : 0;
                    baseMonthlyInformation.TotalOperationalReward     = (row["TotalOperationalReward"] != DBNull.Value) ? Convert.ToInt64(row["TotalOperationalReward"]) : 0;
                    baseMonthlyInformation.TotalOrganizationalReward  = (row["TotalOrganizationalReward"] != DBNull.Value) ? Convert.ToInt64(row["TotalOrganizationalReward"]) : 0;
                    baseMonthlyInformation.ContractualDividableReward = (row["ContractualDividableReward"] != DBNull.Value) ? Convert.ToInt64(row["ContractualDividableReward"]) : 0;
                    baseMonthlyInformation.ContractualBossReward      = (row["ContractualBossReward"] != DBNull.Value) ? Convert.ToInt64(row["ContractualBossReward"]) : 0;
                    baseMonthlyInformation.ContractualDevotedReward   = (row["ContractualDevotedReward"] != DBNull.Value) ? Convert.ToInt64(row["ContractualDevotedReward"]) : 0;
                    baseMonthlyInformation.ContractualRemainingReward = (row["ContractualRemainingReward"] != DBNull.Value) ? Convert.ToInt64(row["ContractualRemainingReward"]) : 0;
                    baseMonthlyInformation.DividableReward            = (row["DividableReward"] != DBNull.Value) ? Convert.ToInt64(row["DividableReward"]) : 0;
                    baseMonthlyInformation.BossReward                 = (row["BossReward"] != DBNull.Value) ? Convert.ToInt64(row["BossReward"]) : 0;
                    baseMonthlyInformation.DevotedReward              = (row["DevotedReward"] != DBNull.Value) ? Convert.ToInt64(row["DevotedReward"]) : 0;
                    baseMonthlyInformation.RemainingReward            = (row["RemainingReward"] != DBNull.Value) ? Convert.ToInt64(row["RemainingReward"]) : 0;
                    baseMonthlyInformation.YearTypeIDTitle            = row["YearTypeIDTitle"].ToString();
                    baseMonthlyInformation.MonthTypeIDTitle           = row["MonthTypeIDTitle"].ToString();
                    baseMonthlyInformation.ContractualReward          = (row["ContractualReward"] != DBNull.Value) ? Convert.ToInt64(row["ContractualReward"]) : 0;
                    baseMonthlyInformation.ContractualConstantReward  = (row["ContractualConstantReward"] != DBNull.Value) ? Convert.ToInt64(row["ContractualConstantReward"]) : 0;
                    baseMonthlyInformation.ExtraReward                = (row["ExtraReward"] != DBNull.Value) ? Convert.ToInt64(row["ExtraReward"]) : 0;
                    baseMonthlyInformation.Factor5        = (row["Factor5"] != DBNull.Value) ? Convert.ToDecimal(row["Factor5"]) : 0;
                    baseMonthlyInformation.Factor6        = (row["Factor6"] != DBNull.Value) ? Convert.ToDecimal(row["Factor6"]) : 0;
                    baseMonthlyInformation.Factor7        = (row["Factor7"] != DBNull.Value) ? Convert.ToDecimal(row["Factor7"]) : 0;
                    baseMonthlyInformation.Factor8        = (row["Factor8"] != DBNull.Value) ? Convert.ToDecimal(row["Factor8"]) : 0;
                    baseMonthlyInformation.Factor9        = (row["Factor9"] != DBNull.Value) ? Convert.ToDecimal(row["Factor9"]) : 0;
                    baseMonthlyInformation.Factor10       = (row["Factor10"] != DBNull.Value) ? Convert.ToDecimal(row["Factor10"]) : 0;
                    baseMonthlyInformation.OfficialReward = (row["OfficialReward"] != DBNull.Value) ? Convert.ToInt64(row["OfficialReward"]) : 0;
                    baseMonthlyInformation.IsFanalized    = (row["IsFanalized"] != DBNull.Value) ? Convert.ToBoolean((row["IsFanalized"].ToString() == "1" || row["IsFanalized"].ToString().ToLower() == "true") ? true : false) : false;
                    baseMonthlyInformation.IsFainalizedEmployeesInformation = (row["IsFainalizedEmployeesInformation"] != DBNull.Value) ? Convert.ToBoolean((row["IsFainalizedEmployeesInformation"].ToString() == "1" || row["IsFainalizedEmployeesInformation"].ToString().ToLower() == "true") ? true : false) : false;
                    baseMonthlyInformation.IsFainalizedRewardCalculation    = (row["IsFainalizedRewardCalculation"] != DBNull.Value) ? Convert.ToBoolean((row["IsFainalizedRewardCalculation"].ToString() == "1" || row["IsFainalizedRewardCalculation"].ToString().ToLower() == "true") ? true : false) : false;
                    baseMonthlyInformation.BossFactor        = (row["BossFactor"] != DBNull.Value) ? Convert.ToDecimal(row["BossFactor"]) : 0;
                    baseMonthlyInformation.OperationalFactor = (row["OperationalFactor"] != DBNull.Value) ? Convert.ToDecimal(row["OperationalFactor"]) : 0;
                    baseMonthlyInformation.Factor1           = (row["Factor1"] != DBNull.Value) ? Convert.ToDecimal(row["Factor1"]) : 0;
                    baseMonthlyInformation.Factor2           = (row["Factor2"] != DBNull.Value) ? Convert.ToDecimal(row["Factor2"]) : 0;
                    baseMonthlyInformation.Factor3           = (row["Factor3"] != DBNull.Value) ? Convert.ToDecimal(row["Factor3"]) : 0;
                    baseMonthlyInformation.Factor4           = (row["Factor4"] != DBNull.Value) ? Convert.ToDecimal(row["Factor4"]) : 0;
                }
            }

            return(baseMonthlyInformation);
        }
 public bool Exists(int yearTypeID, int monthTypeID, Int64 nationalCode)
 {
     SqlParameter[] parametersContractualEmployeeReward = new SqlParameter[]
     {
         new SqlParameter("@YearTypeID", yearTypeID),
         new SqlParameter("@MonthTypeID", monthTypeID),
         new SqlParameter("@NationalCode", nationalCode)
     };
     return(SqlDBHelper.ExecuteScalar("ContractualEmployeeReward_Exists", CommandType.StoredProcedure, parametersContractualEmployeeReward) > 0);
 }
示例#3
0
 public Int64 Insert(AdjutancyType adjutancyType)
 {
     SqlParameter[] parametersAdjutancyType = new SqlParameter[]
     {
         new SqlParameter("@AdjutantNationalCode", (adjutancyType.AdjutantNationalCode != null) ? adjutancyType.AdjutantNationalCode : (object)DBNull.Value),
         new SqlParameter("@Title", (adjutancyType.Title != null) ? adjutancyType.Title : (object)DBNull.Value)
     };
     adjutancyType.AdjutancyTypeID = Convert.ToInt32(SqlDBHelper.ExecuteScalar("AdjutancyType_Insert", CommandType.StoredProcedure, parametersAdjutancyType));
     return(adjutancyType.AdjutancyTypeID);
 }
示例#4
0
 public bool Update(AdjutancyType adjutancyType)
 {
     SqlParameter[] parametersAdjutancyType = new SqlParameter[]
     {
         new SqlParameter("@AdjutancyTypeID", adjutancyType.AdjutancyTypeID),
         new SqlParameter("@AdjutantNationalCode", (adjutancyType.AdjutantNationalCode != null) ? adjutancyType.AdjutantNationalCode : (object)DBNull.Value),
         new SqlParameter("@Title", (adjutancyType.Title != null) ? adjutancyType.Title : (object)DBNull.Value)
     };
     return(SqlDBHelper.ExecuteNonQuery("AdjutancyType_Update", CommandType.StoredProcedure, parametersAdjutancyType));
 }
 public bool Exists(OfficialEmployeeReward officialEmployeeReward)
 {
     SqlParameter[] parametersOfficialEmployeeReward = new SqlParameter[]
     {
         new SqlParameter("@NationalCode", officialEmployeeReward.NationalCode),
         new SqlParameter("@YearTypeID", officialEmployeeReward.YearTypeID),
         new SqlParameter("@MonthTypeID", officialEmployeeReward.MonthTypeID)
     };
     return(SqlDBHelper.ExecuteScalar("OfficialEmployeeReward_Exists", CommandType.StoredProcedure, parametersOfficialEmployeeReward) > 0);
 }
 public bool Delete(Int64 nationalCode, int yearTypeID, int monthTypeID)
 {
     SqlParameter[] parametersOfficialEmployeeReward = new SqlParameter[]
     {
         new SqlParameter("@NationalCode", nationalCode),
         new SqlParameter("@YearTypeID", yearTypeID),
         new SqlParameter("@MonthTypeID", monthTypeID)
     };
     return(SqlDBHelper.ExecuteNonQuery("OfficialEmployeeReward_Delete", CommandType.StoredProcedure, parametersOfficialEmployeeReward));
 }
 public bool Update(RoleType roleType)
 {
     SqlParameter[] parametersRoleType = new SqlParameter[]
     {
         new SqlParameter("@RoleTypeID", roleType.RoleTypeID),
         new SqlParameter("@Factor", roleType.Factor),
         new SqlParameter("@Title", roleType.Title)
     };
     return(SqlDBHelper.ExecuteNonQuery("RoleType_Update", CommandType.StoredProcedure, parametersRoleType));
 }
 public Int64 Insert(RoleType roleType)
 {
     SqlParameter[] parametersRoleType = new SqlParameter[]
     {
         new SqlParameter("@Factor", roleType.Factor),
         new SqlParameter("@Title", roleType.Title)
     };
     roleType.RoleTypeID = Convert.ToInt32(SqlDBHelper.ExecuteScalar("RoleType_Insert", CommandType.StoredProcedure, parametersRoleType));
     return(roleType.RoleTypeID);
 }
 public bool Delete(int yearTypeID, int monthTypeID, int mainOfficeTypeID)
 {
     SqlParameter[] parametersBaseMonthlyInformation = new SqlParameter[]
     {
         new SqlParameter("@YearTypeID", yearTypeID),
         new SqlParameter("@MonthTypeID", monthTypeID),
         new SqlParameter("@MainOfficeTypeID", mainOfficeTypeID)
     };
     return(SqlDBHelper.ExecuteNonQuery("BaseMonthlyInformation_Delete", CommandType.StoredProcedure, parametersBaseMonthlyInformation));
 }
 public bool Exists(BaseMonthlyInformation baseMonthlyInformation)
 {
     SqlParameter[] parametersBaseMonthlyInformation = new SqlParameter[]
     {
         new SqlParameter("@YearTypeID", baseMonthlyInformation.YearTypeID),
         new SqlParameter("@MonthTypeID", baseMonthlyInformation.MonthTypeID),
         new SqlParameter("@MainOfficeTypeID", baseMonthlyInformation.MainOfficeTypeID)
     };
     return(SqlDBHelper.ExecuteScalar("BaseMonthlyInformation_Exists", CommandType.StoredProcedure, parametersBaseMonthlyInformation) > 0);
 }
        public List <ContractualEmployeeReward> SearchLike(ContractualEmployeeReward contractualEmployeeReward)
        {
            List <ContractualEmployeeReward> listContractualEmployeeReward = new List <ContractualEmployeeReward>();


            SqlParameter[] parametersContractualEmployeeReward = new SqlParameter[]
            {
                new SqlParameter("@YearTypeID", contractualEmployeeReward.YearTypeID),
                new SqlParameter("@MonthTypeID", contractualEmployeeReward.MonthTypeID),
                new SqlParameter("@NationalCode", contractualEmployeeReward.NationalCode),
                new SqlParameter("@TotalReward", contractualEmployeeReward.TotalReward),
                new SqlParameter("@Reward_", contractualEmployeeReward.Reward_),
                new SqlParameter("@EmployeeFullName", contractualEmployeeReward.EmployeeFullName),
                new SqlParameter("@DepartmentIDTitle", contractualEmployeeReward.DepartmentIDTitle),
                new SqlParameter("@YearTypeIDTitle", contractualEmployeeReward.YearTypeIDTitle),
                new SqlParameter("@MonthTypeIDTitle", contractualEmployeeReward.MonthTypeIDTitle),
                new SqlParameter("@Reward", contractualEmployeeReward.Reward),
                new SqlParameter("@BossFinalValue", contractualEmployeeReward.BossFinalValue),
                new SqlParameter("@AssistantFinalValue", contractualEmployeeReward.AssistantFinalValue),
                new SqlParameter("@ManagerFinalValue", contractualEmployeeReward.ManagerFinalValue),
                new SqlParameter("@ExtraReward1", contractualEmployeeReward.ExtraReward1),
                new SqlParameter("@ExtraReward2", contractualEmployeeReward.ExtraReward2),
                new SqlParameter("@ExtraReward3", contractualEmployeeReward.ExtraReward3),
            };
            using (DataTable table = SqlDBHelper.ExecuteParamerizedSelectCommand("ContractualEmployeeReward_SearchLike", CommandType.StoredProcedure, parametersContractualEmployeeReward))
            {
                if (table.Rows.Count > 0)
                {
                    foreach (DataRow row in table.Rows)
                    {
                        ContractualEmployeeReward tmpContractualEmployeeReward = new ContractualEmployeeReward();
                        tmpContractualEmployeeReward.YearTypeID          = (row["YearTypeID"] != DBNull.Value) ? Convert.ToInt32(row["YearTypeID"]) : 0;
                        tmpContractualEmployeeReward.MonthTypeID         = (row["MonthTypeID"] != DBNull.Value) ? Convert.ToInt32(row["MonthTypeID"]) : 0;
                        tmpContractualEmployeeReward.NationalCode        = (row["NationalCode"] != DBNull.Value) ? Convert.ToInt64(row["NationalCode"]) : 0;
                        tmpContractualEmployeeReward.TotalReward         = (row["TotalReward"] != DBNull.Value) ? Convert.ToInt64(row["TotalReward"]) : 0;
                        tmpContractualEmployeeReward.Reward_             = (row["Reward_"] != DBNull.Value) ? Convert.ToInt64(row["Reward_"]) : 0;
                        tmpContractualEmployeeReward.EmployeeFullName    = row["EmployeeFullName"].ToString();
                        tmpContractualEmployeeReward.DepartmentIDTitle   = row["DepartmentIDTitle"].ToString();
                        tmpContractualEmployeeReward.YearTypeIDTitle     = row["YearTypeIDTitle"].ToString();
                        tmpContractualEmployeeReward.MonthTypeIDTitle    = row["MonthTypeIDTitle"].ToString();
                        tmpContractualEmployeeReward.Reward              = (row["Reward"] != DBNull.Value) ? Convert.ToInt64(row["Reward"]) : 0;
                        tmpContractualEmployeeReward.BossFinalValue      = (row["BossFinalValue"] != DBNull.Value) ? Convert.ToInt64(row["BossFinalValue"]) : 0;
                        tmpContractualEmployeeReward.AssistantFinalValue = (row["AssistantFinalValue"] != DBNull.Value) ? Convert.ToInt64(row["AssistantFinalValue"]) : 0;
                        tmpContractualEmployeeReward.ManagerFinalValue   = (row["ManagerFinalValue"] != DBNull.Value) ? Convert.ToInt64(row["ManagerFinalValue"]) : 0;
                        tmpContractualEmployeeReward.ExtraReward1        = (row["ExtraReward1"] != DBNull.Value) ? Convert.ToInt64(row["ExtraReward1"]) : 0;
                        tmpContractualEmployeeReward.ExtraReward2        = (row["ExtraReward2"] != DBNull.Value) ? Convert.ToInt64(row["ExtraReward2"]) : 0;
                        tmpContractualEmployeeReward.ExtraReward3        = (row["ExtraReward3"] != DBNull.Value) ? Convert.ToInt64(row["ExtraReward3"]) : 0;

                        listContractualEmployeeReward.Add(tmpContractualEmployeeReward);
                    }
                }
            }

            return(listContractualEmployeeReward);
        }
        public List <BaseMonthlyInformation> GetListAll()
        {
            List <BaseMonthlyInformation> listBaseMonthlyInformation = null;

            using (DataTable table = SqlDBHelper.ExecuteSelectCommand("BaseMonthlyInformation_GetListAll", CommandType.StoredProcedure))
            {
                if (table.Rows.Count > 0)
                {
                    listBaseMonthlyInformation = new List <BaseMonthlyInformation>();

                    foreach (DataRow row in table.Rows)
                    {
                        BaseMonthlyInformation baseMonthlyInformation = new BaseMonthlyInformation();
                        baseMonthlyInformation.YearTypeID                 = (row["YearTypeID"] != DBNull.Value) ? Convert.ToInt32(row["YearTypeID"]) : 0;
                        baseMonthlyInformation.MonthTypeID                = (row["MonthTypeID"] != DBNull.Value) ? Convert.ToInt32(row["MonthTypeID"]) : 0;
                        baseMonthlyInformation.MainOfficeTypeID           = (row["MainOfficeTypeID"] != DBNull.Value) ? Convert.ToInt32(row["MainOfficeTypeID"]) : 0;
                        baseMonthlyInformation.ValueToScore               = (row["ValueToScore"] != DBNull.Value) ? Convert.ToDecimal(row["ValueToScore"]) : 0;
                        baseMonthlyInformation.TotalOperationalReward     = (row["TotalOperationalReward"] != DBNull.Value) ? Convert.ToInt64(row["TotalOperationalReward"]) : 0;
                        baseMonthlyInformation.TotalOrganizationalReward  = (row["TotalOrganizationalReward"] != DBNull.Value) ? Convert.ToInt64(row["TotalOrganizationalReward"]) : 0;
                        baseMonthlyInformation.ContractualDividableReward = (row["ContractualDividableReward"] != DBNull.Value) ? Convert.ToInt64(row["ContractualDividableReward"]) : 0;
                        baseMonthlyInformation.ContractualBossReward      = (row["ContractualBossReward"] != DBNull.Value) ? Convert.ToInt64(row["ContractualBossReward"]) : 0;
                        baseMonthlyInformation.ContractualDevotedReward   = (row["ContractualDevotedReward"] != DBNull.Value) ? Convert.ToInt64(row["ContractualDevotedReward"]) : 0;
                        baseMonthlyInformation.ContractualRemainingReward = (row["ContractualRemainingReward"] != DBNull.Value) ? Convert.ToInt64(row["ContractualRemainingReward"]) : 0;
                        baseMonthlyInformation.DividableReward            = (row["DividableReward"] != DBNull.Value) ? Convert.ToInt64(row["DividableReward"]) : 0;
                        baseMonthlyInformation.BossReward                 = (row["BossReward"] != DBNull.Value) ? Convert.ToInt64(row["BossReward"]) : 0;
                        baseMonthlyInformation.DevotedReward              = (row["DevotedReward"] != DBNull.Value) ? Convert.ToInt64(row["DevotedReward"]) : 0;
                        baseMonthlyInformation.RemainingReward            = (row["RemainingReward"] != DBNull.Value) ? Convert.ToInt64(row["RemainingReward"]) : 0;
                        baseMonthlyInformation.YearTypeIDTitle            = row["YearTypeIDTitle"].ToString();
                        baseMonthlyInformation.MonthTypeIDTitle           = row["MonthTypeIDTitle"].ToString();
                        baseMonthlyInformation.ContractualReward          = (row["ContractualReward"] != DBNull.Value) ? Convert.ToInt64(row["ContractualReward"]) : 0;
                        baseMonthlyInformation.ContractualConstantReward  = (row["ContractualConstantReward"] != DBNull.Value) ? Convert.ToInt64(row["ContractualConstantReward"]) : 0;
                        baseMonthlyInformation.ExtraReward                = (row["ExtraReward"] != DBNull.Value) ? Convert.ToInt64(row["ExtraReward"]) : 0;
                        baseMonthlyInformation.Factor5        = (row["Factor5"] != DBNull.Value) ? Convert.ToDecimal(row["Factor5"]) : 0;
                        baseMonthlyInformation.Factor6        = (row["Factor6"] != DBNull.Value) ? Convert.ToDecimal(row["Factor6"]) : 0;
                        baseMonthlyInformation.Factor7        = (row["Factor7"] != DBNull.Value) ? Convert.ToDecimal(row["Factor7"]) : 0;
                        baseMonthlyInformation.Factor8        = (row["Factor8"] != DBNull.Value) ? Convert.ToDecimal(row["Factor8"]) : 0;
                        baseMonthlyInformation.Factor9        = (row["Factor9"] != DBNull.Value) ? Convert.ToDecimal(row["Factor9"]) : 0;
                        baseMonthlyInformation.Factor10       = (row["Factor10"] != DBNull.Value) ? Convert.ToDecimal(row["Factor10"]) : 0;
                        baseMonthlyInformation.OfficialReward = (row["OfficialReward"] != DBNull.Value) ? Convert.ToInt64(row["OfficialReward"]) : 0;
                        baseMonthlyInformation.IsFanalized    = (row["IsFanalized"] != DBNull.Value) ? Convert.ToBoolean((row["IsFanalized"].ToString() == "1" || row["IsFanalized"].ToString().ToLower() == "true") ? true : false) : false;
                        baseMonthlyInformation.IsFainalizedEmployeesInformation = (row["IsFainalizedEmployeesInformation"] != DBNull.Value) ? Convert.ToBoolean((row["IsFainalizedEmployeesInformation"].ToString() == "1" || row["IsFainalizedEmployeesInformation"].ToString().ToLower() == "true") ? true : false) : false;
                        baseMonthlyInformation.IsFainalizedRewardCalculation    = (row["IsFainalizedRewardCalculation"] != DBNull.Value) ? Convert.ToBoolean((row["IsFainalizedRewardCalculation"].ToString() == "1" || row["IsFainalizedRewardCalculation"].ToString().ToLower() == "true") ? true : false) : false;
                        baseMonthlyInformation.BossFactor        = (row["BossFactor"] != DBNull.Value) ? Convert.ToDecimal(row["BossFactor"]) : 0;
                        baseMonthlyInformation.OperationalFactor = (row["OperationalFactor"] != DBNull.Value) ? Convert.ToDecimal(row["OperationalFactor"]) : 0;
                        baseMonthlyInformation.Factor1           = (row["Factor1"] != DBNull.Value) ? Convert.ToDecimal(row["Factor1"]) : 0;
                        baseMonthlyInformation.Factor2           = (row["Factor2"] != DBNull.Value) ? Convert.ToDecimal(row["Factor2"]) : 0;
                        baseMonthlyInformation.Factor3           = (row["Factor3"] != DBNull.Value) ? Convert.ToDecimal(row["Factor3"]) : 0;
                        baseMonthlyInformation.Factor4           = (row["Factor4"] != DBNull.Value) ? Convert.ToDecimal(row["Factor4"]) : 0;
                        listBaseMonthlyInformation.Add(baseMonthlyInformation);
                    }
                }
            }

            return(listBaseMonthlyInformation);
        }
 public bool Update(MainOfficeType mainOfficeType)
 {
     SqlParameter[] parametersMainOfficeType = new SqlParameter[]
     {
         new SqlParameter("@MainOfficeTypeID", mainOfficeType.MainOfficeTypeID),
         new SqlParameter("@Title", mainOfficeType.Title),
         new SqlParameter("@TotalScore", (mainOfficeType.TotalScore != null) ? mainOfficeType.TotalScore : (object)DBNull.Value),
         new SqlParameter("@TotalScoreCat1", (mainOfficeType.TotalScoreCat1 != null) ? mainOfficeType.TotalScoreCat1 : (object)DBNull.Value),
         new SqlParameter("@TotalScoreCat2", (mainOfficeType.TotalScoreCat2 != null) ? mainOfficeType.TotalScoreCat2 : (object)DBNull.Value)
     };
     return(SqlDBHelper.ExecuteNonQuery("MainOfficeType_Update", CommandType.StoredProcedure, parametersMainOfficeType));
 }
 public Int64 Insert(MainOfficeType mainOfficeType)
 {
     SqlParameter[] parametersMainOfficeType = new SqlParameter[]
     {
         new SqlParameter("@Title", mainOfficeType.Title),
         new SqlParameter("@TotalScore", (mainOfficeType.TotalScore != null) ? mainOfficeType.TotalScore : (object)DBNull.Value),
         new SqlParameter("@TotalScoreCat1", (mainOfficeType.TotalScoreCat1 != null) ? mainOfficeType.TotalScoreCat1 : (object)DBNull.Value),
         new SqlParameter("@TotalScoreCat2", (mainOfficeType.TotalScoreCat2 != null) ? mainOfficeType.TotalScoreCat2 : (object)DBNull.Value)
     };
     mainOfficeType.MainOfficeTypeID = Convert.ToInt32(SqlDBHelper.ExecuteScalar("MainOfficeType_Insert", CommandType.StoredProcedure, parametersMainOfficeType));
     return(mainOfficeType.MainOfficeTypeID);
 }
示例#15
0
        public bool Update(User user)
        {
            employeeDBAccess.Update(user);

            SqlParameter[] parametersUser = new SqlParameter[]
            {
                new SqlParameter("@NationalCode", user.NationalCode),
                new SqlParameter("@Password", (user.Password != null) ? user.Password : (object)DBNull.Value),
                new SqlParameter("@LastPassChangeDate", (user.LastPassChangeDate != null) ? user.LastPassChangeDate : (object)DBNull.Value),
                new SqlParameter("@IsActiveUser", (user.IsActiveUser != null) ? user.IsActiveUser : (object)DBNull.Value)
            };
            return(SqlDBHelper.ExecuteNonQuery("User_Update", CommandType.StoredProcedure, parametersUser));
        }
示例#16
0
        public List <Employee> SearchLike(Employee employee)
        {
            List <Employee> listEmployee = new List <Employee>();


            SqlParameter[] parametersEmployee = new SqlParameter[]
            {
                new SqlParameter("@NationalCode", employee.NationalCode),
                new SqlParameter("@ContractTypeIDTitle", employee.ContractTypeIDTitle),
                new SqlParameter("@RoleTypeIDTitle", employee.RoleTypeIDTitle),
                new SqlParameter("@FullName", employee.FullName),
                new SqlParameter("@DepartmentIDTitle", employee.DepartmentIDTitle),
                new SqlParameter("@RoleTypeIDFactor", employee.RoleTypeIDFactor),
                new SqlParameter("@PersonalCode", employee.PersonalCode),
                new SqlParameter("@FirstName", employee.FirstName),
                new SqlParameter("@LastName", employee.LastName),
                new SqlParameter("@AccountNumber", employee.AccountNumber),
                new SqlParameter("@ContractTypeID", employee.ContractTypeID),
                new SqlParameter("@RoleTypeID", employee.RoleTypeID),
                new SqlParameter("@DepartmentID", employee.DepartmentID),
                new SqlParameter("@IsActiveEmployee", employee.IsActiveEmployee),
            };
            using (DataTable table = SqlDBHelper.ExecuteParamerizedSelectCommand("Employee_SearchLike", CommandType.StoredProcedure, parametersEmployee))
            {
                if (table.Rows.Count > 0)
                {
                    foreach (DataRow row in table.Rows)
                    {
                        Employee tmpEmployee = new Employee();
                        tmpEmployee.NationalCode        = (row["NationalCode"] != DBNull.Value) ? Convert.ToInt64(row["NationalCode"]) : 0;
                        tmpEmployee.ContractTypeIDTitle = row["ContractTypeIDTitle"].ToString();
                        tmpEmployee.RoleTypeIDTitle     = row["RoleTypeIDTitle"].ToString();
                        tmpEmployee.FullName            = row["FullName"].ToString();
                        tmpEmployee.DepartmentIDTitle   = row["DepartmentIDTitle"].ToString();
                        tmpEmployee.RoleTypeIDFactor    = (row["RoleTypeIDFactor"] != DBNull.Value) ? Convert.ToDecimal(row["RoleTypeIDFactor"]) : 0;
                        tmpEmployee.PersonalCode        = row["PersonalCode"].ToString();
                        tmpEmployee.FirstName           = row["FirstName"].ToString();
                        tmpEmployee.LastName            = row["LastName"].ToString();
                        tmpEmployee.AccountNumber       = row["AccountNumber"].ToString();
                        tmpEmployee.ContractTypeID      = (row["ContractTypeID"] != DBNull.Value) ? Convert.ToInt32(row["ContractTypeID"]) : 0;
                        tmpEmployee.RoleTypeID          = (row["RoleTypeID"] != DBNull.Value) ? Convert.ToInt32(row["RoleTypeID"]) : 0;
                        tmpEmployee.DepartmentID        = (row["DepartmentID"] != DBNull.Value) ? Convert.ToInt32(row["DepartmentID"]) : 0;
                        tmpEmployee.IsActiveEmployee    = (row["IsActiveEmployee"] != DBNull.Value) ? Convert.ToBoolean((row["IsActiveEmployee"].ToString() == "1" || row["IsActiveEmployee"].ToString().ToLower() == "true") ? true : false) : false;

                        listEmployee.Add(tmpEmployee);
                    }
                }
            }

            return(listEmployee);
        }
        public List <Department> SearchLike(Department department)
        {
            List <Department> listDepartment = new List <Department>();


            SqlParameter[] parametersDepartment = new SqlParameter[]
            {
                new SqlParameter("@DepartmentID", department.DepartmentID),
                new SqlParameter("@DividerFullName", department.DividerFullName),
                new SqlParameter("@ComputationTypeIDTitle", department.ComputationTypeIDTitle),
                new SqlParameter("@MainOfficeTypeIDTitle", department.MainOfficeTypeIDTitle),
                new SqlParameter("@AdjutancyTypeIDTitle", department.AdjutancyTypeIDTitle),
                new SqlParameter("@ComputationTypeID", department.ComputationTypeID),
                new SqlParameter("@MainOfficeTypeID", department.MainOfficeTypeID),
                new SqlParameter("@AdjutancyTypeID", department.AdjutancyTypeID),
                new SqlParameter("@TotalEmployeeNumber", department.TotalEmployeeNumber),
                new SqlParameter("@TotalContractualEmployeeNumber", department.TotalContractualEmployeeNumber),
                new SqlParameter("@TotalPersonalScore", department.TotalPersonalScore),
                new SqlParameter("@DividerNationalCode", department.DividerNationalCode),
                new SqlParameter("@Title", department.Title),
            };
            using (DataTable table = SqlDBHelper.ExecuteParamerizedSelectCommand("Department_SearchLike", CommandType.StoredProcedure, parametersDepartment))
            {
                if (table.Rows.Count > 0)
                {
                    foreach (DataRow row in table.Rows)
                    {
                        Department tmpDepartment = new Department();
                        tmpDepartment.DepartmentID                   = (row["DepartmentID"] != DBNull.Value) ? Convert.ToInt32(row["DepartmentID"]) : 0;
                        tmpDepartment.DividerFullName                = row["DividerFullName"].ToString();
                        tmpDepartment.ComputationTypeIDTitle         = row["ComputationTypeIDTitle"].ToString();
                        tmpDepartment.MainOfficeTypeIDTitle          = row["MainOfficeTypeIDTitle"].ToString();
                        tmpDepartment.AdjutancyTypeIDTitle           = row["AdjutancyTypeIDTitle"].ToString();
                        tmpDepartment.ComputationTypeID              = (row["ComputationTypeID"] != DBNull.Value) ? Convert.ToInt32(row["ComputationTypeID"]) : 0;
                        tmpDepartment.MainOfficeTypeID               = (row["MainOfficeTypeID"] != DBNull.Value) ? Convert.ToInt32(row["MainOfficeTypeID"]) : 0;
                        tmpDepartment.AdjutancyTypeID                = (row["AdjutancyTypeID"] != DBNull.Value) ? Convert.ToInt32(row["AdjutancyTypeID"]) : 0;
                        tmpDepartment.TotalEmployeeNumber            = (row["TotalEmployeeNumber"] != DBNull.Value) ? Convert.ToInt32(row["TotalEmployeeNumber"]) : 0;
                        tmpDepartment.TotalContractualEmployeeNumber = (row["TotalContractualEmployeeNumber"] != DBNull.Value) ? Convert.ToInt32(row["TotalContractualEmployeeNumber"]) : 0;
                        tmpDepartment.TotalPersonalScore             = (row["TotalPersonalScore"] != DBNull.Value) ? Convert.ToDecimal(row["TotalPersonalScore"]) : 0;
                        tmpDepartment.DividerNationalCode            = (row["DividerNationalCode"] != DBNull.Value) ? Convert.ToInt64(row["DividerNationalCode"]) : 0;
                        tmpDepartment.Title = row["Title"].ToString();

                        listDepartment.Add(tmpDepartment);
                    }
                }
            }

            return(listDepartment);
        }
 public Int64 Insert(Department department)
 {
     SqlParameter[] parametersDepartment = new SqlParameter[]
     {
         new SqlParameter("@ComputationTypeID", (department.ComputationTypeID > 0) ? department.ComputationTypeID : (object)DBNull.Value),
         new SqlParameter("@MainOfficeTypeID", (department.MainOfficeTypeID > 0) ? department.MainOfficeTypeID : (object)DBNull.Value),
         new SqlParameter("@AdjutancyTypeID", (department.AdjutancyTypeID > 0) ? department.AdjutancyTypeID : (object)DBNull.Value),
         new SqlParameter("@TotalEmployeeNumber", (department.TotalEmployeeNumber != null) ? department.TotalEmployeeNumber : (object)DBNull.Value),
         new SqlParameter("@TotalContractualEmployeeNumber", (department.TotalContractualEmployeeNumber != null) ? department.TotalContractualEmployeeNumber : (object)DBNull.Value),
         new SqlParameter("@TotalPersonalScore", (department.TotalPersonalScore != null) ? department.TotalPersonalScore : (object)DBNull.Value),
         new SqlParameter("@DividerNationalCode", (department.DividerNationalCode != null) ? department.DividerNationalCode : (object)DBNull.Value),
         new SqlParameter("@Title", department.Title)
     };
     department.DepartmentID = Convert.ToInt32(SqlDBHelper.ExecuteScalar("Department_Insert", CommandType.StoredProcedure, parametersDepartment));
     return(department.DepartmentID);
 }
示例#19
0
        public Int64 Insert(User user)
        {
            if (!employeeDBAccess.Exists(user))
            {
                user.NationalCode = employeeDBAccess.Insert(user);
            }

            SqlParameter[] parametersUser = new SqlParameter[]
            {
                new SqlParameter("@NationalCode", (user.NationalCode > 0) ? user.NationalCode : (object)DBNull.Value),
                new SqlParameter("@Password", (user.Password != null) ? user.Password : (object)DBNull.Value),
                new SqlParameter("@LastPassChangeDate", (user.LastPassChangeDate != null) ? user.LastPassChangeDate : (object)DBNull.Value),
                new SqlParameter("@IsActiveUser", (user.IsActiveUser != null) ? user.IsActiveUser : (object)DBNull.Value)
            };
            return(SqlDBHelper.ExecuteScalar("User_Insert", CommandType.StoredProcedure, parametersUser));
        }
 public bool Update(Department department)
 {
     SqlParameter[] parametersDepartment = new SqlParameter[]
     {
         new SqlParameter("@DepartmentID", department.DepartmentID),
         new SqlParameter("@ComputationTypeID", (department.ComputationTypeID != null && department.ComputationTypeID > 0) ? department.ComputationTypeID : (object)DBNull.Value),
         new SqlParameter("@MainOfficeTypeID", department.MainOfficeTypeID),
         new SqlParameter("@AdjutancyTypeID", (department.AdjutancyTypeID != null && department.AdjutancyTypeID > 0) ? department.AdjutancyTypeID : (object)DBNull.Value),
         new SqlParameter("@TotalEmployeeNumber", (department.TotalEmployeeNumber != null) ? department.TotalEmployeeNumber : (object)DBNull.Value),
         new SqlParameter("@TotalContractualEmployeeNumber", (department.TotalContractualEmployeeNumber != null) ? department.TotalContractualEmployeeNumber : (object)DBNull.Value),
         new SqlParameter("@TotalPersonalScore", (department.TotalPersonalScore != null) ? department.TotalPersonalScore : (object)DBNull.Value),
         new SqlParameter("@DividerNationalCode", (department.DividerNationalCode != null) ? department.DividerNationalCode : (object)DBNull.Value),
         new SqlParameter("@Title", department.Title)
     };
     return(SqlDBHelper.ExecuteNonQuery("Department_Update", CommandType.StoredProcedure, parametersDepartment));
 }
示例#21
0
 public bool Update(Employee employee)
 {
     SqlParameter[] parametersEmployee = new SqlParameter[]
     {
         new SqlParameter("@NationalCode", employee.NationalCode),
         new SqlParameter("@PersonalCode", (employee.PersonalCode != null) ? employee.PersonalCode : (object)DBNull.Value),
         new SqlParameter("@FirstName", employee.FirstName),
         new SqlParameter("@LastName", employee.LastName),
         new SqlParameter("@AccountNumber", (employee.AccountNumber != null) ? employee.AccountNumber : (object)DBNull.Value),
         new SqlParameter("@ContractTypeID", (employee.ContractTypeID != null && employee.ContractTypeID > 0) ? employee.ContractTypeID : (object)DBNull.Value),
         new SqlParameter("@RoleTypeID", (employee.RoleTypeID != null && employee.RoleTypeID > 0) ? employee.RoleTypeID : (object)DBNull.Value),
         new SqlParameter("@DepartmentID", (employee.DepartmentID != null && employee.DepartmentID > 0) ? employee.DepartmentID : (object)DBNull.Value),
         new SqlParameter("@IsActiveEmployee", employee.IsActiveEmployee)
     };
     return(SqlDBHelper.ExecuteNonQuery("Employee_Update", CommandType.StoredProcedure, parametersEmployee));
 }
 public bool Update(ContractualEmployeeReward contractualEmployeeReward)
 {
     SqlParameter[] parametersContractualEmployeeReward = new SqlParameter[]
     {
         new SqlParameter("@YearTypeID", contractualEmployeeReward.YearTypeID),
         new SqlParameter("@MonthTypeID", contractualEmployeeReward.MonthTypeID),
         new SqlParameter("@NationalCode", contractualEmployeeReward.NationalCode),
         new SqlParameter("@Reward", contractualEmployeeReward.Reward),
         new SqlParameter("@BossFinalValue", contractualEmployeeReward.BossFinalValue),
         new SqlParameter("@AssistantFinalValue", contractualEmployeeReward.AssistantFinalValue),
         new SqlParameter("@ManagerFinalValue", contractualEmployeeReward.ManagerFinalValue),
         new SqlParameter("@ExtraReward1", contractualEmployeeReward.ExtraReward1),
         new SqlParameter("@ExtraReward2", contractualEmployeeReward.ExtraReward2),
         new SqlParameter("@ExtraReward3", contractualEmployeeReward.ExtraReward3)
     };
     return(SqlDBHelper.ExecuteNonQuery("ContractualEmployeeReward_Update", CommandType.StoredProcedure, parametersContractualEmployeeReward));
 }
 public Int64 Insert(ContractualEmployeeReward contractualEmployeeReward)
 {
     SqlParameter[] parametersContractualEmployeeReward = new SqlParameter[]
     {
         new SqlParameter("@YearTypeID", (contractualEmployeeReward.YearTypeID > 0) ? contractualEmployeeReward.YearTypeID : (object)DBNull.Value),
         new SqlParameter("@MonthTypeID", (contractualEmployeeReward.MonthTypeID > 0) ? contractualEmployeeReward.MonthTypeID : (object)DBNull.Value),
         new SqlParameter("@NationalCode", (contractualEmployeeReward.NationalCode > 0) ? contractualEmployeeReward.NationalCode : (object)DBNull.Value),
         new SqlParameter("@Reward", contractualEmployeeReward.Reward),
         new SqlParameter("@BossFinalValue", contractualEmployeeReward.BossFinalValue),
         new SqlParameter("@AssistantFinalValue", contractualEmployeeReward.AssistantFinalValue),
         new SqlParameter("@ManagerFinalValue", contractualEmployeeReward.ManagerFinalValue),
         new SqlParameter("@ExtraReward1", contractualEmployeeReward.ExtraReward1),
         new SqlParameter("@ExtraReward2", contractualEmployeeReward.ExtraReward2),
         new SqlParameter("@ExtraReward3", contractualEmployeeReward.ExtraReward3)
     };
     return(SqlDBHelper.ExecuteScalar("ContractualEmployeeReward_Insert", CommandType.StoredProcedure, parametersContractualEmployeeReward));
 }
        public OfficialEmployeeReward GetDetails(Int64 nationalCode, int yearTypeID, int monthTypeID)
        {
            OfficialEmployeeReward officialEmployeeReward = new OfficialEmployeeReward();

            SqlParameter[] parametersOfficialEmployeeReward = new SqlParameter[]
            {
                new SqlParameter("@NationalCode", nationalCode),
                new SqlParameter("@YearTypeID", yearTypeID),
                new SqlParameter("@MonthTypeID", monthTypeID)
            };
            using (DataTable table = SqlDBHelper.ExecuteParamerizedSelectCommand("OfficialEmployeeReward_GetDetails", CommandType.StoredProcedure, parametersOfficialEmployeeReward))
            {
                if (table.Rows.Count == 1)
                {
                    DataRow row = table.Rows[0];

                    officialEmployeeReward.NationalCode        = (row["NationalCode"] != DBNull.Value) ? Convert.ToInt64(row["NationalCode"]) : 0;
                    officialEmployeeReward.YearTypeID          = (row["YearTypeID"] != DBNull.Value) ? Convert.ToInt32(row["YearTypeID"]) : 0;
                    officialEmployeeReward.MonthTypeID         = (row["MonthTypeID"] != DBNull.Value) ? Convert.ToInt32(row["MonthTypeID"]) : 0;
                    officialEmployeeReward.EmployeeFullName    = row["EmployeeFullName"].ToString();
                    officialEmployeeReward.DepartmentIDTitle   = row["DepartmentIDTitle"].ToString();
                    officialEmployeeReward.YearTypeIDTitle     = row["YearTypeIDTitle"].ToString();
                    officialEmployeeReward.MonthTypeIDTitle    = row["MonthTypeIDTitle"].ToString();
                    officialEmployeeReward.RoleTypeIDTitle     = row["RoleTypeIDTitle"].ToString();
                    officialEmployeeReward.TotalReward         = (row["TotalReward"] != DBNull.Value) ? Convert.ToInt64(row["TotalReward"]) : 0;
                    officialEmployeeReward.Reward_             = (row["Reward_"] != DBNull.Value) ? Convert.ToInt64(row["Reward_"]) : 0;
                    officialEmployeeReward.RoleTypeIDFactor    = (row["RoleTypeIDFactor"] != DBNull.Value) ? Convert.ToDecimal(row["RoleTypeIDFactor"]) : 0;
                    officialEmployeeReward.BossFactor          = (row["BossFactor"] != DBNull.Value) ? Convert.ToDecimal(row["BossFactor"]) : 0;
                    officialEmployeeReward.Reward              = (row["Reward"] != DBNull.Value) ? Convert.ToInt64(row["Reward"]) : 0;
                    officialEmployeeReward.BossFinalValue      = (row["BossFinalValue"] != DBNull.Value) ? Convert.ToInt64(row["BossFinalValue"]) : 0;
                    officialEmployeeReward.AssistantFinalValue = (row["AssistantFinalValue"] != DBNull.Value) ? Convert.ToInt64(row["AssistantFinalValue"]) : 0;
                    officialEmployeeReward.ManagerFinalValue   = (row["ManagerFinalValue"] != DBNull.Value) ? Convert.ToInt64(row["ManagerFinalValue"]) : 0;
                    officialEmployeeReward.ExtraReward1        = (row["ExtraReward1"] != DBNull.Value) ? Convert.ToInt64(row["ExtraReward1"]) : 0;
                    officialEmployeeReward.ExtraReward2        = (row["ExtraReward2"] != DBNull.Value) ? Convert.ToInt64(row["ExtraReward2"]) : 0;
                    officialEmployeeReward.ExtraReward3        = (row["ExtraReward3"] != DBNull.Value) ? Convert.ToInt64(row["ExtraReward3"]) : 0;
                    officialEmployeeReward.RoleTypeID          = (row["RoleTypeID"] != DBNull.Value) ? Convert.ToInt32(row["RoleTypeID"]) : 0;
                    officialEmployeeReward.Parameter1          = (row["Parameter1"] != DBNull.Value) ? Convert.ToInt32(row["Parameter1"]) : 0;
                    officialEmployeeReward.Parameter2          = (row["Parameter2"] != DBNull.Value) ? Convert.ToInt32(row["Parameter2"]) : 0;
                    officialEmployeeReward.Parameter3          = (row["Parameter3"] != DBNull.Value) ? Convert.ToInt32(row["Parameter3"]) : 0;
                }
            }

            return(officialEmployeeReward);
        }
        public List <OfficialEmployeeReward> GetListAll()
        {
            List <OfficialEmployeeReward> listOfficialEmployeeReward = null;

            using (DataTable table = SqlDBHelper.ExecuteSelectCommand("OfficialEmployeeReward_GetListAll", CommandType.StoredProcedure))
            {
                if (table.Rows.Count > 0)
                {
                    listOfficialEmployeeReward = new List <OfficialEmployeeReward>();

                    foreach (DataRow row in table.Rows)
                    {
                        OfficialEmployeeReward officialEmployeeReward = new OfficialEmployeeReward();
                        officialEmployeeReward.NationalCode        = (row["NationalCode"] != DBNull.Value) ? Convert.ToInt64(row["NationalCode"]) : 0;
                        officialEmployeeReward.YearTypeID          = (row["YearTypeID"] != DBNull.Value) ? Convert.ToInt32(row["YearTypeID"]) : 0;
                        officialEmployeeReward.MonthTypeID         = (row["MonthTypeID"] != DBNull.Value) ? Convert.ToInt32(row["MonthTypeID"]) : 0;
                        officialEmployeeReward.EmployeeFullName    = row["EmployeeFullName"].ToString();
                        officialEmployeeReward.DepartmentIDTitle   = row["DepartmentIDTitle"].ToString();
                        officialEmployeeReward.YearTypeIDTitle     = row["YearTypeIDTitle"].ToString();
                        officialEmployeeReward.MonthTypeIDTitle    = row["MonthTypeIDTitle"].ToString();
                        officialEmployeeReward.RoleTypeIDTitle     = row["RoleTypeIDTitle"].ToString();
                        officialEmployeeReward.TotalReward         = (row["TotalReward"] != DBNull.Value) ? Convert.ToInt64(row["TotalReward"]) : 0;
                        officialEmployeeReward.Reward_             = (row["Reward_"] != DBNull.Value) ? Convert.ToInt64(row["Reward_"]) : 0;
                        officialEmployeeReward.RoleTypeIDFactor    = (row["RoleTypeIDFactor"] != DBNull.Value) ? Convert.ToDecimal(row["RoleTypeIDFactor"]) : 0;
                        officialEmployeeReward.BossFactor          = (row["BossFactor"] != DBNull.Value) ? Convert.ToDecimal(row["BossFactor"]) : 0;
                        officialEmployeeReward.Reward              = (row["Reward"] != DBNull.Value) ? Convert.ToInt64(row["Reward"]) : 0;
                        officialEmployeeReward.BossFinalValue      = (row["BossFinalValue"] != DBNull.Value) ? Convert.ToInt64(row["BossFinalValue"]) : 0;
                        officialEmployeeReward.AssistantFinalValue = (row["AssistantFinalValue"] != DBNull.Value) ? Convert.ToInt64(row["AssistantFinalValue"]) : 0;
                        officialEmployeeReward.ManagerFinalValue   = (row["ManagerFinalValue"] != DBNull.Value) ? Convert.ToInt64(row["ManagerFinalValue"]) : 0;
                        officialEmployeeReward.ExtraReward1        = (row["ExtraReward1"] != DBNull.Value) ? Convert.ToInt64(row["ExtraReward1"]) : 0;
                        officialEmployeeReward.ExtraReward2        = (row["ExtraReward2"] != DBNull.Value) ? Convert.ToInt64(row["ExtraReward2"]) : 0;
                        officialEmployeeReward.ExtraReward3        = (row["ExtraReward3"] != DBNull.Value) ? Convert.ToInt64(row["ExtraReward3"]) : 0;
                        officialEmployeeReward.RoleTypeID          = (row["RoleTypeID"] != DBNull.Value) ? Convert.ToInt32(row["RoleTypeID"]) : 0;
                        officialEmployeeReward.Parameter1          = (row["Parameter1"] != DBNull.Value) ? Convert.ToInt32(row["Parameter1"]) : 0;
                        officialEmployeeReward.Parameter2          = (row["Parameter2"] != DBNull.Value) ? Convert.ToInt32(row["Parameter2"]) : 0;
                        officialEmployeeReward.Parameter3          = (row["Parameter3"] != DBNull.Value) ? Convert.ToInt32(row["Parameter3"]) : 0;
                        listOfficialEmployeeReward.Add(officialEmployeeReward);
                    }
                }
            }

            return(listOfficialEmployeeReward);
        }
示例#26
0
        public ComputationType GetDetails(int computationTypeID)
        {
            ComputationType computationType = new ComputationType();

            SqlParameter[] parametersComputationType = new SqlParameter[]
            {
                new SqlParameter("@ComputationTypeID", computationTypeID)
            };
            using (DataTable table = SqlDBHelper.ExecuteParamerizedSelectCommand("ComputationType_GetDetails", CommandType.StoredProcedure, parametersComputationType))
            {
                if (table.Rows.Count == 1)
                {
                    DataRow row = table.Rows[0];

                    computationType.ComputationTypeID = (row["ComputationTypeID"] != DBNull.Value) ? Convert.ToInt32(row["ComputationTypeID"]) : 0;
                    computationType.Title             = row["Title"].ToString();
                }
            }

            return(computationType);
        }
示例#27
0
        public ActivityType GetDetails(int activityTypeID)
        {
            ActivityType activityType = new ActivityType();

            SqlParameter[] parametersActivityType = new SqlParameter[]
            {
                new SqlParameter("@ActivityTypeID", activityTypeID)
            };
            using (DataTable table = SqlDBHelper.ExecuteParamerizedSelectCommand("ActivityType_GetDetails", CommandType.StoredProcedure, parametersActivityType))
            {
                if (table.Rows.Count == 1)
                {
                    DataRow row = table.Rows[0];

                    activityType.ActivityTypeID = (row["ActivityTypeID"] != DBNull.Value) ? Convert.ToInt32(row["ActivityTypeID"]) : 0;
                    activityType.Title          = row["Title"].ToString();
                }
            }

            return(activityType);
        }
        public YearType GetDetails(int yearTypeID)
        {
            YearType yearType = new YearType();

            SqlParameter[] parametersYearType = new SqlParameter[]
            {
                new SqlParameter("@YearTypeID", yearTypeID)
            };
            using (DataTable table = SqlDBHelper.ExecuteParamerizedSelectCommand("YearType_GetDetails", CommandType.StoredProcedure, parametersYearType))
            {
                if (table.Rows.Count == 1)
                {
                    DataRow row = table.Rows[0];

                    yearType.YearTypeID = (row["YearTypeID"] != DBNull.Value) ? Convert.ToInt32(row["YearTypeID"]) : 0;
                    yearType.Title      = row["Title"].ToString();
                }
            }

            return(yearType);
        }
示例#29
0
        public List <ActivityType> GetListAll()
        {
            List <ActivityType> listActivityType = null;

            using (DataTable table = SqlDBHelper.ExecuteSelectCommand("ActivityType_GetListAll", CommandType.StoredProcedure))
            {
                if (table.Rows.Count > 0)
                {
                    listActivityType = new List <ActivityType>();

                    foreach (DataRow row in table.Rows)
                    {
                        ActivityType activityType = new ActivityType();
                        activityType.ActivityTypeID = (row["ActivityTypeID"] != DBNull.Value) ? Convert.ToInt32(row["ActivityTypeID"]) : 0;
                        activityType.Title          = row["Title"].ToString();
                        listActivityType.Add(activityType);
                    }
                }
            }

            return(listActivityType);
        }
 public bool Update(OfficialEmployeeReward officialEmployeeReward)
 {
     SqlParameter[] parametersOfficialEmployeeReward = new SqlParameter[]
     {
         new SqlParameter("@NationalCode", officialEmployeeReward.NationalCode),
         new SqlParameter("@YearTypeID", officialEmployeeReward.YearTypeID),
         new SqlParameter("@MonthTypeID", officialEmployeeReward.MonthTypeID),
         new SqlParameter("@BossFactor", officialEmployeeReward.BossFactor),
         new SqlParameter("@Reward", officialEmployeeReward.Reward),
         new SqlParameter("@BossFinalValue", officialEmployeeReward.BossFinalValue),
         new SqlParameter("@AssistantFinalValue", officialEmployeeReward.AssistantFinalValue),
         new SqlParameter("@ManagerFinalValue", officialEmployeeReward.ManagerFinalValue),
         new SqlParameter("@ExtraReward1", officialEmployeeReward.ExtraReward1),
         new SqlParameter("@ExtraReward2", officialEmployeeReward.ExtraReward2),
         new SqlParameter("@ExtraReward3", officialEmployeeReward.ExtraReward3),
         new SqlParameter("@RoleTypeID", (officialEmployeeReward.RoleTypeID != null) ? officialEmployeeReward.RoleTypeID : (object)DBNull.Value),
         new SqlParameter("@Parameter1", officialEmployeeReward.Parameter1),
         new SqlParameter("@Parameter2", officialEmployeeReward.Parameter2),
         new SqlParameter("@Parameter3", officialEmployeeReward.Parameter3)
     };
     return(SqlDBHelper.ExecuteNonQuery("OfficialEmployeeReward_Update", CommandType.StoredProcedure, parametersOfficialEmployeeReward));
 }