Exemplo n.º 1
0
 private void BindTypesSource()
 {
     _ItsView.WorkTypeSource           = WorkType.GetAll();
     _ItsView.WorkType                 = WorkType.Contract.Id.ToString();
     _ItsView.SocialSecurityTypeSource = SocialSecurityTypeEnum.GetAll();
     _ItsView.SocialSecurityType       = SocialSecurityTypeEnum.Null;
 }
 private static SocialSecurityTypeEnum ConvertToSocialSecurityTypeEnum(string s)
 {
     if (!string.IsNullOrEmpty(s))
     {
         if (SocialSecurityTypeEnum.GetByName(s) == null)
         {
             throw new ApplicationException(string.Format("数据:{0} 不是有效的社保类型", s));
         }
     }
     return(SocialSecurityTypeEnum.GetByName(s));
 }
Exemplo n.º 3
0
        private void SetGridViewRowddSocialSecurityTypeDisplay(int rowIndex)
        {
            DropDownList ddSocialSecurityType =
                (DropDownList)gvEmployeeWelfare.Rows[rowIndex].FindControl("ddSocialSecurityType");

            if (ddSocialSecurityType != null)
            {
                ddSocialSecurityType.DataSource     = SocialSecurityTypeEnum.GetAll();
                ddSocialSecurityType.DataValueField = "Id";
                ddSocialSecurityType.DataTextField  = "Name";
                ddSocialSecurityType.DataBind();
                ddSocialSecurityType.SelectedValue =
                    EmployeeWelfareList[rowIndex + PageIndex * gvEmployeeWelfare.PageSize].SocialSecurity.Type.Id.ToString
                        ();
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 保存员工福利,有则更新,没有则新增
        /// </summary>
        /// <param name="employeeID">员工ID</param>
        /// <param name="socialSecurityType">社保类型</param>
        /// <param name="socialSecurityBase">社保基数</param>
        /// <param name="socialSecurityEffectiveYearMonth">社保有效年月</param>
        /// <param name="accumulationFundAccount">公积金帐号</param>
        /// <param name="accumulationFundEffectiveYearMonth">公积金有效年月</param>
        /// <param name="accumulationFundBase">公积金基数</param>
        /// <param name="operationName">操作人姓名</param>
        /// <param name="accumulationFundSupplyAccount"></param>
        /// <returns>pkid</returns>
        /// <param name="accumulationFundSupplyBase">补充公积金基数</param>
        /// <param name="yangLaoBase">养老缴费基数</param>
        /// <param name="shiYeBase">失业缴费基数</param>
        /// <param name="yiLiaoBase">医疗缴费基数</param>
        public int SaveEmployeeWelfare(int employeeID, SocialSecurityTypeEnum socialSecurityType,
                                       decimal?socialSecurityBase, DateTime?socialSecurityEffectiveYearMonth,
                                       string accumulationFundAccount, DateTime?accumulationFundEffectiveYearMonth,
                                       decimal?accumulationFundBase, string operationName,
                                       string accumulationFundSupplyAccount, decimal?accumulationFundSupplyBase,
                                       decimal?yangLaoBase, decimal?shiYeBase, decimal?yiLiaoBase)
        {
            SaveEmployeeWelfare saveEmployeeWelfare =
                new SaveEmployeeWelfare(employeeID, socialSecurityType, socialSecurityBase,
                                        socialSecurityEffectiveYearMonth, accumulationFundAccount,
                                        accumulationFundEffectiveYearMonth, accumulationFundBase, operationName,
                                        accumulationFundSupplyAccount, accumulationFundSupplyBase,
                                        yangLaoBase, shiYeBase, yiLiaoBase);

            saveEmployeeWelfare.Excute();
            return(saveEmployeeWelfare.EmployeeWelfareID);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 保存员工福利信息构造函数
        /// </summary>
        public SaveEmployeeWelfare(int employeeID, SocialSecurityTypeEnum socialSecurityType,
                                   decimal?socialSecurityBase, DateTime?socialSecurityEffectiveYearMonth,
                                   string accumulationFundAccount, DateTime?accumulationFundEffectiveYearMonth,
                                   decimal?accumulationFundBase, string operationName,
                                   string accumulationFundSupplyAccount, decimal?accumulationFundSupplyBase,
                                   decimal?yangLaoBase, decimal?shiYeBase, decimal?yiLiaoBase)
        {
            _EmployeeID = employeeID;
            EmployeeSocialSecurity employeeSocialSecurity =
                new EmployeeSocialSecurity(socialSecurityType, socialSecurityBase, socialSecurityEffectiveYearMonth,
                                           yangLaoBase, shiYeBase, yiLiaoBase);
            EmployeeAccumulationFund employeeAccumulationFund =
                new EmployeeAccumulationFund(accumulationFundAccount, accumulationFundBase,
                                             accumulationFundEffectiveYearMonth, accumulationFundSupplyAccount,
                                             accumulationFundSupplyBase);

            _EmployeeWelfare = new EmployeeWelfare(employeeSocialSecurity, employeeAccumulationFund);
            _OperationName   = operationName;
        }
        private void ValueItemInOneRow(int rowindex, DataTable dt, EmployeeWelfare welfare)
        {
            SocialSecurityTypeEnum socialSecurityType = welfare.SocialSecurity.Type;
            decimal? socialBase    = welfare.SocialSecurity.Base;
            decimal? yangLaoBase   = welfare.SocialSecurity.YangLaoBase;
            decimal? shiYeBase     = welfare.SocialSecurity.ShiYeBase;
            decimal? yiLiaoBase    = welfare.SocialSecurity.YiLiaoBase;
            DateTime?socialYM      = welfare.SocialSecurity.EffectiveYearMonth;
            string   fundAccount   = welfare.AccumulationFund.Account;
            DateTime?fundYM        = welfare.AccumulationFund.EffectiveYearMonth;
            decimal? fundBase      = welfare.AccumulationFund.Base;
            string   operationName = _Operator.Name;
            string   supplyAccount = welfare.AccumulationFund.SupplyAccount;
            decimal? supplyBase    = welfare.AccumulationFund.SupplyBase;

            string SsocialSecurityType = ImportUtility.GetItem(dt, rowindex, EmployeeWelfare.ConstParemeter.SocialType);

            if (SsocialSecurityType != ImportUtility.EmptyNull)
            {
                socialSecurityType = ConvertToSocialSecurityTypeEnum(SsocialSecurityType);
            }

            socialBase    = GetDecimal(dt, rowindex, socialBase, EmployeeWelfare.ConstParemeter.SocialBase);
            yangLaoBase   = GetDecimal(dt, rowindex, yangLaoBase, EmployeeWelfare.ConstParemeter.YangLaoBase);
            shiYeBase     = GetDecimal(dt, rowindex, shiYeBase, EmployeeWelfare.ConstParemeter.ShiYeBase);
            yiLiaoBase    = GetDecimal(dt, rowindex, yiLiaoBase, EmployeeWelfare.ConstParemeter.YiLiaoBase);
            socialYM      = GetYM(dt, rowindex, socialYM, EmployeeWelfare.ConstParemeter.SocialYM);
            fundAccount   = GetString(dt, rowindex, fundAccount, EmployeeWelfare.ConstParemeter.FundAccount);
            fundYM        = GetYM(dt, rowindex, fundYM, EmployeeWelfare.ConstParemeter.FundYM);
            fundBase      = GetDecimal(dt, rowindex, fundBase, EmployeeWelfare.ConstParemeter.FundBase);
            supplyAccount = GetString(dt, rowindex, supplyAccount, EmployeeWelfare.ConstParemeter.SupplyAccount);
            supplyBase    = GetDecimal(dt, rowindex, supplyBase, EmployeeWelfare.ConstParemeter.SupplyBase);

            SaveEmployeeWelfare saveEmployeeWelfare =
                new SaveEmployeeWelfare(welfare.Owner.Id, socialSecurityType, socialBase, socialYM, fundAccount,
                                        fundYM, fundBase, operationName,
                                        supplyAccount, supplyBase, yangLaoBase, shiYeBase, yiLiaoBase);

            saveEmployeeWelfare.Excute();
        }
        public List <EmployeeWelfareHistory> GetEmployeeWelfareHistoryByAccountID(int employeeID)
        {
            List <EmployeeWelfareHistory> employeeWelfareHistoryList = new List <EmployeeWelfareHistory>();
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.Add(_AccountID, SqlDbType.Int).Value = employeeID;
            using (SqlDataReader sdr = SqlHelper.ExecuteReader("GetEmployeeWelfareHistoryByAccountID", cmd))
            {
                while (sdr.Read())
                {
                    EmployeeSocialSecurity employeeSocialSecurity =
                        new EmployeeSocialSecurity(
                            SocialSecurityTypeEnum.GetById(Convert.ToInt32(sdr[_DbSocialSecurityType] ?? 0)),
                            EmployeeWelfare.ConvertToDecimal(sdr[_DbSocialSecurityBase]),
                            EmployeeWelfare.ConvertToDateTime(sdr[_DbSocialSecurityEffectiveYearMonth]),
                            EmployeeWelfare.ConvertToDecimal(sdr[_DbYangLaoBase]),
                            EmployeeWelfare.ConvertToDecimal(sdr[_DbShiYeBase]),
                            EmployeeWelfare.ConvertToDecimal(sdr[_DbYiLiaoBase]));
                    EmployeeAccumulationFund employeeAccumulationFund =
                        new EmployeeAccumulationFund(EmployeeWelfare.ConvertToString(sdr[_DbAccumulationFundAccount]),
                                                     EmployeeWelfare.ConvertToDecimal(sdr[_DbAccumulationFundBase]),
                                                     EmployeeWelfare.ConvertToDateTime(
                                                         sdr[_DbAccumulationFundEffectiveMonthYear]),
                                                     EmployeeWelfare.ConvertToString(
                                                         sdr[_DbAccumulationFundSupplyAccount]),
                                                     EmployeeWelfare.ConvertToDecimal(
                                                         sdr[_DbAccumulationFundSupplyBase]));

                    EmployeeWelfare employeeWelfare =
                        new EmployeeWelfare(employeeSocialSecurity, employeeAccumulationFund);
                    EmployeeWelfareHistory employeeWelfareHistory =
                        new EmployeeWelfareHistory(Convert.ToInt32(sdr[_DbPKID]), employeeWelfare,
                                                   Convert.ToDateTime(sdr[_DbOperationTime]),
                                                   sdr[_DbAccountsBackName].ToString());
                    employeeWelfareHistoryList.Add(employeeWelfareHistory);
                }
            }
            return(employeeWelfareHistoryList);
        }
Exemplo n.º 8
0
        private void GetValueFromGridView()
        {
            for (int i = 0; i < gvEmployeeWelfare.Rows.Count; i++)
            {
                DropDownList ddSocialSecurityType =
                    (DropDownList)gvEmployeeWelfare.Rows[i].FindControl("ddSocialSecurityType");
                if (ddSocialSecurityType != null)
                {
                    EmployeeWelfareListViewState[i + PageIndex * gvEmployeeWelfare.PageSize].SocialSecurity.Type =
                        SocialSecurityTypeEnum.GetById(Convert.ToInt32(ddSocialSecurityType.SelectedValue));
                }

                TextBox txtSocialSecurityYear =
                    (TextBox)gvEmployeeWelfare.Rows[i].FindControl("txtSocialSecurityYear");
                TextBox txtSocialSecurityMonth =
                    (TextBox)gvEmployeeWelfare.Rows[i].FindControl("txtSocialSecurityMonth");
                TextBox txtAccumulationFundYear =
                    (TextBox)gvEmployeeWelfare.Rows[i].FindControl("txtAccumulationFundYear");
                TextBox txtAccumulationFundMonth =
                    (TextBox)gvEmployeeWelfare.Rows[i].FindControl("txtAccumulationFundMonth");
                TextBox txtSocialSecurityBase =
                    (TextBox)gvEmployeeWelfare.Rows[i].FindControl("txtSocialSecurityBase");
                TextBox txtAccumulationFundAccount =
                    (TextBox)gvEmployeeWelfare.Rows[i].FindControl("txtAccumulationFundAccount");
                TextBox txtAccumulationFundBase =
                    (TextBox)gvEmployeeWelfare.Rows[i].FindControl("txtAccumulationFundBase");
                TextBox txtSupplyAccount =
                    (TextBox)gvEmployeeWelfare.Rows[i].FindControl("txtSupplyAccount");
                TextBox txtSupplyBase =
                    (TextBox)gvEmployeeWelfare.Rows[i].FindControl("txtSupplyBase");
                TextBox txtYangLaoBase =
                    (TextBox)gvEmployeeWelfare.Rows[i].FindControl("txtYangLaoBase");
                TextBox txtShiYeBase =
                    (TextBox)gvEmployeeWelfare.Rows[i].FindControl("txtShiYeBase");
                TextBox txtYiLiaoBase =
                    (TextBox)gvEmployeeWelfare.Rows[i].FindControl("txtYiLiaoBase");
                if (txtSocialSecurityYear != null && txtSocialSecurityMonth != null)
                {
                    EmployeeWelfareListViewState[i + PageIndex * gvEmployeeWelfare.PageSize].SocialSecurity.
                    EffectiveYearMonthTemp =
                        new List <string>(
                            new string[2] {
                        txtSocialSecurityYear.Text.Trim(), txtSocialSecurityMonth.Text.Trim()
                    });
                }
                if (txtAccumulationFundYear != null && txtAccumulationFundMonth != null)
                {
                    EmployeeWelfareListViewState[i + PageIndex * gvEmployeeWelfare.PageSize].AccumulationFund.
                    EffectiveYearMonthTemp =
                        new List <string>(
                            new string[2] {
                        txtAccumulationFundYear.Text.Trim(), txtAccumulationFundMonth.Text.Trim()
                    });
                }
                if (txtSocialSecurityBase != null)
                {
                    EmployeeWelfareListViewState[i + PageIndex * gvEmployeeWelfare.PageSize].SocialSecurity.BaseTemp =
                        txtSocialSecurityBase.Text.Trim();
                }
                if (txtAccumulationFundAccount != null)
                {
                    EmployeeWelfareListViewState[i + PageIndex * gvEmployeeWelfare.PageSize].AccumulationFund.Account =
                        txtAccumulationFundAccount.Text.Trim();
                }
                if (txtAccumulationFundBase != null)
                {
                    EmployeeWelfareListViewState[i + PageIndex * gvEmployeeWelfare.PageSize].AccumulationFund.BaseTemp =
                        txtAccumulationFundBase.Text.Trim();
                }
                if (txtSupplyAccount != null)
                {
                    EmployeeWelfareListViewState[i + PageIndex * gvEmployeeWelfare.PageSize].AccumulationFund.
                    SupplyAccount =
                        txtSupplyAccount.Text.Trim();
                }
                if (txtSupplyBase != null)
                {
                    EmployeeWelfareListViewState[i + PageIndex * gvEmployeeWelfare.PageSize].AccumulationFund.
                    SupplyBaseTemp =
                        txtSupplyBase.Text.Trim();
                }
                if (txtYangLaoBase != null)
                {
                    EmployeeWelfareListViewState[i + PageIndex * gvEmployeeWelfare.PageSize].SocialSecurity.
                    YangLaoBaseTemp =
                        txtYangLaoBase.Text.Trim();
                }
                if (txtShiYeBase != null)
                {
                    EmployeeWelfareListViewState[i + PageIndex * gvEmployeeWelfare.PageSize].SocialSecurity.ShiYeBaseTemp
                        =
                            txtShiYeBase.Text.Trim();
                }
                if (txtYiLiaoBase != null)
                {
                    EmployeeWelfareListViewState[i + PageIndex * gvEmployeeWelfare.PageSize].SocialSecurity.YiLiaoBaseTemp
                        =
                            txtYiLiaoBase.Text.Trim();
                }
            }
        }