Esempio n. 1
0
        public ActionResult Create(salary_standard sl, salary_standard_details[] sd)
        {
            int num = 0;
            int j   = 0;

            //事务提交
            using (TransactionScope ts = new TransactionScope())
            {
                foreach (salary_standard_details item in sd)
                {
                    if (item.salary > 0)
                    {
                        j++;
                        item.standard_id   = sl.standard_id;
                        item.standard_name = sl.standard_name;
                        num += sdbll.salary_standard_detailsInsert(item);
                    }
                }
                if (slbll.salary_standardInsert(sl) > 0 && num == j)
                {
                    ts.Complete();
                    return(RedirectToAction("salarystandard_register_success", "Salary_Data"));
                }
                else
                {
                    return(View());
                }
            }
        }
Esempio n. 2
0
        public ActionResult index(human_file hf)
        {
            config_file_first_kind  s   = ifkb.selectWhere(e => e.first_kind_id == hf.first_kind_id).FirstOrDefault();
            config_file_second_kind s1  = iskb.SelectWhere(e => e.second_kind_id == hf.second_kind_id).FirstOrDefault();
            config_file_third_kind  s2  = itkb.SelectWhere(e => e.third_kind_id == hf.third_kind_id).FirstOrDefault();
            config_major            s3  = imb.SelectWhere(e => e.major_id == hf.human_major_id).FirstOrDefault();
            config_major_kind       s4  = imkb.SelectWhere(e => e.major_kind_id == hf.human_major_kind_id).FirstOrDefault();
            salary_standard         ssd = issdb.SelectWhere(e => e.standard_id == hf.salary_standard_id).FirstOrDefault();

            hf.salary_standard_name  = ssd.standard_name;
            hf.first_kind_name       = s.first_kind_name;
            hf.second_kind_name      = s1.second_kind_name;
            hf.third_kind_name       = s2.third_kind_name;
            hf.hunma_major_name      = s3.major_name;
            hf.human_major_kind_name = s4.major_kind_name;
            hf.check_status          = 0;
            hf.salary_sum            = ssd.salary_sum;
            hf.demand_salaray_sum    = ssd.salary_sum;
            hf.paid_salary_sum       = ssd.salary_sum;
            hf.file_chang_amount     = 0;
            hf.lastly_change_time    = DateTime.Now;
            if (ihdb.Update(hf) > 0)
            {
                return(Content("<script>location.href='/Human_file/Top_file/" + hf.huf_id + "'</script>"));
            }
            else
            {
                return(Content("<script>alert('登记失败');location.href='/Human_file/index'</script>"));
            }
        }
Esempio n. 3
0
        public ActionResult salarystandard_change(salary_standard sl, short id)
        {
            salary_standard u = new salary_standard()
            {
                ssd_id        = id,
                standard_id   = sl.standard_id,
                standard_name = sl.standard_name,
                salary_sum    = sl.salary_sum,
                designer      = sl.designer,                //制定者名字
                register      = sl.register,                //登记人:register
                checker       = sl.checker, /*sl.register*/ //前台复核人:checker就是登记人:register
                changer       = sl.checker,                 //变更人
                regist_time   = sl.regist_time,             //登记时间:regist_time
                check_time    = sl.check_time,              //复核时间:check_time
                change_time   = sl.check_time,              //变更时间
                check_comment = sl.check_comment,
                remark        = sl.remark,
                check_status  = sl.check_status, //复核状态
                change_status = 1                //当此方法通过时 就是通过变更
            };
            int num = slbll.salary_standardUpdate(u);

            if (num > 0)
            {
                return(RedirectToAction("salarystandard_change_success", "Salary_Data"));
            }
            else
            {
                return(View());
            }
        }
Esempio n. 4
0
        public ActionResult FuHe(human_file hfa)
        {
            salary_standard ssd = issdb.SelectWhere(e => e.standard_id == hfa.salary_standard_id).FirstOrDefault();

            hfa.salary_standard_name = ssd.standard_name;
            hfa.check_status         = 1;
            hfa.salary_sum           = ssd.salary_sum;
            hfa.demand_salaray_sum   = ssd.salary_sum;
            hfa.paid_salary_sum      = ssd.salary_sum;
            hfa.human_file_status    = true;
            if (hfa.file_chang_amount == null)
            {
                hfa.file_chang_amount = 0;
            }
            else
            {
                hfa.file_chang_amount++;
            }

            hfa.lastly_change_time = DateTime.Now;
            if (ihdb.Update(hfa) > 0)
            {
                return(Content("<script>location.href='/Human_file/Top_file/" + hfa.huf_id + "'</script>"));
            }
            else
            {
                return(Content("<script>alert('复核失败');location.href='/Human_file/index'</script>"));
            }
        }
Esempio n. 5
0
        public ActionResult salarystandard_change_success(salary_standard ss, salary_standard_details[] ssd)
        {
            int num = 0;
            int j   = 0;

            using (TransactionScope ts = new TransactionScope())
            {
                salary_standard ss2 = bll.SelectWhere(ss.ssd_id);
                foreach (salary_standard_details item in ssd)
                {
                    j++;
                    num += bll3.Change(item);
                }
                ss2.changer      = ss.changer;
                ss2.change_time  = ss.change_time;
                ss2.remark       = ss.remark;
                ss2.salary_sum   = ss.salary_sum;
                ss2.check_status = 0;
                if (bll.Change(ss2) > 0 && num == j)
                {
                    ts.Complete();
                    return(View());
                }
                return(Content("<script>alert('真抱歉~重新提交失败了噢');</script>"));
            }
        }
Esempio n. 6
0
        //单号生成
        public IActionResult register()
        {
            string str             = "";
            var    liststandard_id = (from salary_standard in tescDbContext.ss
                                      orderby salary_standard.standard_id
                                      select salary_standard).ToList();

            if (liststandard_id.Count > 0)
            {
                int             count  = liststandard_id.Count;
                salary_standard sst    = liststandard_id[count - 1];
                int             intcod = Convert.ToInt32(sst.standard_id.Substring(2, 10));
                intcod++;
                str = intcod.ToString();
                for (int i = 0; i < 10; i++)
                {
                    str = str.Length < 10 ? "0" + str : str;
                }
                str = "HR" + str;
            }
            else
            {
                str = "HR0000000001";
            }
            ViewBag.s = str;
            string a = HttpContext.Session.GetString("Uname");

            ViewBag.aa = a;
            return(View());
        }
Esempio n. 7
0
        public ActionResult salarystandard_check(salary_standard sl, short id)
        {
            users           us = (users)Session["userClass"];
            salary_standard u  = new salary_standard()
            {
                ssd_id        = id,
                standard_id   = sl.standard_id,
                standard_name = sl.standard_name,
                salary_sum    = sl.salary_sum,
                designer      = sl.designer,               //制定者名字
                register      = sl.register,               //登记人:register
                checker       = us.u_name, /*sl.register*/ //前台复核人:checker就是登记人:register
                check_time    = sl.check_time,             //复核时间:check_time
                regist_time   = sl.regist_time,            //登记时间:regist_time
                check_comment = sl.check_comment,
                check_status  = 1                          //当此方法通过时 就是通过复核
            };
            int num = slbll.salary_standardUpdate(u);

            if (num > 0)
            {
                return(RedirectToAction("salarystandard_check_success", "Salary_Data"));
            }
            else
            {
                return(View());
            }
        }
Esempio n. 8
0
        public ActionResult Create(salary_standard ss, salary_standard_details[] ssd)
        {
            int num = 0;
            int j   = 0;

            try
            {
                using (TransactionScope ts = new TransactionScope())
                {
                    foreach (salary_standard_details item in ssd)
                    {
                        if (item.salary > 0)
                        {
                            j++;
                            item.standard_id   = ss.standard_id;
                            item.standard_name = ss.standard_name;
                            num += bll3.Add(item);
                        }
                    }
                    ss.check_status = 0;
                    if (bll.Add(ss) > 0 && num == j)
                    {
                        ts.Complete();
                        return(RedirectToAction("salarystandard_register_success"));
                    }
                    return(Content("<script>alert('真抱歉~提交失败了噢');</script>"));
                }
            }
            catch
            {
                return(Content("no"));
            }
        }
Esempio n. 9
0
        //变更修改
        public async Task <int> Upd(salary_standardModel1 s)
        {
            salary_standard ss = new salary_standard()
            {
                ssd_id        = s.ssd_id,
                changer       = s.changer,
                salary_sum    = s.salary_sum,
                change_time   = s.check_time,
                remark        = s.remark,
                check_status  = 1,
                designer      = s.designer,
                standard_id   = s.standard_id,
                standard_name = s.standard_name
            };

            tescDbContext.ss.Attach(ss);
            //修改指定的列
            tescDbContext.Entry(ss).Property(p => p.changer).IsModified       = true;
            tescDbContext.Entry(ss).Property(p => p.salary_sum).IsModified    = true;
            tescDbContext.Entry(ss).Property(p => p.change_time).IsModified   = true;
            tescDbContext.Entry(ss).Property(p => p.remark).IsModified        = true;
            tescDbContext.Entry(ss).Property(p => p.check_status).IsModified  = true;
            tescDbContext.Entry(ss).Property(p => p.designer).IsModified      = true;
            tescDbContext.Entry(ss).Property(p => p.standard_id).IsModified   = true;
            tescDbContext.Entry(ss).Property(p => p.standard_name).IsModified = true;

            return(await tescDbContext.SaveChangesAsync());
        }
Esempio n. 10
0
 public ActionResult salarystandard_check_success(salary_standard ss)
 {
     ss.check_status = 1;
     if (bll.Change(ss) > 0)
     {
         return(View());
     }
     return(Content("<script>alert('真抱歉~复核失败');</script>"));
 }
Esempio n. 11
0
        public ActionResult salarystandard_check(string id)
        {
            salary_standard ssb = new salary_standard()
            {
                standard_id = id
            };
            List <salary_standard_details> ssd = ssds.SelectBy(id);
            salary_standard ss = sss.SelectOne(ssb);

            return(View(Tuple.Create(ss, ssd)));
        }
Esempio n. 12
0
        public ActionResult salarystandard_change(short id)
        {
            ViewBag.id = id;
            //复核人名称
            users us = (users)Session["userClass"];

            ViewData["user"] = us.u_name;
            //薪酬标准表查询一个对象
            salary_standard list = slbll.salary_standardselectWhere(e => e.ssd_id == id);

            //把对象存ViewBag.Class传到前端
            ViewBag.Class = list;
            //薪酬标准详情表查询
            List <salary_standard_details> detaList = sdbll.salary_standard_detailsselectWhere(list.standard_id);//数据集合

            return(View(detaList));
        }
Esempio n. 13
0
        /// <summary>
        /// 提交数据及文件上传
        /// </summary>
        /// <param name="file"></param>
        /// <returns></returns>
        public ActionResult InsertFile(human_file file)
        {
            human_file      fileInsert = file;
            salary_standard standard   = standard_bll.salary_standardselectWhere(e => e.standard_id == file.salary_standard_id);

            fileInsert.salary_sum          = standard.salary_sum; //薪酬基本总额
            fileInsert.demand_salaray_sum  = standard.salary_sum; //应发金额
            fileInsert.paid_salary_sum     = standard.salary_sum; //应发金额
            fileInsert.major_change_amount = 0;
            fileInsert.bonus_amount        = 0;
            fileInsert.training_amount     = 0;
            fileInsert.file_chang_amount   = 0;
            //修改简历信息
            engage_resume resume = new engage_resume()
            {
                res_id = Convert.ToInt16(fileInsert.human_id)
            };

            resume = resume_bll.GetWhereResume(resume);
            resume.pass_passComment = "已入档案";
            int ok = 0;

            using (TransactionScope ts = new TransactionScope())
            {
                ok += resume_bll.UpdateResumeState(resume);
                ok += file_bll.InsertFile(fileInsert);
                if (ok == 2)
                {
                    ts.Complete();//提交事务
                    ViewBag.fileHumanId = fileInsert.human_id;
                    return(View());
                }
                else
                {
                    return(RedirectToAction("InsertHuman_file", "HumanResources", fileInsert.human_id));
                }
            }
        }
Esempio n. 14
0
        public ActionResult salarystandard_register_success(salary_standard ss, FormCollection fc)
        {
            //List<config_public_char> lcpc = cpcs.Select();
            List <string> ls = new List <string>();

            for (int i = 1; i < 7; i++)
            {
                short   o = short.Parse(fc["details[" + i + "].item_id"]);
                string  d = fc["details[" + i + "].itemName"];
                decimal s = decimal.Parse(fc["details[" + i + "].salary"]);
                salary_standard_details ssd = new salary_standard_details()
                {
                    standard_id   = ss.standard_id,
                    item_name     = d,
                    item_id       = o,
                    standard_name = ss.standard_name,
                    salary        = s
                };
                ssds.Add(ssd);
            }
            sss.Add(ss);
            return(View());
        }
Esempio n. 15
0
        //添加
        public async Task <int> salary_standardAdd(salary_standardModel1 ssm)
        {
            salary_standard ss1 = new salary_standard()
            {
                salary_sum    = ssm.salary_sum,
                ssd_id        = ssm.ssd_id,
                standard_id   = ssm.standard_id,
                standard_name = ssm.standard_name,
                change_status = ssm.change_status,
                changer       = ssm.changer,
                change_time   = ssm.change_time,
                checker       = ssm.checker,
                check_comment = ssm.check_comment,
                check_status  = 0,
                check_time    = ssm.check_time,
                designer      = ssm.designer,
                register      = ssm.register,
                regist_time   = ssm.regist_time,
                remark        = ssm.remark
            };

            tescDbContext.ss.Add(ss1);
            return(await tescDbContext.SaveChangesAsync());
        }
Esempio n. 16
0
        //变更
        public ActionResult salarystandard_change_success(salary_standard ss, FormCollection fc)
        {
            List <string> ls = new List <string>();

            for (int i = 1; i < 7; i++)
            {
                short   id = short.Parse(fc["details[" + i + "].sdtId"]);
                short   o  = short.Parse(fc["details[" + i + "].itemId"]);
                string  d  = fc["details[" + i + "].itemName"];
                decimal s  = decimal.Parse(fc["details[" + i + "].salary"]);
                salary_standard_details ssd = new salary_standard_details()
                {
                    standard_id   = ss.standard_id,
                    item_name     = d,
                    item_id       = o,
                    standard_name = ss.standard_name,
                    salary        = s,
                    sdt_id        = id
                };
                ssds.Upd(ssd);
            }
            sss.Upd(ss);
            return(View());
        }
Esempio n. 17
0
 public int Change(salary_standard t)
 {
     return(dao.Change(t));
 }
Esempio n. 18
0
 public bool Add(salary_standard us)
 {
     return(ist.Add(us));
 }
Esempio n. 19
0
 public bool Upd(salary_standard us)
 {
     return(ist.Upd(us));
 }
Esempio n. 20
0
 public ActionResult salarystandard_check_success(salary_standard ss)
 {
     sss.Upd(ss);
     return(View());
 }
Esempio n. 21
0
 public salary_standard SelectOne(salary_standard us)
 {
     return(ist.SelectBy(e => e.standard_id == us.standard_id)[0]);
 }
Esempio n. 22
0
 /// <summary>
 /// 薪酬新增
 /// </summary>
 /// <param name="sl">薪酬实体类</param>
 /// <returns></returns>
 public int salary_standardInsert(salary_standard sl)
 {
     return(dao.salary_standardInsert(sl));
 }
Esempio n. 23
0
 public bool Del(salary_standard us)
 {
     return(ist.Del(us));
 }
Esempio n. 24
0
 public int Add(salary_standard t)
 {
     return(dao.Add(t));
 }
Esempio n. 25
0
 //薪酬新增
 public int salary_standardInsert(salary_standard sl)
 {
     hr.Entry <salary_standard>(sl).State = System.Data.Entity.EntityState.Added;
     return(hr.SaveChanges());
 }
Esempio n. 26
0
 public int Del(salary_standard t)
 {
     return(dao.Del(t));
 }
Esempio n. 27
0
 //薪酬标准登记复核修改
 public int salary_standardUpdate(salary_standard sl)
 {
     return(dao.salary_standardUpdate(sl));
 }