Exemplo n.º 1
0
        //库位管理的新增
        public ActionResult InsertKeWei(string LocationName, string barcode, string warehourseNum, int isDefult)
        {
            KeWeiBLL bll         = new KeWeiBLL();
            int      shu         = bll.Location().Count();
            string   zhang       = shu.ToString();
            string   LocationNum = null;

            if (zhang.Length == 1)
            {
                LocationNum = "00000" + (shu + 1);
            }
            else if (zhang.Length == 2)
            {
                LocationNum = "0000" + (shu + 1);
            }
            else if (zhang.Length == 3)
            {
                LocationNum = "000" + (shu + 1);
            }
            Location sg = new Location();

            sg.LocationNum = LocationNum; sg.LocationName = LocationName; sg.barcode = barcode;
            sg.isDefult    = isDefult; sg.isDel = 1; sg.isDisable = 1; sg.warehourseNum = warehourseNum;
            sg.CreateTime  = DateTime.Now;
            bll.Add(sg);
            return(Json("新增成功!", JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        //库位管理的删除
        public ActionResult DeleteKeWei(string id)
        {
            KeWeiBLL bll = new KeWeiBLL();

            bll.delete(id);
            return(Json("删除成功!", JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
        //修改供应商
        public ActionResult UdpdateKuWei(string LocationName, string barcode, string warehourseNum, int isDefult, string LocationNum)
        {
            KeWeiBLL bll = new KeWeiBLL();
            Location sg  = new Location();

            sg.LocationNum = LocationNum; sg.LocationName = LocationName; sg.barcode = barcode;
            sg.isDefult    = isDefult; sg.warehourseNum = warehourseNum;
            bll.Update(sg);
            return(Json("修改成功!", JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
        //禁用库位
        public ActionResult JingYong(string id, int shu)
        {
            KeWeiBLL bll = new KeWeiBLL();

            bll.JinYong(id, shu);
            if (shu == 0)
            {
                return(Json("禁用成功!", JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json("解锁成功!", JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 5
0
        //查询一个供应商
        public ActionResult SelectOneKuWei(string LocationNum)
        {
            KeWeiBLL        bll  = new KeWeiBLL();
            List <Location> list = bll.Location();
            var             obj  = from p in list
                                   where p.LocationNum == LocationNum
                                   select new
            {
                LocationNum   = p.LocationNum,
                LocationName  = p.LocationName,
                isDefult      = p.isDefult,
                warehourseNum = p.warehourseNum,
                barcode       = p.barcode
            };

            return(Json(obj, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 6
0
        //库位管理的分页
        public ActionResult SelectKeWei(int pageIndex, int pageSize, string warehourseNum, string LocationName)
        {
            KeWeiBLL        bll  = new KeWeiBLL();
            List <Location> list = bll.Location();
            var             obj  = from p in list where p.isDel == 1 && p.warehourseNum.Contains(warehourseNum)
                                   select new { LocationNum   = p.LocationNum, LocationName = p.LocationName,
                                                warehourseNum = p.warehourse.warehourseName,
                                                barcode       = p.barcode, isDisable = p.isDisable, isDefult = p.isDefult,
                                                CreateTime    = p.CreateTime.ToString("yyyy年MM月dd日"), };

            if (!string.IsNullOrEmpty(LocationName))
            {
                obj = obj.Where(p => p.LocationName.Contains(LocationName));
            }
            obj = obj.OrderBy(p => p.LocationNum).Skip((pageIndex - 1) * pageSize).Take(pageSize);
            return(Json(obj, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 7
0
        //库位管理的总条数
        public ActionResult SelectKeWeis(string warehourseNum, string LocationName)
        {
            KeWeiBLL        bll  = new KeWeiBLL();
            List <Location> list = bll.Location();
            var             obj  = from p in list
                                   where p.isDel == 1
                                   select p;

            if (!string.IsNullOrEmpty(warehourseNum))
            {
                obj = obj.Where(p => p.warehourseNum.Contains(warehourseNum));
            }
            if (!string.IsNullOrEmpty(LocationName))
            {
                obj = obj.Where(p => p.LocationName.Contains(LocationName));
            }
            return(Json(obj.Count(), JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 8
0
 //库位页面
 public ActionResult KeWei()
 {
     BLL.S.KeWeiBLL bll = new KeWeiBLL();
     ViewBag.gg = bll.Warehourses();;
     return(View());
 }