Esempio n. 1
0
 private string UpDownCargoCage(HttpContext context)
 {
     try
     {
         string _warehousereceipt = context.Request["wh"].Trim();
         string _tyreno           = context.Request["TYRENO"].Trim();
         if (dal.CheckSTC0045(_warehousereceipt, _tyreno))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("44", string.Format(@"该轮胎[{0}]不在入库单上!", _tyreno))));
         }
         if (dal.UpDownCargoCage(_warehousereceipt, _tyreno))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", xml.ReadLandXml("0"), dal.GetSubList(_warehousereceipt))));
         }
         else
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 2
0
 private string ConfirmCargoCage(HttpContext context)
 {
     try
     {
         string _warehousereceipt = context.Request["wh"] as string;
         string _LOGINNAM         = context.Request["LOGINNAM"] as string;
         string _ENAM             = context.Request["ENAM"] as string;
         int    _num = dal.GetCount(_warehousereceipt);
         if (_num == 0)
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("444", string.Format("入库单号[{0}]下没有扫描成品胎信息,无法提交!", _warehousereceipt, _num))));
         }
         if (dal.ConfirmCargoCage(_warehousereceipt.Trim(), _LOGINNAM.Trim(), _ENAM.Trim()))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", xml.ReadLandXml("0"))));
         }
         else
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 private string Create(HttpContext context)
 {
     try
     {
         //获取工厂时间
         DataTable dtComUtil = new ComUtilDal().GetShift();
         //获取实体类
         MDC0002 model = new MDC0002()
         {
             WDATE       = DateTime.Parse(dtComUtil.Rows[0]["WDATE"].ToString()),
             LOCATIONID  = context.Request["LOCATIONID"].ToString(),
             LOCATIONNAM = context.Request["LOCATIONNAM"].ToString(),
             ENAM        = context.Request["ENAM"].ToString(),
             LOGINNAM    = context.Request["LOGINNAM"].ToString(),
             MCHID       = context.Request["MCHID"].ToString(),
             OUTDIV      = context.Request["OUTDIV"].ToString()
         };
         string cavidList = context.Request["cavidList"].ToString();
         if (dal.Create(model, cavidList) > 0)
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", xml.ReadLandXml("0"))));
         }
         else
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Replace("\r\n", ""))));
     }
 }
Esempio n. 4
0
 private string ReturnSelModel(HttpContext context)
 {
     try
     {
         string    _tyreno = context.Request["TYRENO"].Trim();
         DataTable dt      = dal.GetModel(_tyreno);
         if (dt == null)
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("444", "未查询到成品胎入库的信息!")));
         }
         else
         {
             WIP0010 wip0010 = new WIP0010Dal().GetEntityById(_tyreno);
             if (!string.IsNullOrEmpty(wip0010.TYRENO))
             {
                 return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("444", "成品胎已经退回本地库,请勿重复操作!")));
             }
             else
             {
                 return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", xml.ReadLandXml("0"), dt)));
             }
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 5
0
        private string UpdatePassword(HttpContext context)
        {
            try
            {
                string Id        = context.Request["ID"] as string;
                string loginName = context.Request["LOGINNAM"] as string;
                string password  = context.Request["Password"] as string;

                MD5    md      = new MD5CryptoServiceProvider();
                byte[] bytes   = Encoding.Unicode.GetBytes(password.Trim());
                string md5Pass = BitConverter.ToString(md.ComputeHash(bytes)).Replace("-", "");
                //
                if (dal.UpdatePassword(Id, loginName.Trim(), md5Pass))
                {
                    return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", xml.ReadLandXml("0"))));
                }
                else
                {
                    return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
                }
            }
            catch (Exception ex)
            {
                SystemErrorPlug.ErrorRecord(ex.ToString());
                return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message)));
            }
        }
Esempio n. 6
0
 private string CleanOddNumbers(HttpContext context)
 {
     try
     {
         string _warehousereceipt = context.Request["wh"].Trim();
         int    _num = dal.GetCount(_warehousereceipt);
         if (_num > 0)
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("444", string.Format("入库单号[{0}]下还有[{1}]条成品胎,请先清空再删除操作!", _warehousereceipt, _num))));
         }
         if (dal.Delete(_warehousereceipt))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", xml.ReadLandXml("0"))));
         }
         else
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 7
0
 private string CheckPassword(HttpContext context)
 {
     try
     {
         string        loginName = context.Request["LOGINNAM"] as string;
         string        password  = context.Request["Password"] as string;
         MD5           md        = new MD5CryptoServiceProvider();
         byte[]        bytes     = Encoding.Unicode.GetBytes(password);
         string        md5Pass   = BitConverter.ToString(md.ComputeHash(bytes)).Replace("-", "");
         LSFW_EMPLOYEE model     = dal.GetUserLogin(loginName, md5Pass);
         if (!string.IsNullOrEmpty(model.LOGINNAME))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", xml.ReadLandXml("0"))));
         }
         else
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message)));
     }
 }
Esempio n. 8
0
 /// <summary>
 /// 下架
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 private string GetSoldOut(HttpContext context)
 {
     try
     {
         string _BARCODE = context.Request["BARCODE"].Trim();
         string _EqID    = context.Request["EqID"].Trim();
         //限制只能扫描镂空条码
         if (_BARCODE.Length != 11)
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("444", "请扫描镂空硫化条码!")));
         }
         STC0009 stc09 = dal.GetBySTC0009(_BARCODE, _EqID, _level);
         if (string.IsNullOrWhiteSpace(stc09.BARCODE))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "该条码的轮胎不在货架上!")));
         }
         if (dal.DelBarCode(stc09.BARCODE, _EqID, _level))
         {
             return(JsonHelper <Messaging <STC0009> > .EntityToJson(new Messaging <STC0009>("0", xml.ReadLandXml("0"), dal.GetDataList(stc09.LNO, _EqID, _level))));
         }
         else
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "轮胎下架货笼失败!")));
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 private string GetGeneratingVirtualNumbers(HttpContext context)
 {
     try
     {
         string Storehouse = context.Request["Storehouse"].Trim();
         string LOGINNAM   = context.Request["LOGINNAM"].Trim();
         string FAC        = context.Request["FAC"].Trim();
         string seq        = dal.GetGeneratingVirtualNumbers(FAC.Trim());
         if (dal.MaximumQuantity(_level, LOGINNAM))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "虚拟空货笼已经达到最大数量10!")));
         }
         STC0009 stc9 = new STC0009
         {
             LNO        = seq,
             LOGINNAM   = LOGINNAM,
             Storehouse = Storehouse,
             LEVEL      = _level
         };
         if (dal.Create(stc9))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", seq)));
         }
         else
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 10
0
        private string CreateHALF(HttpContext context)
        {
            try
            {
                string jsList             = context.Request["dataList"];
                List <PublicEntity> list  = new ComUtilDal().StringToModel(jsList);
                QMA1001             model = new QMA1001
                {
                    FAC      = context.Request["FAC"],
                    DIV      = context.Request["DIV"],
                    LOTNO    = context.Request["BARCODE"],
                    ENAM     = context.Request["ENAM"],
                    LOGINNAM = context.Request["LOGINNAM"],
                    RESULT   = context.Request["RESULT"]
                };
                DataTable dtComUtil = new ComUtilDal().GetShift();
                model.WDATE = DateTime.Parse(dtComUtil.Rows[0]["WDATE"].ToString());
                model.SHIFT = dtComUtil.Rows[0]["SHT"].ToString();

                if (dal.CreateHALF(model, list))
                {
                    return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", xml.ReadLandXml("0"))));
                }
                else
                {
                    return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
                }
            }
            catch (Exception ex)
            {
                SystemErrorPlug.ErrorRecord(ex.ToString());
                return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Replace("\r\n", ""))));
            }
        }
Esempio n. 11
0
        /// <summary>
        /// 确定
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string Insert(HttpContext context)
        {
            try
            {
                string LNO         = context.Request["LNO"].Trim();
                string LOGINNAM    = context.Request["LOGINNAM"].Trim();
                string NAME        = context.Request["ENAM"].Trim();
                string fac         = context.Request["FAC"].Trim();
                string _storehouse = context.Request["Storehouse"].Trim();
                // if (dal.Insert(LNO, LOGINNAM, NAME, fac, _storehouse))
                // if (true)
                // {
                return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", xml.ReadLandXml("0"))));

                // }
                // else
                // {
                //   return JsonHelper<Messaging<string>>.EntityToJson(new Messaging<string>("1", xml.ReadLandXml("1")));
                // }
            }
            catch (Exception ex)
            {
                SystemErrorPlug.ErrorRecord(ex.ToString());
                return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
            }
        }
Esempio n. 12
0
 /// <summary>
 /// 下架
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 private string GetSoldOut(HttpContext context)
 {
     try
     {
         string  BARCODE  = context.Request["BARCODE"].Trim();
         string  LOGINNAM = context.Request["LOGINNAM"].Trim();
         STC0009 stc09    = dal.GetBySTC0009(BARCODE, LOGINNAM, _level);
         if (string.IsNullOrEmpty(stc09.BARCODE))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "该条码的轮胎不在货架上!")));
         }
         if (dal.DelBarCode(stc09.BARCODE, stc09.LOGINNAM, _level))
         {
             return(JsonHelper <Messaging <STC0009> > .EntityToJson(new Messaging <STC0009>("0", xml.ReadLandXml("0"), dal.GetDataList(stc09.LNO, stc09.LOGINNAM, _level))));
         }
         else
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "轮胎下架货笼失败!")));
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 13
0
        private bool SavePicOfSuoLue(byte[] fs, string savethumbnailpath, string saveoriginalpath, int th, int tw)
        {
            try
            {
                bool info = SavePic(fs, saveoriginalpath);

                if (info)
                {
                    if (!string.IsNullOrEmpty(savethumbnailpath) && !string.IsNullOrEmpty(saveoriginalpath))
                    {
                        MakePic(HttpContext.Current.Server.MapPath(saveoriginalpath), HttpContext.Current.Server.MapPath(savethumbnailpath), tw, th);
                    }
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                SystemErrorPlug.ErrorRecord(ex.ToString());
                throw;
            }
        }
Esempio n. 14
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 private string GetUpdateVulBarcodeChange(HttpContext context)
 {
     try
     {
         string  oldCode = context.Request["oldCode"].Trim();
         string  newCode = context.Request["newCode"].Trim();
         string  name    = context.Request["name"].Trim();
         string  login   = context.Request["login"].Trim();
         WIP0002 wip0002 = new WIP0002Dal().GetEntityByModel(oldCode);
         if (wip0002.IS_LOCK == "Y")
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("4"))));
         }
         if (wip0002.STA == "4")
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("5"))));
         }
         if (dal.GetUpdateFormingBarcodeChange(oldCode, newCode, name, login) > 0)
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", xml.ReadLandXml("0"))));
         }
         else
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 15
0
 private string DelOddNumbers(HttpContext context)
 {
     try
     {
         string Warehousereceipt = context.Request["wh"].Trim();
         int    totalNum         = dal.GetTotalLoading(Warehousereceipt.Trim());
         if (totalNum == 0)
         {
             if (dal.DelOddNumbers(Warehousereceipt.Trim()))
             {
                 return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", xml.ReadLandXml("0"))));
             }
             else
             {
                 return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
             }
         }
         else
         {
             string mess = string.Format("[{0}]装车单下还有[{1}]架货笼,<br/>请先将货笼卸车再删除单据!", Warehousereceipt, totalNum);
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", mess)));
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 16
0
 private string NewlyBuild(HttpContext context)
 {
     try
     {
         STC0018 model = new STC0018
         {
             STATE      = "0",
             Disknumber = 0,
             total      = 0,
             Consignor  = context.Request["ENAM"].Trim(),
             FAC        = context.Request["FAC"].Trim(),
             ENAM       = context.Request["ENAM"].Trim(),
             LOGINNAM   = context.Request["LOGINNAM"].Trim(),
             Typestrans = "入库"
         };
         if (dal.NewlyBuild(model))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", xml.ReadLandXml("0"))));
         }
         else
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 17
0
        /// <summary>
        /// 用户登录验证
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string GetUserLogin(HttpContext context)
        {
            string wrong = string.Empty;
            string code  = "0";

            try
            {
                string loginName = context.Request["ln"] as string;
                string password  = context.Request["ps"] as string;
                string _Ver      = string.Empty;
                try
                {
                    _Ver = context.Request["Ver"] as string;
                }
                catch { }
                string _Server = string.Empty;
                try
                {
                    _Server = context.Request["Server"] as string;
                }
                catch { }
                string _EquipmentNO = string.Empty;
                try
                {
                    _EquipmentNO = context.Request["EqNo"] as string;
                }
                catch { }
                string _DeviceName = string.Empty;
                try
                {
                    _DeviceName = context.Request["EqNm"] as string;
                }
                catch { }
                MD5           md      = new MD5CryptoServiceProvider();
                byte[]        bytes   = Encoding.Unicode.GetBytes(password);
                string        md5Pass = BitConverter.ToString(md.ComputeHash(bytes)).Replace("-", "");
                LSFW_EMPLOYEE model   = dal.GetUserLogin(loginName, md5Pass);
                if (string.IsNullOrEmpty(model.LOGINNAME))
                {
                    wrong = "用户登录失败!";
                    code  = "1";
                }
                else
                {
                    bytes = Encoding.Unicode.GetBytes(loginName);
                    string _token = new ComUtilDal().GenerateToKen();
                    model.Token = _token;
                    context.Session["UserToken"] = _token;
                    new T_MOBILE_LOGONLOGDal().Insert(model.LOGINNAME, model.NAME, model.DEPNAM, _Ver, _Server, _EquipmentNO, _DeviceName.ToUpper());
                }
                return(JsonHelper <Messaging <LSFW_EMPLOYEE> > .EntityToJson(new Messaging <LSFW_EMPLOYEE>(code, wrong, model)));
            }
            catch (Exception ex)
            {
                SystemErrorPlug.ErrorRecord(ex.ToString());
                wrong = ex.Message.ToString().Trim().Replace("\r\n", "");
                code  = "500";
                return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>(code, wrong)));
            }
        }
Esempio n. 18
0
 private string ScanningInsert(HttpContext context)
 {
     try
     {
         string OUTNUMBER = context.Request["OUTNUMBER"] as string;
         string BARCODE   = context.Request["BARCODE"] as string;
         string ENAM      = context.Request["ENAM"] as string;
         string LOGINNAM  = context.Request["LOGINNAM"] as string;
         if (!dal.BarcodeExist(BARCODE.Trim()))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "该条码信息的轮胎不在库存中!")));
         }
         if (!dal.CheckBarcode(OUTNUMBER.Trim(), BARCODE.Trim()))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "该条码信息的轮胎已经扫描过!")));
         }
         if (!dal.CheckUserBarcode(BARCODE.Trim()))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "该条码信息的轮胎已经被别人扫描过!")));
         }
         STC0025 stc0025 = dal.GetByModel(OUTNUMBER.Trim());
         QMB0101 qmb0101 = new QMB0101Dal().GetByModel(BARCODE.Trim());
         //检查扫描的规格是否和SAP发货规格相同
         DataTable dt       = dal.GetDetailedList(OUTNUMBER.Trim());
         int       countNum = (int)dt.Compute("Count(*)", string.Format(@"ITNBR='{0}'", qmb0101.ITNBR));
         ComUtilDal.SqlRecord(countNum.ToString());
         if (0 == countNum)
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "扫描的轮胎规格和SAP出库单规格不符!")));
         }
         //END
         if ("1" == stc0025.DIV)
         {
             if ("1" != qmb0101.QCSTATE)
             {
                 return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "合格品出库单不能扫描出库废次品轮胎!")));
             }
         }
         else
         {
             if ("1" == qmb0101.QCSTATE)
             {
                 return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "废次品出库单不能扫描出库合格品轮胎!")));
             }
         }
         if (dal.ScanningInsert(OUTNUMBER.Trim(), BARCODE.Trim(), ENAM.Trim(), LOGINNAM.Trim()))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", xml.ReadLandXml("0"))));
         }
         else
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 19
0
 private string AddCargoCage(HttpContext context)
 {
     try
     {
         string _ENAM             = context.Request["ENAM"] as string;
         string _LOGINNAM         = context.Request["LOGINNAM"] as string;
         string _Warehousereceipt = context.Request["wh"] as string;
         if (string.IsNullOrEmpty(_Warehousereceipt))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", "请选择装车单!")));
         }
         string    _ShelfNumber = context.Request["num"].Trim();
         string    _FAC         = context.Request["FAC"].Trim();
         STC0018   mds          = dal.GetByModels(_Warehousereceipt.Trim());
         STC0017   model        = dal.CheckCargoCage(_ShelfNumber, _FAC);
         DataTable stc17Tb      = new STC0017Dal().GetModel(_ShelfNumber);
         string    mess17       = string.Format(@"<br/>库位:[{0}]<br/>规格:[{1}]<br/>数量:[{2}]条。", model.Storehouse, model.ITDSC, model.Number);
         if (mds.STATE == "3")
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", "装车单已经确认入库无法操作!")));
         }
         if (!string.IsNullOrEmpty(model.ShelfNumber))
         {
             if (dal.AddCargoCage(_Warehousereceipt.Trim(), model.Transfercardnumber, model.ShelfNumber, _ENAM, _LOGINNAM))
             {
                 return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", "装车完成!" + mess17, dal.GetSubList(_Warehousereceipt.Trim()))));
             }
             else
             {
                 return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
             }
         }
         else
         {
             string mes = dal.CheckCargoCageExis(_ShelfNumber, _FAC);
             if (!string.IsNullOrEmpty(mes))
             {
                 if (mes == "4")
                 {
                     string mess19 = string.Format(@"<br/>库位:[{0}]<br/>规格:[{1}]<br/>数量:[{2}]条。", stc17Tb.Rows[0]["Storehouse"], stc17Tb.Rows[0]["ITDSC"], stc17Tb.Rows[0]["Number"]);
                     return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", "已装车!装车单:【" + dal.GetWarehousereceipt(stc17Tb.Rows[0]["Transfercardnumber"] as string, stc17Tb.Rows[0]["ShelfNumber"] as string) + "】" + mess19)));
                 }
                 else
                 {
                     return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", "货架已入库!")));
                 }
             }
             else
             {
                 return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "未查询到货笼信息!")));
             }
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 20
0
        private string SaveFile()
        {
            try
            {
                string strResult = "";

                if (HttpContext.Current.Request.Files.Count > 0)
                {
                    HttpPostedFile file = HttpContext.Current.Request.Files[0];
                    if (file.ContentLength > 0)
                    {
                        DateTime dTime             = DateTime.Now;
                        string   strFileTargetPath = "~/Upload/";

                        string strFileExt = Path.GetExtension(Path.GetFileName(file.FileName));
                        string strAbsoluteFileFullName = HttpContext.Current.Server.MapPath(strFileTargetPath) + Path.GetFileName(file.FileName) + ".txt";


                        string newFileName = DateTime.Now.ToString("yyyyMMddHHmmssffff");

                        if (!Directory.Exists(HttpContext.Current.Server.MapPath(strFileTargetPath)))
                        {
                            Directory.CreateDirectory(HttpContext.Current.Server.MapPath(strFileTargetPath));
                        }

                        try
                        {
                            File.Delete(strAbsoluteFileFullName);
                            file.SaveAs(strAbsoluteFileFullName);
                            //(0) 判断文件是否存在
                            //SaveToRead();

                            strResult = ReadFileToDataBase(strAbsoluteFileFullName);
                        }
                        catch { }
                        return(string.Format("{0}/{1}/{2}/Upload File/{3}", dTime.Year, dTime.Month, dTime.Day, strResult));

                        //}
                    }
                    else
                    {
                        return("文件大小为0!");
                    }
                }
                else
                {
                    return("没有上传文件");
                }
            }
            catch (Exception ex)
            {
                SystemErrorPlug.ErrorRecord(ex.ToString());
                return(ex.ToString());
            }
        }
Esempio n. 21
0
        private string AddCage(HttpContext context)
        {
            try
            {
                string _LNO        = context.Request["LNO"].Trim();
                string _Storehouse = context.Request["Storehouse"].Trim();
                string _LOGINNAM   = context.Request["LOGINNAM"].Trim();
                string _EqID       = context.Request["EqID"].Trim();
                //XXXXXXXXXXXXXXX 软控货笼验证 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

                /*string mess = new MESNACMESDal().CheckShelfState(_LNO);
                 * if (!string.IsNullOrWhiteSpace(mess))
                 * {
                 *   return JsonHelper<Messaging<string>>.EntityToJson(new Messaging<string>("2", mess));
                 * }*/
                //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                if (dal.MaximumQuantity(_level, _EqID))
                {
                    return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "空货笼已经达到最大数量3个!")));
                }
                if (dal.CheckUpCage17(_LNO) > 0)
                {
                    return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("2", "[" + _LNO + "]货笼已经使用!")));
                }
                STC0009 stc9 = new STC0009
                {
                    LNO        = _LNO,
                    LOGINNAM   = _LOGINNAM,
                    Storehouse = _Storehouse,
                    LEVEL      = _level,
                    EQUIPID    = _EqID
                };
                if (dal.Exists(_LNO, _level))
                {
                    if (dal.Create(stc9))
                    {
                        return(JsonHelper <Messaging <STC0009> > .EntityToJson(new Messaging <STC0009>("0", xml.ReadLandXml("0"), dal.GetDataList(_LNO, _EqID))));
                    }
                    else
                    {
                        return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
                    }
                }
                else
                {
                    return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", "[" + _LNO + "]货笼已经使用中!")));
                }
            }
            catch (Exception ex)
            {
                SystemErrorPlug.ErrorRecord(ex.ToString());
                return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
            }
        }
Esempio n. 22
0
 /// <summary>
 /// 获取退库单
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 private string GetReturnnumber(HttpContext context)
 {
     try
     {
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", xml.ReadLandXml("0"), dal.GetReturnnumber())));
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 23
0
 public bool CheckingToolLoadingNumber(string number)
 {
     try
     {
         return(dal.CheckingToolLoadingNumber(number));
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(false);
     }
 }
Esempio n. 24
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 private string GetLanguage()
 {
     try
     {
         return(JsonHelper <Messaging <TranslationConfig> > .EntityToJson(new Messaging <TranslationConfig>("0", "", new LanguageDal().GetLanguage())));
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message)));
     }
 }
Esempio n. 25
0
        private string AddCargoCage(HttpContext context)
        {
            try
            {
                string _warehousereceipt = context.Request["wh"].Trim();
                string _TYRENO           = context.Request["TYRENO"].Trim();

                string _Storehouse = context.Request["Storehouse"].Trim();
                string _LOGINNAM   = context.Request["LOGINNAM"].Trim();
                string _ENAM       = context.Request["ENAM"].Trim();
                string _FAC        = context.Request["FAC"].Trim();
                if (string.IsNullOrEmpty(_Storehouse))
                {
                    _Storehouse = dal.CheckSTC0044_WareHouse(_warehousereceipt);
                }
                //验证软控报警胎
                string _alarm = new LogisticsLaunchVerificationDal().ALARM(_TYRENO);
                if (!string.IsNullOrWhiteSpace(_alarm))
                {
                    return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("444", _alarm)));
                }
                //MES综合验证
                string strMes = dal.GetScanLocalWarehousChecking(_TYRENO, _LOGINNAM, _FAC, _ENAM, _Storehouse);
                if (!string.IsNullOrEmpty(strMes))
                {
                    return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("444", strMes)));
                }
                STC0045 stc0045 = dal.GetSTC0045_ITNBR(_warehousereceipt);
                if (!string.IsNullOrEmpty(stc0045.ITNBR))
                {
                    WIP0010 wip0010 = new WIP0010Dal().GetEntityById(_TYRENO);
                    if (!stc0045.ITNBR.Equals(wip0010.ITNBR))
                    {
                        string mess = "此轮胎规格[{0}]与当前货架轮胎规格[{1}]不同,不允许入本地库!";
                        return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("444", string.Format(mess, wip0010.ITDSC, stc0045.ITDSC))));
                    }
                }
                if (dal.AddCargoCage(_warehousereceipt, _TYRENO, _Storehouse, _LOGINNAM, _ENAM))
                {
                    return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", "入库完成!", dal.GetSubList(_warehousereceipt))));
                }
                else
                {
                    return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
                }
            }
            catch (Exception ex)
            {
                SystemErrorPlug.ErrorRecord(ex.ToString());
                return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
            }
        }
Esempio n. 26
0
 /// <summary>
 /// 通过条码查询相对应的产品信息
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 private string GetTireStatusPositioning(HttpContext context)
 {
     try
     {
         string BARCODE = context.Request["BARCODE"].Trim();
         return(JsonHelper <Messaging <LTA0001> > .EntityToJson(new Messaging <LTA0001>("0", xml.ReadLandXml("0"), dal.GetTireStatusPositioning(BARCODE.Trim()))));
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 27
0
 /// <summary>
 /// 获取菜单权限
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 private string GetPermissions(HttpContext context)
 {
     try
     {
         string loginName = context.Request["ln"] as string;
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", "", dal.GetPermissions(loginName))));
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 28
0
 private string GetTemplate(HttpContext context)
 {
     try
     {
         string _TYPE = context.Request["TYPE"] as string;
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", "", dal.GetTemplate(_TYPE.Trim()))));
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 29
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="context"></param>
 /// <returns></returns>
 private string QueryConvertChip(HttpContext context)
 {
     try
     {
         string BARCODE = context.Request["BARCODE"].Trim();
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", ReadChipPlug.ToHexString(BARCODE))));
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }
Esempio n. 30
0
 private string GetHALF(HttpContext context)
 {
     try
     {
         string _LOTID = context.Request["LOTID"] as string;
         return(JsonHelper <Messaging <LTC0001> > .EntityToJson(new Messaging <LTC0001>("0", "", new LTC0001Dal().GetByModel(_LOTID.Trim()))));
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message.ToString().Trim().Replace("\r\n", ""))));
     }
 }