Beispiel #1
0
        /// <summary>
        /// Decline all pending social invites of a type, if no type is specified all invites will be declined.
        /// </summary>
        public void DeclineSocialInvites(SocialType type = SocialType.None)
        {
            IEnumerable <SocialInviteRequest> invites = type != SocialType.None ? socialInviteLookup.Where(s => s.Type == type) : socialInviteLookup;

            foreach (SocialInviteRequest inviteRequest in invites)
            {
                SocialBase socialEntity = SocialManager.FindSocialEntity <SocialBase>(inviteRequest.Type, inviteRequest.EntityId);
                socialEntity?.InviteResponse(this, 0);
            }
        }
Beispiel #2
0
        public static void HandleSocialInviteResponse(WorldSession session, ClientSocialInviteResponse socialInviteResponse)
        {
            SocialInviteRequest inviteRequest = session.Player.FindSocialInvite(socialInviteResponse.CharacterId, socialInviteResponse.SocialType);

            if (inviteRequest == null)
            {
                throw new SocialInviteStateException($"Character {session.Player.Character.Id} doesnt't have a pending {socialInviteResponse.SocialType} invite!");
            }

            SocialBase socialEntity = SocialManager.FindSocialEntity <SocialBase>(socialInviteResponse.SocialType, inviteRequest.EntityId);

            socialEntity?.InviteResponse(session.Player, socialInviteResponse.Result);
        }
        public ActionResult Insert(SocialBase social)
        {
            SocialBaseBLL socBLL = new SocialBaseBLL();
            social.CreatorId = 1;
            ResultModel result = socBLL.Insert(social);
            if (result.ResultStatus != 0)
                return Json(result);

            result.Message = "社保区域新增成功";
            result.ReturnValue = "";
            result.ResultStatus = 0;
            return Json(result);

        }
        public ActionResult Update(SocialBase socialBase)
        {
            SocialBaseBLL socialBLL = new SocialBaseBLL();

            //获取社保比例信息
            ResultModel<SocialBase> socialResult = socialBLL.Get<SocialBase>(socialBase.SocId);
            if (socialResult == null || socialResult.ResultStatus != 0)
                new ResultModel("社保比例获取失败或不存在");

            SocialBase rtnSocialBase = socialResult.ReturnValue;
            if (rtnSocialBase == null || rtnSocialBase.SocId <= 0)
                new ResultModel("社保比例获取失败或不存在");

            rtnSocialBase.CityId = socialBase.CityId;
            rtnSocialBase.SocName = socialBase.SocName;
            //rtnSocialBase.SocialFundNum = socialBase.SocialFundNum;
            //rtnSocialBase.HouseFundNum = socialBase.HouseFundNum;
            rtnSocialBase.CorpPensionInsPoint = socialBase.CorpPensionInsPoint;
            rtnSocialBase.CorpMedicalInsPoint = socialBase.CorpMedicalInsPoint;
            rtnSocialBase.CorpUnempInsPoint = socialBase.CorpUnempInsPoint;
            rtnSocialBase.CorpInjuryInsPoint = socialBase.CorpInjuryInsPoint;
            rtnSocialBase.CorpBirthInsPoint = socialBase.CorpBirthInsPoint;
            rtnSocialBase.CorpDisabledInsPoint = socialBase.CorpDisabledInsPoint;
            rtnSocialBase.CorpIllnessInsPoint = socialBase.CorpIllnessInsPoint;
            rtnSocialBase.CorpHeatAmountPoint = socialBase.CorpHeatAmountPoint;
            rtnSocialBase.CorpHouseFundPoint = socialBase.CorpHouseFundPoint;
            rtnSocialBase.CorpRepInjuryInsPoint = socialBase.CorpRepInjuryInsPoint;

            rtnSocialBase.EmpPensionInsPoint = socialBase.EmpPensionInsPoint;
            rtnSocialBase.EmpMedicalInsPoint = socialBase.EmpMedicalInsPoint;
            rtnSocialBase.EmpUnempInsPoint = socialBase.EmpUnempInsPoint;
            rtnSocialBase.EmpInjuryInsPoint = socialBase.EmpInjuryInsPoint;
            rtnSocialBase.EmpBirthInsPoint = socialBase.EmpBirthInsPoint;
            rtnSocialBase.EmpDisabledInsPoint = socialBase.EmpDisabledInsPoint;
            rtnSocialBase.EmpIllnessInsPoint = socialBase.EmpIllnessInsPoint;
            rtnSocialBase.EmpHeatAmountPoint = socialBase.EmpHeatAmountPoint;
            rtnSocialBase.EmpHouseFundPoint = socialBase.EmpHouseFundPoint;
            rtnSocialBase.EmpRepInjuryInsPoint = socialBase.EmpRepInjuryInsPoint;

            ResultModel result = socialBLL.Update(rtnSocialBase);
            if (result.ResultStatus != 0)
                return Json(result);

            result.Message = "社保比例修改成功";
            result.ReturnValue = "";
            result.ResultStatus = 0;
            return Json(result);

        }
Beispiel #5
0
        private async Task OnBulletinCreatedAsync(SocialBase social, SocialCreateModel model)
        {
            if (model.GroupId.HasValue)
            {
                await _groupActivityService.AddRelationAsync(model.GroupId.Value, social.Id);
            }

            var extendedBulletin = _socialService.Get(social.Id);

            extendedBulletin.GroupId = model.GroupId;

            await _activityTagsHelper.ReplaceTagsAsync(social.Id, model.TagIdsData);

            if (model.Description.HasValue())
            {
                await ResolveMentionsAsync(model.Description, social);
            }
        }
Beispiel #6
0
        private void ResolveMentions(string text, SocialBase social)
        {
            var mentionIds = new Guid[] { };//_mentionService.GetMentions(text).ToList();//TODO: uncomment when mention service is ready

            if (mentionIds.Any())
            {
                var       links          = _activityLinkService.GetLinks(social.Id);
                const int maxTitleLength = 100;
                _mentionService.ProcessMention(new MentionModel()
                {
                    MentionedSourceId = social.Id,
                    CreatorId         = _memberService.GetCurrentMemberId(),
                    MentionedUserIds  = mentionIds,
                    Title             = social.Description.StripHtml().TrimByWordEnd(maxTitleLength),
                    Url          = links.Details,
                    ActivityType = IntranetActivityTypeEnum.Social
                });
            }
        }
Beispiel #7
0
        private async Task ResolveMentionsAsync(string text, SocialBase social)
        {
            var mentionIds = _mentionService.GetMentions(text).ToList();

            if (mentionIds.Any())
            {
                var links = await _activityLinkService.GetLinksAsync(social.Id);

                const int maxTitleLength = 100;
                _mentionService.ProcessMention(new MentionModel()
                {
                    MentionedSourceId = social.Id,
                    CreatorId         = await _memberService.GetCurrentMemberIdAsync(),
                    MentionedUserIds  = mentionIds,
                    Title             = social.Description.StripMentionHtml().TrimByWordEnd(maxTitleLength),
                    Url          = links.Details,
                    ActivityType = IntranetActivityTypeEnum.Social
                });
            }
        }
Beispiel #8
0
        private void OnBulletinCreated(SocialBase social, SocialCreateModel model)
        {
            var groupId = HttpContext.Current.Request.QueryString.GetGroupIdOrNone();

            if (groupId.HasValue)
            {
                _groupActivityService.AddRelation(groupId.Value, social.Id);
            }

            var extendedBulletin = _socialService.Get(social.Id);

            extendedBulletin.GroupId = groupId;


            _activityTagsHelper.ReplaceTags(social.Id, model.TagIdsData);

            if (model.Description.HasValue())
            {
                ResolveMentions(model.Description, social);
            }
        }
Beispiel #9
0
        public ActionResult InsertEmployeeSalary(EmployeeSalary[] details)
        {
            string            empId        = string.Empty;
            EmployeeBLL       empBLL       = new EmployeeBLL();
            EmployeeSalaryBLL empSalaryBLL = new EmployeeSalaryBLL();

            List <SocialBase> socialBaseList = BaseProvider.SocialBases;
            ResultModel       result         = new ResultModel();

            foreach (var emp in details)
            {
                ResultModel <Employee> resultEmployee = empBLL.Get <Employee>(emp.EmpId);
                if (resultEmployee.ResultStatus != 0)
                {
                    return(Json(resultEmployee));
                }

                Employee rtnEmployee = resultEmployee.ReturnValue;
                if (rtnEmployee == null)
                {
                    return(Json(new ResultModel(string.Format("{0}不存在", this.ModelName))));
                }

                SocialBase socialBase = socialBaseList.FirstOrDefault(temp => temp.CityId == rtnEmployee.PayCity);
                if (socialBase == null)
                {
                    return(Json(new ResultModel("社保信息不存在")));
                }

                decimal corpPensionIns   = rtnEmployee.RISINum * socialBase.CorpPensionInsPoint / 100 + socialBase.PensionInsFix;
                decimal corpMedicalIns   = rtnEmployee.MISINum * socialBase.CorpMedicalInsPoint / 100 + socialBase.MedicalInsFix;
                decimal corpUnempIns     = rtnEmployee.UISINum * socialBase.CorpUnempInsPoint / 100 + socialBase.UnempInsFix;
                decimal corpInjuryIns    = rtnEmployee.IISINum * socialBase.CorpInjuryInsPoint / 100 + socialBase.InjuryInsFix;
                decimal corpBirthIns     = rtnEmployee.BISINum * socialBase.CorpBirthInsPoint / 100 + socialBase.BirthInsFix;
                decimal corpDisabledIns  = rtnEmployee.DISINum * socialBase.CorpDisabledInsPoint / 100 + socialBase.DisabledInsFix;
                decimal corpIllnessIns   = rtnEmployee.LISINum * socialBase.CorpIllnessInsPoint / 100 + socialBase.IllnessInsFix;
                decimal corpHeatAmount   = rtnEmployee.HASINum * socialBase.CorpHeatAmountPoint / 100 + socialBase.HeatAmountFix;
                decimal corpHouseFund    = rtnEmployee.HFSINum * socialBase.CorpHouseFundPoint / 100 + socialBase.HouseFundFix;
                decimal corpRepInjuryIns = rtnEmployee.RISINum * socialBase.CorpRepInjuryInsPoint / 100 + socialBase.RepInjuryInsFix;
                decimal corpTotal        = corpPensionIns + corpMedicalIns + corpUnempIns + corpInjuryIns + corpBirthIns + corpDisabledIns + corpIllnessIns + corpHeatAmount + corpHouseFund + corpRepInjuryIns;

                decimal empPensionIns   = rtnEmployee.RISINum * socialBase.EmpPensionInsPoint / 100 + socialBase.PensionInsFix;
                decimal empMedicalIns   = rtnEmployee.MISINum * socialBase.EmpMedicalInsPoint / 100 + socialBase.MedicalInsFix;
                decimal empUnempIns     = rtnEmployee.UISINum * socialBase.EmpUnempInsPoint / 100 + socialBase.UnempInsFix;
                decimal empInjuryIns    = rtnEmployee.IISINum * socialBase.EmpInjuryInsPoint / 100 + socialBase.InjuryInsFix;
                decimal empBirthIns     = rtnEmployee.BISINum * socialBase.EmpBirthInsPoint / 100 + socialBase.BirthInsFix;
                decimal empDisabledIns  = rtnEmployee.DISINum * socialBase.EmpDisabledInsPoint / 100 + socialBase.DisabledInsFix;
                decimal empIllnessIns   = rtnEmployee.LISINum * socialBase.EmpIllnessInsPoint / 100 + socialBase.IllnessInsFix;
                decimal empHeatAmount   = rtnEmployee.HASINum * socialBase.EmpHeatAmountPoint / 100 + socialBase.HeatAmountFix;
                decimal empHouseFund    = rtnEmployee.HFSINum * socialBase.EmpHouseFundPoint / 100 + socialBase.HouseFundFix;
                decimal empRepInjuryIns = rtnEmployee.RISINum * socialBase.EmpRepInjuryInsPoint / 100 + socialBase.RepInjuryInsFix;
                decimal empTotal        = empPensionIns + empMedicalIns + empUnempIns + empInjuryIns + empBirthIns + empDisabledIns + empIllnessIns + empHeatAmount + empHouseFund + empRepInjuryIns;


                EmployeeSalary empSalary = new EmployeeSalary();
                empSalary.EmpId            = rtnEmployee.EmpId;
                empSalary.PayCity          = rtnEmployee.PayCity;
                empSalary.CorpId           = rtnEmployee.CorpId;
                empSalary.SupId            = rtnEmployee.SupId;
                empSalary.CorpPensionIns   = corpPensionIns;
                empSalary.CorpMedicalIns   = corpMedicalIns;
                empSalary.CorpUnempIns     = corpUnempIns;
                empSalary.CorpInjuryIns    = corpInjuryIns;
                empSalary.CorpBirthIns     = corpBirthIns;
                empSalary.CorpDisabledIns  = corpDisabledIns;
                empSalary.CorpIllnessIns   = corpIllnessIns;
                empSalary.CorpHeatAmount   = corpHeatAmount;
                empSalary.CorpHouseFund    = corpHouseFund;
                empSalary.CorpRepInjuryIns = corpRepInjuryIns;
                empSalary.CorpTotal        = corpTotal;

                empSalary.EmpPensionIns   = empPensionIns;
                empSalary.EmpMedicalIns   = empMedicalIns;
                empSalary.EmpUnempIns     = empUnempIns;
                empSalary.EmpInjuryIns    = empInjuryIns;
                empSalary.EmpBirthIns     = empBirthIns;
                empSalary.EmpDisabledIns  = empDisabledIns;
                empSalary.EmpIllnessIns   = empIllnessIns;
                empSalary.EmpHeatAmount   = empHeatAmount;
                empSalary.EmpHouseFund    = empHouseFund;
                empSalary.EmpRepInjuryIns = empRepInjuryIns;
                empSalary.EmpTotal        = empTotal;

                empSalary.TotalAmount  = emp.TotalAmount;
                empSalary.RepairAmount = emp.RepairAmount;   //补充社保
                decimal grossAmount = emp.TotalAmount - empTotal;
                empSalary.GrossAmount = grossAmount;         //税前
                decimal personalTax = Calculator.PersonalTax(grossAmount);
                empSalary.PersonalTax = personalTax;         //个调税
                decimal finalAmount = grossAmount - personalTax;
                empSalary.FinalAmount   = finalAmount;       //实发
                empSalary.ServiceAmount = emp.ServiceAmount; //服务费
                empSalary.RefundAmount  = emp.RefundAmount;  //补收/退款

                empSalary.PayDate         = DateTime.Now;
                empSalary.EmpSalaryStatus = (int)StatusEnum.已完成;
                result = empSalaryBLL.Insert(empSalary);

                if (result.ResultStatus != 0)
                {
                    return(Json(result));
                }
            }


            result.Message      = "员工薪资发放成功";
            result.ReturnValue  = "";
            result.ResultStatus = 0;
            return(Json(result));
        }
Beispiel #10
0
        private async Task OnSocialEditedAsync(SocialBase social, SocialEditModel model)
        {
            await _activityTagsHelper.ReplaceTagsAsync(social.Id, model.TagIdsData);

            await ResolveMentionsAsync(model.Description, social);
        }
Beispiel #11
0
        private void OnBulletinEdited(SocialBase social, SocialEditModel model)
        {
            _activityTagsHelper.ReplaceTags(social.Id, model.TagIdsData);

            ResolveMentions(model.Description, social);
        }
Beispiel #12
0
        public ActionResult EmpUpLoadFile()
        {
            HttpFileCollectionBase files = Request.Files;
            var file = files[0];

            //上传文件并指定上传目录的路径
            String fileSave = Server.MapPath("~/uploads/") + file.FileName;//在服务器的路径,上传Excel的路径

            file.SaveAs(fileSave);
            //解析Excel
            DataSet ds = new DataSet();

            ds = ExcelToDS(fileSave); //调用ExcelToDS方法解析Excel
            ResultModel result = new ResultModel();

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                DateTime payDate     = Convert.ToDateTime(ds.Tables[0].Rows[i][0]);
                string   empName     = ds.Tables[0].Rows[i][1].ToString();         //姓名
                string   cardNo      = ds.Tables[0].Rows[i][2].ToString();         //身份证
                decimal  totalAmount = Convert.ToDecimal(ds.Tables[0].Rows[i][3]); //应发工资

                EmployeeBLL            empBLL         = new EmployeeBLL();
                ResultModel <Employee> resultEmployee = empBLL.GetEmployeeByCardNo(cardNo);

                if (resultEmployee.ResultStatus != 0 || resultEmployee == null)
                {
                    return(Json(resultEmployee));
                }

                List <Employee> employeeList = resultEmployee.ReturnValues;
                if (employeeList == null)
                {
                    return(Json(employeeList));
                }
                Employee rtnEmployee = employeeList.FirstOrDefault();

                CorporationBLL            corpBLL    = new CorporationBLL();
                ResultModel <Corporation> resultCorp = corpBLL.Get <Corporation>(rtnEmployee.CorpId);
                if (resultCorp.ResultStatus != 0)
                {
                    return(Json(new ResultModel("企业不存在")));
                }

                Corporation rtnCorp = resultCorp.ReturnValue;
                if (rtnCorp == null || rtnCorp.CorpId < 0)
                {
                    return(Json(new ResultModel("企业不存在")));
                }

                EmployeeSalaryBLL empSalaryBLL   = new EmployeeSalaryBLL();
                List <SocialBase> socialBaseList = BaseProvider.SocialBases;

                SocialBase socialBase = socialBaseList.FirstOrDefault(temp => temp.CityId == rtnEmployee.PayCity);
                if (socialBase == null)
                {
                    return(Json(new ResultModel("社保信息不存在")));
                }

                ResultModel <EmployeeSalary> resultEmps = empSalaryBLL.LoadEmployeeSalaryCheckOne(rtnEmployee.EmpId, payDate);
                if (resultEmps.ResultStatus != 0 || resultEmps == null)
                {
                    return(Json(resultEmps));
                }
                List <EmployeeSalary> empsList = resultEmps.ReturnValues;
                if (empsList == null || empsList.Count > 0)
                {
                    continue;
                }

                decimal corpPensionIns   = rtnEmployee.RISINum * socialBase.CorpPensionInsPoint / 100 + socialBase.PensionInsFix;
                decimal corpMedicalIns   = rtnEmployee.MISINum * socialBase.CorpMedicalInsPoint / 100 + socialBase.MedicalInsFix;
                decimal corpUnempIns     = rtnEmployee.UISINum * socialBase.CorpUnempInsPoint / 100 + socialBase.UnempInsFix;
                decimal corpInjuryIns    = rtnEmployee.IISINum * socialBase.CorpInjuryInsPoint / 100 + socialBase.InjuryInsFix;
                decimal corpBirthIns     = rtnEmployee.BISINum * socialBase.CorpBirthInsPoint / 100 + socialBase.BirthInsFix;
                decimal corpDisabledIns  = rtnEmployee.DISINum * socialBase.CorpDisabledInsPoint / 100 + socialBase.DisabledInsFix;
                decimal corpIllnessIns   = rtnEmployee.LISINum * socialBase.CorpIllnessInsPoint / 100 + socialBase.IllnessInsFix;
                decimal corpHeatAmount   = rtnEmployee.HASINum * socialBase.CorpHeatAmountPoint / 100 + socialBase.HeatAmountFix;
                decimal corpHouseFund    = rtnEmployee.HFSINum * socialBase.CorpHouseFundPoint / 100 + socialBase.HouseFundFix;
                decimal corpRepInjuryIns = rtnEmployee.RISINum * socialBase.CorpRepInjuryInsPoint / 100 + socialBase.RepInjuryInsFix;
                decimal corpTotal        = corpPensionIns + corpMedicalIns + corpUnempIns + corpInjuryIns + corpBirthIns + corpDisabledIns + corpIllnessIns + corpHeatAmount + corpHouseFund + corpRepInjuryIns;

                decimal empPensionIns   = rtnEmployee.RISINum * socialBase.EmpPensionInsPoint / 100 + socialBase.PensionInsFix;
                decimal empMedicalIns   = rtnEmployee.MISINum * socialBase.EmpMedicalInsPoint / 100 + socialBase.MedicalInsFix;
                decimal empUnempIns     = rtnEmployee.UISINum * socialBase.EmpUnempInsPoint / 100 + socialBase.UnempInsFix;
                decimal empInjuryIns    = rtnEmployee.IISINum * socialBase.EmpInjuryInsPoint / 100 + socialBase.InjuryInsFix;
                decimal empBirthIns     = rtnEmployee.BISINum * socialBase.EmpBirthInsPoint / 100 + socialBase.BirthInsFix;
                decimal empDisabledIns  = rtnEmployee.DISINum * socialBase.EmpDisabledInsPoint / 100 + socialBase.DisabledInsFix;
                decimal empIllnessIns   = rtnEmployee.LISINum * socialBase.EmpIllnessInsPoint / 100 + socialBase.IllnessInsFix;
                decimal empHeatAmount   = rtnEmployee.HASINum * socialBase.EmpHeatAmountPoint / 100 + socialBase.HeatAmountFix;
                decimal empHouseFund    = rtnEmployee.HFSINum * socialBase.EmpHouseFundPoint / 100 + socialBase.HouseFundFix;
                decimal empRepInjuryIns = rtnEmployee.RISINum * socialBase.EmpRepInjuryInsPoint / 100 + socialBase.RepInjuryInsFix;
                decimal empTotal        = empPensionIns + empMedicalIns + empUnempIns + empInjuryIns + empBirthIns + empDisabledIns + empIllnessIns + empHeatAmount + empHouseFund + empRepInjuryIns;

                EmployeeSalary empSalary = new EmployeeSalary();
                empSalary.EmpId            = rtnEmployee.EmpId;
                empSalary.PayCity          = rtnEmployee.PayCity;
                empSalary.CorpId           = rtnEmployee.CorpId;
                empSalary.SupId            = rtnEmployee.SupId;
                empSalary.CorpPensionIns   = corpPensionIns;
                empSalary.CorpMedicalIns   = corpMedicalIns;
                empSalary.CorpUnempIns     = corpUnempIns;
                empSalary.CorpInjuryIns    = corpInjuryIns;
                empSalary.CorpBirthIns     = corpBirthIns;
                empSalary.CorpDisabledIns  = corpDisabledIns;
                empSalary.CorpIllnessIns   = corpIllnessIns;
                empSalary.CorpHeatAmount   = corpHeatAmount;
                empSalary.CorpHouseFund    = corpHouseFund;
                empSalary.CorpRepInjuryIns = corpRepInjuryIns;
                empSalary.CorpTotal        = corpTotal;

                empSalary.EmpPensionIns   = empPensionIns;
                empSalary.EmpMedicalIns   = empMedicalIns;
                empSalary.EmpUnempIns     = empUnempIns;
                empSalary.EmpInjuryIns    = empInjuryIns;
                empSalary.EmpBirthIns     = empBirthIns;
                empSalary.EmpDisabledIns  = empDisabledIns;
                empSalary.EmpIllnessIns   = empIllnessIns;
                empSalary.EmpHeatAmount   = empHeatAmount;
                empSalary.EmpHouseFund    = empHouseFund;
                empSalary.EmpRepInjuryIns = empRepInjuryIns;
                empSalary.EmpTotal        = empTotal;

                empSalary.TotalAmount  = totalAmount;
                empSalary.RepairAmount = 0;                      //补充社保
                decimal grossAmount = totalAmount - empTotal;
                empSalary.GrossAmount = grossAmount;             //税前
                decimal personalTax = Calculator.PersonalTax(grossAmount);
                empSalary.PersonalTax = personalTax;             //个调税
                decimal finalAmount = grossAmount - personalTax;
                empSalary.FinalAmount   = finalAmount;           //实发
                empSalary.ServiceAmount = rtnCorp.ServiceAmount; //服务费
                empSalary.RefundAmount  = 0;                     //补收/退款

                empSalary.PayDate         = payDate;
                empSalary.EmpSalaryStatus = (int)StatusEnum.已完成;
                result = empSalaryBLL.Insert(empSalary);

                if (result.ResultStatus != 0)
                {
                    return(Json(result));
                }
            }

            //result.Message = "员工薪资发放成功";
            //result.ReturnValue = "";
            //result.ResultStatus = 0;
            return(RedirectToAction("EmployeeSalaryList"));
        }
Beispiel #13
0
 public SocialEventArgs(SocialType socialType, SocialBase socialData)
 {
     SocialType = socialType;
     SocialData = socialData;
 }
Beispiel #14
0
        public override List <SqlParameter> CreateUpdateParameters(IModel obj)
        {
            SocialBase bd_socialbase = (SocialBase)obj;

            List <SqlParameter> paras = new List <SqlParameter>();

            SqlParameter socidpara = new SqlParameter("@SocId", SqlDbType.Int, 4);

            socidpara.Value = bd_socialbase.SocId;
            paras.Add(socidpara);

            SqlParameter cityidpara = new SqlParameter("@CityId", SqlDbType.Int, 4);

            cityidpara.Value = bd_socialbase.CityId;
            paras.Add(cityidpara);

            if (!string.IsNullOrEmpty(bd_socialbase.SocName))
            {
                SqlParameter socnamepara = new SqlParameter("@SocName", SqlDbType.VarChar, 50);
                socnamepara.Value = bd_socialbase.SocName;
                paras.Add(socnamepara);
            }

            SqlParameter pensioninsnumpara = new SqlParameter("@PensionInsNum", SqlDbType.Decimal, 9);

            pensioninsnumpara.Value = bd_socialbase.PensionInsNum;
            paras.Add(pensioninsnumpara);

            SqlParameter medicalinsnumpara = new SqlParameter("@MedicalInsNum", SqlDbType.Decimal, 9);

            medicalinsnumpara.Value = bd_socialbase.MedicalInsNum;
            paras.Add(medicalinsnumpara);

            SqlParameter unempinsnumpara = new SqlParameter("@UnempInsNum", SqlDbType.Decimal, 9);

            unempinsnumpara.Value = bd_socialbase.UnempInsNum;
            paras.Add(unempinsnumpara);

            SqlParameter injuryinsnumpara = new SqlParameter("@InjuryInsNum", SqlDbType.Decimal, 9);

            injuryinsnumpara.Value = bd_socialbase.InjuryInsNum;
            paras.Add(injuryinsnumpara);

            SqlParameter birthinsnumpara = new SqlParameter("@BirthInsNum", SqlDbType.Decimal, 9);

            birthinsnumpara.Value = bd_socialbase.BirthInsNum;
            paras.Add(birthinsnumpara);

            SqlParameter disabledinsnumpara = new SqlParameter("@DisabledInsNum", SqlDbType.Decimal, 9);

            disabledinsnumpara.Value = bd_socialbase.DisabledInsNum;
            paras.Add(disabledinsnumpara);

            SqlParameter illnessinsnumpara = new SqlParameter("@IllnessInsNum", SqlDbType.Decimal, 9);

            illnessinsnumpara.Value = bd_socialbase.IllnessInsNum;
            paras.Add(illnessinsnumpara);

            SqlParameter heatamountnumpara = new SqlParameter("@HeatAmountNum", SqlDbType.Decimal, 9);

            heatamountnumpara.Value = bd_socialbase.HeatAmountNum;
            paras.Add(heatamountnumpara);

            SqlParameter housefundinumpara = new SqlParameter("@HouseFundINum", SqlDbType.Decimal, 9);

            housefundinumpara.Value = bd_socialbase.HouseFundINum;
            paras.Add(housefundinumpara);

            SqlParameter repinjuryinsnumpara = new SqlParameter("@RepInjuryInsNum", SqlDbType.Decimal, 9);

            repinjuryinsnumpara.Value = bd_socialbase.RepInjuryInsNum;
            paras.Add(repinjuryinsnumpara);

            SqlParameter corppensioninspointpara = new SqlParameter("@CorpPensionInsPoint", SqlDbType.Decimal, 9);

            corppensioninspointpara.Value = bd_socialbase.CorpPensionInsPoint;
            paras.Add(corppensioninspointpara);

            SqlParameter corpmedicalinspointpara = new SqlParameter("@CorpMedicalInsPoint", SqlDbType.Decimal, 9);

            corpmedicalinspointpara.Value = bd_socialbase.CorpMedicalInsPoint;
            paras.Add(corpmedicalinspointpara);

            SqlParameter corpunempinspointpara = new SqlParameter("@CorpUnempInsPoint", SqlDbType.Decimal, 9);

            corpunempinspointpara.Value = bd_socialbase.CorpUnempInsPoint;
            paras.Add(corpunempinspointpara);

            SqlParameter corpinjuryinspointpara = new SqlParameter("@CorpInjuryInsPoint", SqlDbType.Decimal, 9);

            corpinjuryinspointpara.Value = bd_socialbase.CorpInjuryInsPoint;
            paras.Add(corpinjuryinspointpara);

            SqlParameter corpbirthinspointpara = new SqlParameter("@CorpBirthInsPoint", SqlDbType.Decimal, 9);

            corpbirthinspointpara.Value = bd_socialbase.CorpBirthInsPoint;
            paras.Add(corpbirthinspointpara);

            SqlParameter corpdisabledinspointpara = new SqlParameter("@CorpDisabledInsPoint", SqlDbType.Decimal, 9);

            corpdisabledinspointpara.Value = bd_socialbase.CorpDisabledInsPoint;
            paras.Add(corpdisabledinspointpara);

            SqlParameter corpillnessinspointpara = new SqlParameter("@CorpIllnessInsPoint", SqlDbType.Decimal, 9);

            corpillnessinspointpara.Value = bd_socialbase.CorpIllnessInsPoint;
            paras.Add(corpillnessinspointpara);

            SqlParameter corpheatamountpointpara = new SqlParameter("@CorpHeatAmountPoint", SqlDbType.Decimal, 9);

            corpheatamountpointpara.Value = bd_socialbase.CorpHeatAmountPoint;
            paras.Add(corpheatamountpointpara);

            SqlParameter corphousefundpointpara = new SqlParameter("@CorpHouseFundPoint", SqlDbType.Decimal, 9);

            corphousefundpointpara.Value = bd_socialbase.CorpHouseFundPoint;
            paras.Add(corphousefundpointpara);

            SqlParameter corprepinjuryinspointpara = new SqlParameter("@CorpRepInjuryInsPoint", SqlDbType.Decimal, 9);

            corprepinjuryinspointpara.Value = bd_socialbase.CorpRepInjuryInsPoint;
            paras.Add(corprepinjuryinspointpara);

            SqlParameter emppensioninspointpara = new SqlParameter("@EmpPensionInsPoint", SqlDbType.Decimal, 9);

            emppensioninspointpara.Value = bd_socialbase.EmpPensionInsPoint;
            paras.Add(emppensioninspointpara);

            SqlParameter empmedicalinspointpara = new SqlParameter("@EmpMedicalInsPoint", SqlDbType.Decimal, 9);

            empmedicalinspointpara.Value = bd_socialbase.EmpMedicalInsPoint;
            paras.Add(empmedicalinspointpara);

            SqlParameter empunempinspointpara = new SqlParameter("@EmpUnempInsPoint", SqlDbType.Decimal, 9);

            empunempinspointpara.Value = bd_socialbase.EmpUnempInsPoint;
            paras.Add(empunempinspointpara);

            SqlParameter empinjuryinspointpara = new SqlParameter("@EmpInjuryInsPoint", SqlDbType.Decimal, 9);

            empinjuryinspointpara.Value = bd_socialbase.EmpInjuryInsPoint;
            paras.Add(empinjuryinspointpara);

            SqlParameter empbirthinspointpara = new SqlParameter("@EmpBirthInsPoint", SqlDbType.Decimal, 9);

            empbirthinspointpara.Value = bd_socialbase.EmpBirthInsPoint;
            paras.Add(empbirthinspointpara);

            SqlParameter empdisabledinspointpara = new SqlParameter("@EmpDisabledInsPoint", SqlDbType.Decimal, 9);

            empdisabledinspointpara.Value = bd_socialbase.EmpDisabledInsPoint;
            paras.Add(empdisabledinspointpara);

            SqlParameter empillnessinspointpara = new SqlParameter("@EmpIllnessInsPoint", SqlDbType.Decimal, 9);

            empillnessinspointpara.Value = bd_socialbase.EmpIllnessInsPoint;
            paras.Add(empillnessinspointpara);

            SqlParameter empheatamountpointpara = new SqlParameter("@EmpHeatAmountPoint", SqlDbType.Decimal, 9);

            empheatamountpointpara.Value = bd_socialbase.EmpHeatAmountPoint;
            paras.Add(empheatamountpointpara);

            SqlParameter emphousefundpointpara = new SqlParameter("@EmpHouseFundPoint", SqlDbType.Decimal, 9);

            emphousefundpointpara.Value = bd_socialbase.EmpHouseFundPoint;
            paras.Add(emphousefundpointpara);

            SqlParameter emprepinjuryinspointpara = new SqlParameter("@EmpRepInjuryInsPoint", SqlDbType.Decimal, 9);

            emprepinjuryinspointpara.Value = bd_socialbase.EmpRepInjuryInsPoint;
            paras.Add(emprepinjuryinspointpara);

            SqlParameter pensioninsfixpara = new SqlParameter("@PensionInsFix", SqlDbType.Decimal, 9);

            pensioninsfixpara.Value = bd_socialbase.PensionInsFix;
            paras.Add(pensioninsfixpara);

            SqlParameter medicalinsfixpara = new SqlParameter("@MedicalInsFix", SqlDbType.Decimal, 9);

            medicalinsfixpara.Value = bd_socialbase.MedicalInsFix;
            paras.Add(medicalinsfixpara);

            SqlParameter unempinsfixpara = new SqlParameter("@UnempInsFix", SqlDbType.Decimal, 9);

            unempinsfixpara.Value = bd_socialbase.UnempInsFix;
            paras.Add(unempinsfixpara);

            SqlParameter injuryinsfixpara = new SqlParameter("@InjuryInsFix", SqlDbType.Decimal, 9);

            injuryinsfixpara.Value = bd_socialbase.InjuryInsFix;
            paras.Add(injuryinsfixpara);

            SqlParameter birthinsfixpara = new SqlParameter("@BirthInsFix", SqlDbType.Decimal, 9);

            birthinsfixpara.Value = bd_socialbase.BirthInsFix;
            paras.Add(birthinsfixpara);

            SqlParameter disabledinsfixpara = new SqlParameter("@DisabledInsFix", SqlDbType.Decimal, 9);

            disabledinsfixpara.Value = bd_socialbase.DisabledInsFix;
            paras.Add(disabledinsfixpara);

            SqlParameter illnessinsfixpara = new SqlParameter("@IllnessInsFix", SqlDbType.Decimal, 9);

            illnessinsfixpara.Value = bd_socialbase.IllnessInsFix;
            paras.Add(illnessinsfixpara);

            SqlParameter heatamountfixpara = new SqlParameter("@HeatAmountFix", SqlDbType.Decimal, 9);

            heatamountfixpara.Value = bd_socialbase.HeatAmountFix;
            paras.Add(heatamountfixpara);

            SqlParameter housefundfixpara = new SqlParameter("@HouseFundFix", SqlDbType.Decimal, 9);

            housefundfixpara.Value = bd_socialbase.HouseFundFix;
            paras.Add(housefundfixpara);

            SqlParameter repinjuryinsfixpara = new SqlParameter("@RepInjuryInsFix", SqlDbType.Decimal, 9);

            repinjuryinsfixpara.Value = bd_socialbase.RepInjuryInsFix;
            paras.Add(repinjuryinsfixpara);


            return(paras);
        }
Beispiel #15
0
        protected override IModel CreateModel(SqlDataReader dr)
        {
            SocialBase socialbase = new SocialBase();

            int indexSocId = dr.GetOrdinal("SocId");

            socialbase.SocId = Convert.ToInt32(dr[indexSocId]);
            int indexCityId = dr.GetOrdinal("CityId");

            socialbase.CityId = Convert.ToInt32(dr[indexCityId]);
            int indexSocName = dr.GetOrdinal("SocName");

            if (dr[indexSocName] != DBNull.Value)
            {
                socialbase.SocName = Convert.ToString(dr[indexSocName]);
            }
            int indexPensionInsNum = dr.GetOrdinal("PensionInsNum");

            if (dr[indexPensionInsNum] != DBNull.Value)
            {
                socialbase.PensionInsNum = Convert.ToDecimal(dr[indexPensionInsNum]);
            }
            int indexMedicalInsNum = dr.GetOrdinal("MedicalInsNum");

            if (dr[indexMedicalInsNum] != DBNull.Value)
            {
                socialbase.MedicalInsNum = Convert.ToDecimal(dr[indexMedicalInsNum]);
            }
            int indexUnempInsNum = dr.GetOrdinal("UnempInsNum");

            if (dr[indexUnempInsNum] != DBNull.Value)
            {
                socialbase.UnempInsNum = Convert.ToDecimal(dr[indexUnempInsNum]);
            }
            int indexInjuryInsNum = dr.GetOrdinal("InjuryInsNum");

            if (dr[indexInjuryInsNum] != DBNull.Value)
            {
                socialbase.InjuryInsNum = Convert.ToDecimal(dr[indexInjuryInsNum]);
            }
            int indexBirthInsNum = dr.GetOrdinal("BirthInsNum");

            if (dr[indexBirthInsNum] != DBNull.Value)
            {
                socialbase.BirthInsNum = Convert.ToDecimal(dr[indexBirthInsNum]);
            }
            int indexDisabledInsNum = dr.GetOrdinal("DisabledInsNum");

            if (dr[indexDisabledInsNum] != DBNull.Value)
            {
                socialbase.DisabledInsNum = Convert.ToDecimal(dr[indexDisabledInsNum]);
            }
            int indexIllnessInsNum = dr.GetOrdinal("IllnessInsNum");

            if (dr[indexIllnessInsNum] != DBNull.Value)
            {
                socialbase.IllnessInsNum = Convert.ToDecimal(dr[indexIllnessInsNum]);
            }
            int indexHeatAmountNum = dr.GetOrdinal("HeatAmountNum");

            if (dr[indexHeatAmountNum] != DBNull.Value)
            {
                socialbase.HeatAmountNum = Convert.ToDecimal(dr[indexHeatAmountNum]);
            }
            int indexHouseFundINum = dr.GetOrdinal("HouseFundINum");

            if (dr[indexHouseFundINum] != DBNull.Value)
            {
                socialbase.HouseFundINum = Convert.ToDecimal(dr[indexHouseFundINum]);
            }
            int indexRepInjuryInsNum = dr.GetOrdinal("RepInjuryInsNum");

            if (dr[indexRepInjuryInsNum] != DBNull.Value)
            {
                socialbase.RepInjuryInsNum = Convert.ToDecimal(dr[indexRepInjuryInsNum]);
            }
            int indexCorpPensionInsPoint = dr.GetOrdinal("CorpPensionInsPoint");

            if (dr[indexCorpPensionInsPoint] != DBNull.Value)
            {
                socialbase.CorpPensionInsPoint = Convert.ToDecimal(dr[indexCorpPensionInsPoint]);
            }
            int indexCorpMedicalInsPoint = dr.GetOrdinal("CorpMedicalInsPoint");

            if (dr[indexCorpMedicalInsPoint] != DBNull.Value)
            {
                socialbase.CorpMedicalInsPoint = Convert.ToDecimal(dr[indexCorpMedicalInsPoint]);
            }
            int indexCorpUnempInsPoint = dr.GetOrdinal("CorpUnempInsPoint");

            if (dr[indexCorpUnempInsPoint] != DBNull.Value)
            {
                socialbase.CorpUnempInsPoint = Convert.ToDecimal(dr[indexCorpUnempInsPoint]);
            }
            int indexCorpInjuryInsPoint = dr.GetOrdinal("CorpInjuryInsPoint");

            if (dr[indexCorpInjuryInsPoint] != DBNull.Value)
            {
                socialbase.CorpInjuryInsPoint = Convert.ToDecimal(dr[indexCorpInjuryInsPoint]);
            }
            int indexCorpBirthInsPoint = dr.GetOrdinal("CorpBirthInsPoint");

            if (dr[indexCorpBirthInsPoint] != DBNull.Value)
            {
                socialbase.CorpBirthInsPoint = Convert.ToDecimal(dr[indexCorpBirthInsPoint]);
            }
            int indexCorpDisabledInsPoint = dr.GetOrdinal("CorpDisabledInsPoint");

            if (dr[indexCorpDisabledInsPoint] != DBNull.Value)
            {
                socialbase.CorpDisabledInsPoint = Convert.ToDecimal(dr[indexCorpDisabledInsPoint]);
            }
            int indexCorpIllnessInsPoint = dr.GetOrdinal("CorpIllnessInsPoint");

            if (dr[indexCorpIllnessInsPoint] != DBNull.Value)
            {
                socialbase.CorpIllnessInsPoint = Convert.ToDecimal(dr[indexCorpIllnessInsPoint]);
            }
            int indexCorpHeatAmountPoint = dr.GetOrdinal("CorpHeatAmountPoint");

            if (dr[indexCorpHeatAmountPoint] != DBNull.Value)
            {
                socialbase.CorpHeatAmountPoint = Convert.ToDecimal(dr[indexCorpHeatAmountPoint]);
            }
            int indexCorpHouseFundPoint = dr.GetOrdinal("CorpHouseFundPoint");

            if (dr[indexCorpHouseFundPoint] != DBNull.Value)
            {
                socialbase.CorpHouseFundPoint = Convert.ToDecimal(dr[indexCorpHouseFundPoint]);
            }
            int indexCorpRepInjuryInsPoint = dr.GetOrdinal("CorpRepInjuryInsPoint");

            if (dr[indexCorpRepInjuryInsPoint] != DBNull.Value)
            {
                socialbase.CorpRepInjuryInsPoint = Convert.ToDecimal(dr[indexCorpRepInjuryInsPoint]);
            }
            int indexEmpPensionInsPoint = dr.GetOrdinal("EmpPensionInsPoint");

            if (dr[indexEmpPensionInsPoint] != DBNull.Value)
            {
                socialbase.EmpPensionInsPoint = Convert.ToDecimal(dr[indexEmpPensionInsPoint]);
            }
            int indexEmpMedicalInsPoint = dr.GetOrdinal("EmpMedicalInsPoint");

            if (dr[indexEmpMedicalInsPoint] != DBNull.Value)
            {
                socialbase.EmpMedicalInsPoint = Convert.ToDecimal(dr[indexEmpMedicalInsPoint]);
            }
            int indexEmpUnempInsPoint = dr.GetOrdinal("EmpUnempInsPoint");

            if (dr[indexEmpUnempInsPoint] != DBNull.Value)
            {
                socialbase.EmpUnempInsPoint = Convert.ToDecimal(dr[indexEmpUnempInsPoint]);
            }
            int indexEmpInjuryInsPoint = dr.GetOrdinal("EmpInjuryInsPoint");

            if (dr[indexEmpInjuryInsPoint] != DBNull.Value)
            {
                socialbase.EmpInjuryInsPoint = Convert.ToDecimal(dr[indexEmpInjuryInsPoint]);
            }
            int indexEmpBirthInsPoint = dr.GetOrdinal("EmpBirthInsPoint");

            if (dr[indexEmpBirthInsPoint] != DBNull.Value)
            {
                socialbase.EmpBirthInsPoint = Convert.ToDecimal(dr[indexEmpBirthInsPoint]);
            }
            int indexEmpDisabledInsPoint = dr.GetOrdinal("EmpDisabledInsPoint");

            if (dr[indexEmpDisabledInsPoint] != DBNull.Value)
            {
                socialbase.EmpDisabledInsPoint = Convert.ToDecimal(dr[indexEmpDisabledInsPoint]);
            }
            int indexEmpIllnessInsPoint = dr.GetOrdinal("EmpIllnessInsPoint");

            if (dr[indexEmpIllnessInsPoint] != DBNull.Value)
            {
                socialbase.EmpIllnessInsPoint = Convert.ToDecimal(dr[indexEmpIllnessInsPoint]);
            }
            int indexEmpHeatAmountPoint = dr.GetOrdinal("EmpHeatAmountPoint");

            if (dr[indexEmpHeatAmountPoint] != DBNull.Value)
            {
                socialbase.EmpHeatAmountPoint = Convert.ToDecimal(dr[indexEmpHeatAmountPoint]);
            }
            int indexEmpHouseFundPoint = dr.GetOrdinal("EmpHouseFundPoint");

            if (dr[indexEmpHouseFundPoint] != DBNull.Value)
            {
                socialbase.EmpHouseFundPoint = Convert.ToDecimal(dr[indexEmpHouseFundPoint]);
            }
            int indexEmpRepInjuryInsPoint = dr.GetOrdinal("EmpRepInjuryInsPoint");

            if (dr[indexEmpRepInjuryInsPoint] != DBNull.Value)
            {
                socialbase.EmpRepInjuryInsPoint = Convert.ToDecimal(dr[indexEmpRepInjuryInsPoint]);
            }
            int indexPensionInsFix = dr.GetOrdinal("PensionInsFix");

            if (dr[indexPensionInsFix] != DBNull.Value)
            {
                socialbase.PensionInsFix = Convert.ToDecimal(dr[indexPensionInsFix]);
            }
            int indexMedicalInsFix = dr.GetOrdinal("MedicalInsFix");

            if (dr[indexMedicalInsFix] != DBNull.Value)
            {
                socialbase.MedicalInsFix = Convert.ToDecimal(dr[indexMedicalInsFix]);
            }
            int indexUnempInsFix = dr.GetOrdinal("UnempInsFix");

            if (dr[indexUnempInsFix] != DBNull.Value)
            {
                socialbase.UnempInsFix = Convert.ToDecimal(dr[indexUnempInsFix]);
            }
            int indexInjuryInsFix = dr.GetOrdinal("InjuryInsFix");

            if (dr[indexInjuryInsFix] != DBNull.Value)
            {
                socialbase.InjuryInsFix = Convert.ToDecimal(dr[indexInjuryInsFix]);
            }
            int indexBirthInsFix = dr.GetOrdinal("BirthInsFix");

            if (dr[indexBirthInsFix] != DBNull.Value)
            {
                socialbase.BirthInsFix = Convert.ToDecimal(dr[indexBirthInsFix]);
            }
            int indexDisabledInsFix = dr.GetOrdinal("DisabledInsFix");

            if (dr[indexDisabledInsFix] != DBNull.Value)
            {
                socialbase.DisabledInsFix = Convert.ToDecimal(dr[indexDisabledInsFix]);
            }
            int indexIllnessInsFix = dr.GetOrdinal("IllnessInsFix");

            if (dr[indexIllnessInsFix] != DBNull.Value)
            {
                socialbase.IllnessInsFix = Convert.ToDecimal(dr[indexIllnessInsFix]);
            }
            int indexHeatAmountFix = dr.GetOrdinal("HeatAmountFix");

            if (dr[indexHeatAmountFix] != DBNull.Value)
            {
                socialbase.HeatAmountFix = Convert.ToDecimal(dr[indexHeatAmountFix]);
            }
            int indexHouseFundFix = dr.GetOrdinal("HouseFundFix");

            if (dr[indexHouseFundFix] != DBNull.Value)
            {
                socialbase.HouseFundFix = Convert.ToDecimal(dr[indexHouseFundFix]);
            }
            int indexRepInjuryInsFix = dr.GetOrdinal("RepInjuryInsFix");

            if (dr[indexRepInjuryInsFix] != DBNull.Value)
            {
                socialbase.RepInjuryInsFix = Convert.ToDecimal(dr[indexRepInjuryInsFix]);
            }

            return(socialbase);
        }