public ActionResult DataLoad()
        {
            try
            {
                string vender = Request.Form["vender"].ToString();
                string facturer = Request.Form["facturer"].ToString();
                string isActive = Request.Form["isActive"].ToString();
                string MaterialType = Request.Form["MaterialType"].ToString();
                List<string> mTypeList = UserOperateContext.Current.getMaterialTypeList(MaterialType);
                string MaterialID = Request.Form["MaterialID"].ToString();

                //获取页容量
                int rows = int.Parse(Request.Form["rows"]);
                //获取请求的页码
                int page = int.Parse(Request.Form["page"]);
                //返回总行数
                int total = 0;

                var list = new I_MaterialBLL().GetMaterialList(page, rows, ref total, facturer, vender, isActive, mTypeList, MaterialID);
                return Json(new { total = total, rows = list }, "appliction/json", JsonRequestBehavior.AllowGet);
            }

            catch (Exception e)
            {
                Dictionary<string, string> dict = new Dictionary<string, string>();
                dict.Add("InfoID", "0");
                dict.Add("InfoMessage", e.Message);
                return this.Json(dict);
            }
        }
Beispiel #2
0
        public List <Model.I_Material> GetList(int pageindex, int pageSize, DateTime startTime, DateTime endTime, string vender,
                                               bool isActive, string mTypeId, string mTypeDetailId, string mName, string mCode)
        {
            I_MaterialBLL mbll = new I_MaterialBLL();

            return(mbll.GetPagedList(pageindex, pageSize, p => p.Name == mName && p.MCode == mCode && p.MTypeID == mTypeId && p.IsActive == isActive && p.CreatorDate > startTime && p.CreatorDate < endTime, p => p.Name == mName));
        }
        public ActionResult DataLoad()
        {
            DateTime startTime = Convert.ToDateTime(Request.Form["startTime"]);
            DateTime endTime = Convert.ToDateTime(Request.Form["endTime"]);
            string deliveryType = Request.Form["deliveryType"].ToString();
            string deliveryCode = Request.Form["deliveryCode"].ToString();
            string entryStorageCode = Request.Form["entryStorageCode"].ToString();
            string operatorName = Request.Form["operatorName"].ToString();
            string mName = Request.Form["mName"].ToString();
            string receivingStoreID = Request.Form["receivingStoreID"].ToString();
            string consigneeName = Request.Form["consigneeName"].ToString();
            string mCode = Request.Form["mCode"].ToString();

            //获取页容量
            int rows = int.Parse(Request.Form["rows"]);
            //获取请求的页码
            int page = int.Parse(Request.Form["page"]);

            try
            {
                I_MaterialBLL dBLL = new I_MaterialBLL();
                var list = dBLL.GetDeliveryOrder(page, rows,startTime, endTime, deliveryType,
                  deliveryCode, entryStorageCode, operatorName, mName, receivingStoreID, consigneeName, mCode);

                return this.Json(list, "appliction/json", JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                Dictionary<string, string> dict = new Dictionary<string, string>();
                dict.Add("InfoID", "0");
                dict.Add("InfoMessage", ex.Message);
                return this.Json(dict);
            }
        }
 public ActionResult GetMaterial(string mType)
 {
     try
     {
         var list = new I_MaterialBLL().GetMaterialListBy(mType);
         return this.Json(list);
     }
     catch
     {
         return this.Json("");
     }
 }
 public ActionResult MaterialAdd()
 {
     string sDetailInfo = Request.Form["sMaterialInfo"].ToString();
     I_Material info = JsonHelper.GetJsonInfoBy<I_Material>(sDetailInfo);
     //info.IsActive = true;
     info.CreatorDate = DateTime.Now;
     info.CreatorName = UserOperateContext.Current.Session_UsrInfo.Name;
     // info.OtherTypeID = "NULLTYPE";
     //info.FeeScale=1;
     //info.LimitMaxPrice = 1000;
     int res = new I_MaterialBLL().Add(info);
     if (res > 0)
         return this.JsonResult(Utility.E_JsonResult.OK, "保存成功!", null, null);
     else
         return this.JsonResult(Utility.E_JsonResult.Error, "保存失败", null, null);
 }
        public ActionResult MaterialEdit()
        {
            string sDetailInfo = Request.Form["sMaterialInfo"].ToString();
            I_Material model = JsonHelper.GetJsonInfoBy<I_Material>(sDetailInfo);
            //model.IsActive = true;
            if (model.RealPrice == null)
            { model.RealPrice = 0; };
            int res = new I_MaterialBLL().Modify(model, "Name", "MTypeID", "Manufacturer", "Vendor", "MCode", "Unit", "Specification", "RealPrice", "Remark", "AlarmCounts", "PinYin","FeeScale","LimitMaxPrice","GiveMedicineWay","SN","OtherTypeID","IsActive");

            if (res > 0)
                return this.JsonResult(Utility.E_JsonResult.OK, "修改成功!", null, null);
            else
                return this.JsonResult(Utility.E_JsonResult.Error, "修改失败", null, null);
        }
 public ActionResult MaterialDisable()
 {
     int id = Convert.ToInt32(Request.Form["id"]);
     bool disable = Convert.ToBoolean(Request.Form["disable"]);
     I_Material model = new I_Material();
     model.IsActive = disable;
     model.ID = id;
     int res = new I_MaterialBLL().Modify(model, "IsActive");
     string tInfo = "";
     string finfo = "";
     if (disable)
     {
         tInfo = "设置“<span style='color:darkgreen'>有效</span>”成功!";
         finfo = "设置“<span style='color:darkgreen'>有效</span>”失败!";
     }
     else
     {
         tInfo = "设置“<span style='color:red'>无效</span>”成功!";
         finfo = "设置“<span style='color:red'>无效</span>”失败!";
     }
     if (res > 0)
         return this.JsonResult(Utility.E_JsonResult.OK, tInfo, null, null);
     else
         return this.JsonResult(Utility.E_JsonResult.Error, finfo, null, null);
 }
 public ActionResult MeasureAdd()
 {
     string sDetailInfo = Request.Form["sMaterialInfo"].ToString();
     I_Material info = JsonHelper.GetJsonInfoBy<I_Material>(sDetailInfo);
     if (info.RealPrice == null)
     { info.RealPrice = 0; };
     int res = new I_MaterialBLL().Add(info);
     if (res > 0)
         return this.JsonResult(Utility.E_JsonResult.OK, "保存成功!", null, null);
     else
         return this.JsonResult(Utility.E_JsonResult.Error, "保存失败", null, null);
 }
 /// <summary>
 /// 获取仓库基本信息,ID 和Name,用于物资来源,物资去向下拉框的选项
 /// </summary>
 /// <returns></returns>
 public ActionResult GetStorage()
 {
     I_MaterialBLL dBLL = new I_MaterialBLL();
       var result =  dBLL.GetStorage();
       return Json(result);
 }
 public ActionResult GetMaterialList()
 {
     try
     {
         var list = new I_MaterialBLL().GetMaterialList();
         return this.Json(list);
     }
     catch
     {
         return this.Json("");
     }
 }
Beispiel #11
0
 public List<Model.I_Material> GetList(int pageindex,int pageSize, DateTime startTime, DateTime endTime, string vender,
     bool isActive, string mTypeId, string mTypeDetailId, string mName, string mCode)
 {
     I_MaterialBLL mbll = new I_MaterialBLL();
     return mbll.GetPagedList(pageindex, pageSize, p => p.Name == mName && p.MCode == mCode && p.MTypeID == mTypeId  && p.IsActive == isActive && p.CreatorDate > startTime && p.CreatorDate < endTime, p => p.Name == mName);
 }