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 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.º 3
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.º 4
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));
        }