Esempio n. 1
0
        public Get_OutGiveBackLendingInfo Recieve(string data)
        {
            Get_OutGiveBackLendingInfo json = new Get_OutGiveBackLendingInfo();

            try
            {
                Get_InGiveBackLendingInfo input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InGiveBackLendingInfo>(data);
                DBGoodsMgr db = new DBGoodsMgr();
                foreach (LendingInfoDetail l in input.lendingDetailList)
                {
                    if (!db.CheckReturnAble(input.TrainmanGUID, l))
                    {
                        throw new ArgumentOutOfRangeException("未找到" + l.strLendingTypeAlias + " " + l.strLendingExInfo + "的借用记录!");
                    }
                }

                db.GiveBackDetail(input.lendingDetailList);

                foreach (LendingInfoDetail l in input.lendingDetailList)
                {
                    db.UpdateLendingInfoRemark(l.strLendingInfoGUID, input.remark);
                }
                json.result    = "0";
                json.resultStr = "返回成功";
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Esempio n. 2
0
        public Get_OutSendGoods Send(string data)
        {
            Get_OutSendGoods json = new Get_OutSendGoods();

            try
            {
                Get_InSendGoods input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InSendGoods>(data);
                DBGoodsMgr      db    = new DBGoodsMgr();
                foreach (LendingInfoDetail l in input.lendingDetailList)
                {
                    if (db.CheckLendAble(l, input.WorkShopGUID))
                    {
                        throw new ArgumentOutOfRangeException(l.strLendingTypeAlias + " " + l.strLendingExInfo + "已经出借,无法再次借出!");
                    }
                    if (input.UsesGoodsRange)
                    {
                        if (!db.IsGoodInRange(l.nLendingType, l.strLendingExInfo, input.WorkShopGUID))
                        {
                            throw new ArgumentOutOfRangeException(l.strLendingTypeAlias + " " + l.strLendingExInfo + "物品编码不在指定的编码范围内,请检查!");
                        }
                    }
                }
                db.SendLendingInfo(input.TrainmanGUID, input.remark, input.lendingDetailList);
                json.result    = "0";
                json.resultStr = "返回成功";
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Esempio n. 3
0
        public Get_OutDeleteGoods DeleteGoods(string data)
        {
            DBGoodsMgr         db     = new DBGoodsMgr();
            Get_OutDeleteGoods result = new Get_OutDeleteGoods();

            try
            {
                Get_InDeleteGoods input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InDeleteGoods>(data);
                db.DeleteGoods(input.LendingType, input.LendingExInfo, input.WorkShopGUID);
                result.result = "0";
            }
            catch (Exception ex)
            {
                result.result    = "1";
                result.resultStr = ex.Message.ToString();
            }

            return(result);
        }
Esempio n. 4
0
        public Get_OutGetStateNames GetStateNames(string data)
        {
            Get_OutGetStateNames json = new Get_OutGetStateNames();

            try
            {
                Get_InGetStateNames input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InGetStateNames>(data);
                DBGoodsMgr          db    = new DBGoodsMgr();
                ResultGetStateNames Rgs   = new ResultGetStateNames();
                Rgs.returnStateList = db.GetStateNames();
                json.data           = Rgs;
                json.result         = "0";
                json.resultStr      = "返回成功";
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Esempio n. 5
0
        public Get_OutGetTrainmanNotReturnLendingInfo GetTrainmanNotReturnLendingInfo(string data)
        {
            Get_OutGetTrainmanNotReturnLendingInfo json = new Get_OutGetTrainmanNotReturnLendingInfo();

            try
            {
                Get_InGetTrainmanNotReturnLendingInfo input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InGetTrainmanNotReturnLendingInfo>(data);
                DBGoodsMgr        db = new DBGoodsMgr();
                LendingDetailList l  = new LendingDetailList();
                l.lendingDetailList = db.GetTrainmanNotReturnLendingInfo(input.TrainmanGUID);
                json.data           = l;
                json.result         = "0";
                json.resultStr      = "返回成功";
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Esempio n. 6
0
        public Get_OutIsHaveNotReturnGoods IsHaveNotReturnGoods(string data)
        {
            Get_OutIsHaveNotReturnGoods json = new Get_OutIsHaveNotReturnGoods();

            try
            {
                Get_InIsHaveNotReturnGoods input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InIsHaveNotReturnGoods>(data);
                DBGoodsMgr db = new DBGoodsMgr();
                Results    r  = new Results();
                r.result       = db.IsHaveNotReturnGoods(input.TrainmanGUID);
                json.data      = r;
                json.result    = "0";
                json.resultStr = "返回成功";
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Esempio n. 7
0
        public Get_OutGetTongJiInfo GetTongJiInfo(string data)
        {
            Get_OutGetTongJiInfo json = new Get_OutGetTongJiInfo();

            try
            {
                Get_InGetTongJiInfo input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InGetTongJiInfo>(data);
                DBGoodsMgr          db    = new DBGoodsMgr();
                LendingTjInfos      l     = new LendingTjInfos();
                l.lendingTjList = db.GetTongJiInfo(input.WorkShopGUID);
                json.data       = l;
                json.result     = "0";
                json.resultStr  = "返回成功";
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Esempio n. 8
0
        public Get_OutQueryDetails QueryDetails(string data)
        {
            Get_OutQueryDetails json = new Get_OutQueryDetails();

            try
            {
                Get_InQueryDetails input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InQueryDetails>(data);
                DBGoodsMgr         db    = new DBGoodsMgr();
                LendingDetailList  l     = new LendingDetailList();
                l.lendingDetailList = db.QueryDetails(input.queryParam);
                json.data           = l;
                json.result         = "0";
                json.resultStr      = "返回成功";
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Esempio n. 9
0
        public Get_OutQueryGoodsNow QueryGoodsNow(string data)
        {
            Get_OutQueryGoodsNow json = new Get_OutQueryGoodsNow();

            try
            {
                Get_InQueryGoodsNow input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InQueryGoodsNow>(data);
                DBGoodsMgr          db    = new DBGoodsMgr();
                LendingDetailList   l     = new LendingDetailList();
                l.lendingDetailList = db.QueryGoodsNow(input.WorkShopGUID, input.GoodType, input.GoodID, input.orderType);
                json.data           = l;
                json.result         = "0";
                json.resultStr      = "返回成功";
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Esempio n. 10
0
        public Get_OutQueryRecord QueryRecord(string data)
        {
            Get_OutQueryRecord json = new Get_OutQueryRecord();

            try
            {
                Get_InQueryRecord input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InQueryRecord>(data);
                DBGoodsMgr        db    = new DBGoodsMgr();
                RlendingInfoList  R     = new RlendingInfoList();
                R.lendingInfoList = db.QueryRecord(input.queryParam);
                json.data         = R;
                json.result       = "0";
                json.resultStr    = "返回成功";
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Esempio n. 11
0
        public Get_OutGetGoodType GetGoodType(string data)
        {
            Get_OutGetGoodType json = new Get_OutGetGoodType();

            try
            {
                Get_InGetGoodType input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InGetGoodType>(data);
                DBGoodsMgr        db    = new DBGoodsMgr();

                ResultsGetGoodType RGT = new ResultsGetGoodType();
                RGT.lendingTypeList = db.GetGoodType();
                json.data           = RGT;
                json.result         = "0";
                json.resultStr      = "返回成功";
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }