コード例 #1
0
        public ActionResult UpdateGroupDept(string CostCode, string DepartmentGroup)
        {
            M_Cost_Center_List cost = (from c in db.M_Cost_Center_List
                                       where c.Cost_Center == CostCode
                                       select c).FirstOrDefault();

            cost.DepartmentGroup = (DepartmentGroup == "") ? null : DepartmentGroup;
            db.Entry(cost).State = EntityState.Modified;
            db.SaveChanges();
            return(Json(new { }, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public ActionResult GetSuperSection(string section)
        {
            M_Cost_Center_List usersection = new M_Cost_Center_List();

            if (section == "")
            {
                usersection = new M_Cost_Center_List();
            }
            else
            {
                usersection = (from c in db.M_Cost_Center_List where c.GroupSection == section select c).FirstOrDefault();
            }
            return(Json(new { usersection = usersection, usercostcode = usersection.Cost_Center }, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        public ActionResult UpdateGroup(string CostCode, string SectionGroup)
        {
            M_Cost_Center_List cost = (from c in db.M_Cost_Center_List
                                       where c.Cost_Center == CostCode
                                       select c).FirstOrDefault();

            cost.GroupSection    = (SectionGroup == "")?null: SectionGroup;
            db.Entry(cost).State = EntityState.Modified;
            db.SaveChanges();

            List <CostCenterM> newCostCode = (from c in db.M_Cost_Center_List
                                              where c.GroupSection == "" || c.GroupSection == null
                                              select new CostCenterM
            {
                CostCodenew = c.Cost_Center,
                CostCodenewname = c.Section
            }).ToList();

            System.Web.HttpContext.Current.Session["newCostCode"] = newCostCode;

            return(Json(new { }, JsonRequestBehavior.AllowGet));
        }