Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //页面初期表示
     if (!IsPostBack)
     {
         //显示工资项列表
         //InitSalaryInfo();
         //岗位初期
         DataTable dtQuarter = DeptQuarterBus.GetQuarterInfoWithCompanyCD();
         ddlQuarter.DataSource     = dtQuarter;
         ddlQuarter.DataValueField = "ID";
         ddlQuarter.DataTextField  = "QuarterName";
         ddlQuarter.DataBind();
         //添加一请选择选项
         ListItem Item = new ListItem(ConstUtil.CODE_TYPE_INSERT_TEXT, ConstUtil.CODE_TYPE_INSERT_VALUE);
         ddlQuarter.Items.Insert(0, Item);
         DataTable     dtTaxInfo = InputPersonTrueIncomeTaxBus.PersonTaxInfo();
         StringBuilder message   = new StringBuilder();
         if (dtTaxInfo != null || dtTaxInfo.Rows.Count > 1)
         {
             //遍历个人所得税的所有信息
             for (int i = 0; i < dtTaxInfo.Rows.Count; i++)
             {
                 string MinMoney   = GetSafeData.GetStringFromDecimal(dtTaxInfo.Rows[i], "MinMoney");
                 string MaxMoney   = GetSafeData.GetStringFromDecimal(dtTaxInfo.Rows[i], "MaxMoney");
                 string TaxPercent = GetSafeData.GetStringFromDecimal(dtTaxInfo.Rows[i], "TaxPercent");
                 string MinusMoney = GetSafeData.GetStringFromDecimal(dtTaxInfo.Rows[i], "MinusMoney");
                 message.AppendLine(MinMoney + "," + MaxMoney + "," + TaxPercent + "," + MinusMoney + "@");
             }
         }
         hidTaxInfo.Value = message.ToString();
     }
 }
Ejemplo n.º 2
0
        private static OtherCorpInfoModel ChangeOtherCorpInfoModel(DataRow data)
        {
            //定义返回的 EmployeeInfoModel
            OtherCorpInfoModel model = new OtherCorpInfoModel();

            //人员信息存在时,转化为model形式的数据
            if (data != null)
            {
                model.ID             = GetSafeData.ValidateDataRow_Int(data, "ID");
                model.CompanyCD      = GetSafeData.ValidateDataRow_String(data, "CompanyCD");
                model.BigType        = GetSafeData.ValidateDataRow_String(data, "BigType");
                model.CustNo         = GetSafeData.ValidateDataRow_String(data, "CustNo");
                model.CustName       = GetSafeData.ValidateDataRow_String(data, "CustName");
                model.CorpNam        = GetSafeData.ValidateDataRow_String(data, "CorpNam");
                model.PYShort        = GetSafeData.ValidateDataRow_String(data, "PYShort");
                model.CustNote       = GetSafeData.ValidateDataRow_String(data, "CustNote");
                model.AreaID         = GetSafeData.GetStringFromInt(data, "AreaID");
                model.CompanyType    = GetSafeData.ValidateDataRow_String(data, "CompanyType");
                model.StaffCount     = GetSafeData.GetStringFromInt(data, "StaffCount");
                model.SetupDate      = GetSafeData.ValidateDataRow_String(data, "SetupDate");
                model.ArtiPerson     = GetSafeData.ValidateDataRow_String(data, "ArtiPerson");
                model.SetupMoney     = GetSafeData.GetStringFromDecimal(data, "SetupMoney");
                model.SetupAddress   = GetSafeData.ValidateDataRow_String(data, "SetupAddress");
                model.CapitalScale   = GetSafeData.GetStringFromDecimal(data, "CapitalScale");
                model.SaleroomY      = GetSafeData.GetStringFromDecimal(data, "SaleroomY");
                model.ProfitY        = GetSafeData.GetStringFromDecimal(data, "ProfitY");
                model.TaxCD          = GetSafeData.ValidateDataRow_String(data, "TaxCD");
                model.BusiNumber     = GetSafeData.ValidateDataRow_String(data, "BusiNumber");
                model.isTax          = GetSafeData.ValidateDataRow_String(data, "isTax");
                model.SellArea       = GetSafeData.ValidateDataRow_String(data, "SellArea");
                model.CountryID      = GetSafeData.GetStringFromInt(data, "CountryID");
                model.Province       = GetSafeData.ValidateDataRow_String(data, "Province");
                model.City           = GetSafeData.ValidateDataRow_String(data, "City");
                model.Post           = GetSafeData.ValidateDataRow_String(data, "Post");
                model.ContactName    = GetSafeData.ValidateDataRow_String(data, "ContactName");
                model.Tel            = GetSafeData.ValidateDataRow_String(data, "Tel");
                model.Fax            = GetSafeData.ValidateDataRow_String(data, "Fax");
                model.Mobile         = GetSafeData.ValidateDataRow_String(data, "Mobile");
                model.email          = GetSafeData.ValidateDataRow_String(data, "email");
                model.Addr           = GetSafeData.ValidateDataRow_String(data, "Addr");
                model.BillType       = GetSafeData.ValidateDataRow_String(data, "BillType");
                model.PayType        = GetSafeData.GetStringFromInt(data, "PayType");
                model.MoneyType      = GetSafeData.GetStringFromInt(data, "MoneyType");
                model.CurrencyType   = GetSafeData.GetStringFromInt(data, "CurrencyType");
                model.Remark         = GetSafeData.ValidateDataRow_String(data, "Remark");
                model.UsedStatus     = GetSafeData.ValidateDataRow_String(data, "UsedStatus");
                model.Creator        = GetSafeData.GetStringFromInt(data, "Creator");
                model.CreateDate     = GetSafeData.GetStringFromDateTime(data, "CreateDate", "yyyy-MM-dd");
                model.ModifiedDate   = GetSafeData.GetStringFromDateTime(data, "ModifiedDate", "yyyy-MM-dd");
                model.ModifiedUserID = GetSafeData.ValidateDataRow_String(data, "ModifiedUserID");
                model.EmployeeName   = GetSafeData.ValidateDataRow_String(data, "EmployeeName");
            }

            return(model);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 查询计时工资项信息
        /// </summary>
        /// <param name="model">查询条件</param>
        /// <param name="itemNo">计时项目编号</param>
        /// <returns></returns>
        public static string GetPieceworkSalaryInfo(EmployeeSearchModel model, string itemNo)
        {
            //获取登陆用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];

            //设置公司代码
            model.CompanyCD = userInfo.CompanyCD;
            //获取满足条件的人员信息查询
            DataTable dtEmplInfo = PieceworkSalaryDBHelper.GetEmplInfo(model, itemNo);

            //变量定义
            StringBuilder sbPieceworkSalaryInfo = new StringBuilder();

            //数据存在时,设置数据
            if (dtEmplInfo != null && dtEmplInfo.Rows.Count > 0)
            {
                //设置记录数
                model.RecordCount = dtEmplInfo.Rows.Count.ToString();
                //遍历员工获取计时工资信息
                for (int i = 0; i < dtEmplInfo.Rows.Count; i++)
                {
                    //获取人员ID
                    string emplID = GetSafeData.GetStringFromInt(dtEmplInfo.Rows[i], "EmployeeID");
                    //获取人员计时工资
                    DataTable dtPeiceItemInfo = PieceworkSalaryDBHelper.GetPeiceItemInfo(model.CompanyCD
                                                                                         , emplID, itemNo, model.StartDate, model.EndDate);

                    //变量定义
                    decimal       totalMoney         = 0;
                    int           pieceworkItemCount = 0;
                    int           totalRowCount      = 0;
                    StringBuilder sbEmplFirstRow     = new StringBuilder();
                    StringBuilder sbEmplNotFirstRow  = new StringBuilder();
                    //获取工资项目总数
                    if (dtPeiceItemInfo != null && dtPeiceItemInfo.Rows.Count > 0)
                    {
                        pieceworkItemCount = dtPeiceItemInfo.Rows.Count;
                    }

                    #region 生成每个计时项目的具体信息
                    //遍历工资项
                    for (int j = 0; j < pieceworkItemCount; j++)
                    {
                        //变量定义
                        decimal       pieceworkTotalMoney    = 0;
                        StringBuilder sbPieceworkFirstRow    = new StringBuilder();
                        StringBuilder sbPieceworkNotFirstRow = new StringBuilder();
                        //获取工资项编号
                        string pieceworkItemNo = GetSafeData.ValidateDataRow_String(dtPeiceItemInfo.Rows[j], "ItemNo");
                        //获取工资内容
                        DataTable dtPieceworkSalaryInfo = PieceworkSalaryDBHelper.GetPieceworkSalaryInfo(model.CompanyCD
                                                                                                         , emplID, pieceworkItemNo, model.StartDate, model.EndDate);
                        //获取工资内容总数
                        int PieceworkSalaryCount = 0;
                        if (dtPieceworkSalaryInfo != null && dtPieceworkSalaryInfo.Rows.Count > 0)
                        {
                            PieceworkSalaryCount = dtPieceworkSalaryInfo.Rows.Count;
                        }
                        //单价
                        string price = StringUtil.TrimZero(GetSafeData.GetStringFromDecimal(dtPeiceItemInfo.Rows[j], "UnitPrice"));

                        StringBuilder sbItemTemp = new StringBuilder();

                        //
                        //工资编号
                        sbItemTemp.AppendLine("<td class='tdColInputCenter'  rowspan='" + PieceworkSalaryCount.ToString() + "'>"
                                              + "<input type='hidden' id='txtSalaryNo_" + (i + 1).ToString() + "_" + (j + 1).ToString() + "' value='" + pieceworkItemNo + "' />"
                                              + "<input type='hidden' id='txtSalaryCount_" + (i + 1).ToString() + "_" + (j + 1).ToString() + "' value='"
                                              + PieceworkSalaryCount + "' />"
                                              + GetSafeData.ValidateDataRow_String(dtPeiceItemInfo.Rows[j], "ItemName") + "</td>");
                        //单价
                        sbItemTemp.AppendLine("<td class='tdColInputCenter'   rowspan='" + PieceworkSalaryCount.ToString() + "' id='tdUnitPrice_"
                                              + (i + 1).ToString() + "_" + (j + 1).ToString() + "' >" + price + "</td>");
                        //第一行时
                        if (j == 0)
                        {
                            sbEmplFirstRow.AppendLine(sbItemTemp.ToString());
                        }
                        else
                        {
                            //行开始
                            sbEmplNotFirstRow.AppendLine("<tr>");
                            sbEmplNotFirstRow.AppendLine(sbItemTemp.ToString());
                        }
                        //遍历所有项目获取具体
                        for (int x = 0; x < PieceworkSalaryCount; x++)
                        {
                            StringBuilder sbTemp = new StringBuilder();
                            //数量
                            string amount = StringUtil.TrimZero(GetSafeData.GetStringFromDecimal(dtPieceworkSalaryInfo.Rows[x], "Amount"));
                            sbTemp.AppendLine("<td class='tdColInputCenter' >"
                                              + "<input type='text' class='tdinput'   readonly='readonly'   id='txtAmount_" + (i + 1).ToString() + "_" + (j + 1).ToString()
                                              + "_" + (x + 1).ToString() + "' value='" + amount + "' style='width=95%;background-color:#FFFFE0;'"
                                              + " onblur='CalculateTotalSalary(this, \"" + (i + 1).ToString() + "\", \"" + (j + 1).ToString()
                                              + "\", \"" + (x + 1).ToString() + "\");'  onchange='Number_round(this,\"2\");'   maxlength = '8' />" + "</td>");
                            //金额
                            string salaryMoney = StringUtil.TrimZero(GetSafeData.GetStringFromDecimal(dtPieceworkSalaryInfo.Rows[x], "SalaryMoney"));
                            sbTemp.AppendLine("<td class='tdColInputCenter' id='tdAmountMoney_" + (i + 1).ToString() + "_" + (j + 1).ToString()
                                              + "_" + (x + 1).ToString() + "' >" + salaryMoney + "</td>");
                            //日期
                            sbTemp.AppendLine("<td class='tdColInputCenter' id='tdSalaryDate_" + (i + 1).ToString() + "_" + (j + 1).ToString()
                                              + "_" + (x + 1).ToString() + "'>" + GetSafeData.ValidateDataRow_String(dtPieceworkSalaryInfo.Rows[x], "PieceDate") + "</td>");
                            //来源
                            //sbTemp.AppendLine("<td class='tdColInputCenter' id='tdSalaryDate_" + (i + 1).ToString() + "_" + (j + 1).ToString()
                            //                + "_" + (x + 1).ToString() + "'>" + GetSafeData.ValidateDataRow_String(dtPieceworkSalaryInfo.Rows[x], "PieceDate") + "</td>");
                            //计算小计金额
                            pieceworkTotalMoney += decimal.Parse(salaryMoney);
                            if (x == 0)
                            {
                                //人员的第一行信息时
                                if (j == 0)
                                {
                                    sbEmplFirstRow.AppendLine(sbTemp.ToString());
                                }
                                //不是人员的第一行信息,但是是计时工资项的第一行信息
                                else
                                {
                                    sbPieceworkFirstRow.AppendLine(sbTemp.ToString());
                                }
                            }
                            else
                            {
                                //行开始
                                sbPieceworkNotFirstRow.AppendLine("<tr>");
                                sbPieceworkNotFirstRow.AppendLine(sbTemp.ToString());
                                //行结束
                                sbPieceworkNotFirstRow.AppendLine("</tr>");
                            }
                        }

                        //工资小计
                        if (j == 0)
                        {
                            sbEmplFirstRow.AppendLine("<td id='tdAmountTotalMoney_" + (i + 1).ToString() + "_" + (j + 1).ToString()
                                                      + "' class='tdColInputCenter'  rowspan='" + PieceworkSalaryCount.ToString() + "'>" + pieceworkTotalMoney.ToString() + "</td>");
                        }
                        else
                        {
                            sbPieceworkFirstRow.AppendLine("<td id='tdAmountTotalMoney_" + (i + 1).ToString() + "_" + (j + 1).ToString()
                                                           + "' class='tdColInputCenter'  rowspan='" + PieceworkSalaryCount.ToString() + "'>" + pieceworkTotalMoney.ToString() + "</td></tr>");
                        }
                        //计算合计金额
                        totalMoney += pieceworkTotalMoney;
                        //行数统计
                        totalRowCount += PieceworkSalaryCount;
                        //非第一行时,添加到非第一行的信息里
                        sbEmplNotFirstRow.AppendLine(sbPieceworkFirstRow.ToString() + sbPieceworkNotFirstRow.ToString());
                    }
                    #endregion

                    //行开始
                    sbPieceworkSalaryInfo.AppendLine("<tr>");

                    //选择
                    sbPieceworkSalaryInfo.AppendLine("<td class='tdColInputCenter'  rowspan='" + totalRowCount.ToString() + "'>"
                                                     + "<input id='chkSelect_" + (i + 1).ToString() + "' name='chkSelect'  value='" + GetSafeData.ValidateDataRow_String(dtEmplInfo.Rows[i], "EmployeeNo") + "'  type='checkbox'  onpropertychange='getChage(this)'  />" + "</td>");
                    //人员编号
                    sbPieceworkSalaryInfo.AppendLine("<td class='tdColInputCenter'  rowspan='" + totalRowCount.ToString() + "'>"
                                                     + "<input type='hidden' id='txtEmplID_" + (i + 1).ToString() + "' value='" + emplID + "' />"
                                                     + "<input type='hidden' id='txtItemCount_" + (i + 1).ToString() + "' value='" + pieceworkItemCount + "' />"
                                                     + GetSafeData.ValidateDataRow_String(dtEmplInfo.Rows[i], "EmployeeNo") + "</td>");
                    //人员姓名
                    sbPieceworkSalaryInfo.AppendLine("<td class='tdColInputCenter'  rowspan='" + totalRowCount.ToString() + "'>"
                                                     + GetSafeData.ValidateDataRow_String(dtEmplInfo.Rows[i], "EmployeeName") + "</td>");
                    //所在部门
                    sbPieceworkSalaryInfo.AppendLine("<td class='tdColInputCenter'  rowspan='" + totalRowCount.ToString() + "'>"
                                                     + GetSafeData.ValidateDataRow_String(dtEmplInfo.Rows[i], "DeptName") + "</td>");
                    //岗位名称
                    sbPieceworkSalaryInfo.AppendLine("<td class='tdColInputCenter'  rowspan='" + totalRowCount.ToString() + "'>"
                                                     + GetSafeData.ValidateDataRow_String(dtEmplInfo.Rows[i], "QuarterName") + "</td>");
                    //岗位职等
                    sbPieceworkSalaryInfo.AppendLine("<td class='tdColInputCenter'  rowspan='" + totalRowCount.ToString() + "'>"
                                                     + GetSafeData.ValidateDataRow_String(dtEmplInfo.Rows[i], "AdminLevelName") + "</td>");

                    //具体的计时项目信息
                    sbPieceworkSalaryInfo.AppendLine(sbEmplFirstRow.ToString());

                    //工资合计
                    sbPieceworkSalaryInfo.AppendLine("<td class='tdColInputCenter' id='tdTotalMoney_" + (i + 1).ToString() + "' rowspan='" + totalRowCount.ToString() + "'>" + totalMoney.ToString() + "</td>");

                    //行结束
                    sbPieceworkSalaryInfo.AppendLine("</tr>");
                    //具体的计时项目信息
                    sbPieceworkSalaryInfo.AppendLine(sbEmplNotFirstRow.ToString());
                }
            }

            return(sbPieceworkSalaryInfo.ToString());
        }
Ejemplo n.º 4
0
    /// <summary>
    /// 根据培训ID,获取培训信息,并设置到页面显示
    /// </summary>
    /// <param name="trainingID">培训ID</param>
    private void InitTrainingInfo(string trainingID)
    {
        //设置培训编号可见
        divTrainingNo.Attributes.Add("style", "display:block;");
        //自动生成编号的控件设置为不可见
        divCodeRule.Attributes.Add("style", "display:none;");

        //查询培训信息
        DataSet dsTrainingInfo = TrainingBus.GetTrainingInfoWithID(trainingID);
        //获取培训基本信息
        DataTable dtBaseInfo = dsTrainingInfo.Tables[0];

        //基本信息存在时
        if (dtBaseInfo != null && dtBaseInfo.Rows.Count > 0)
        {
            #region 设置培训基本信息
            //培训编号
            divTrainingNo.InnerHtml = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "TrainingNo");
            //培训名称
            txtTrainingName.Text = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "TrainingName");
            //发起时间
            txtApplyDate.Text = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "ApplyDate");
            //发起人
            UserCreaterName.Text = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "EmployeeName");
            txtCreateID.Value    = GetSafeData.GetStringFromInt(dtBaseInfo.Rows[0], "EmployeeID");
            //项目编号
            txtProjectNo.Text = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "ProjectNo");
            //项目名称
            txtProjectName.Text = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "ProjectName");
            //培训机构
            txtTrainingOrgan.Text = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "TrainingOrgan");
            //预算费用
            txtPlanCost.Text = GetSafeData.GetStringFromDecimal(dtBaseInfo.Rows[0], "PlanCost");
            //培训天数
            txtTrainingCount.Text = GetSafeData.GetStringFromInt(dtBaseInfo.Rows[0], "TrainingCount");
            //培训地点
            txtTrainingPlace.Text = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "TrainingPlace");
            //培训方式
            ddlTrainingWay.SelectedValue = GetSafeData.GetStringFromInt(dtBaseInfo.Rows[0], "TrainingWay");
            //培训老师
            txtTrainingTeacher.Text = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "TrainingTeacher");
            //开始时间
            txtStartDate.Text = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "StartDate");
            //结束时间
            txtEndDate.Text = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "EndDate");
            //考核人
            txtCheckPerson.Text = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "CheckPerson");
            //附件
            string attatchment = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "Attachment");
            hfAttachment.Value     = attatchment;
            hfPageAttachment.Value = attatchment;
            //设置下载 上传的显示
            if (string.IsNullOrEmpty(attatchment))
            {
                //简历处理不显示
                divDealAttachment.Attributes.Add("style", "display:none;");
                //上传简历显示
                divUploadAttachment.Attributes.Add("style", "display:block;");
            }
            else
            {
                //上传简历不显示
                divUploadAttachment.Attributes.Add("style", "display:none;");
                //简历处理显示
                divDealAttachment.Attributes.Add("style", "display:block;");
            }
            spanAttachmentName.InnerHtml = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "AttachmentName");
            //目的
            txtGoal.Text = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "Goal");
            //培训备注
            txtTrainingRemark.Text = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "TrainingRemark");
            #endregion

            //设置参与人员
            InitJionUserInfo(dsTrainingInfo.Tables[1]);
            //设置招聘目标
            InitScheduleInfo(dsTrainingInfo.Tables[2]);
        }
    }