示例#1
0
 public static void UpdateTraysStatus(List<string> trayIds,TrayStatus status)
 {
     using (IUnitOfWork unit = MSSqlHelper.DataContext())
     {
         ValidateMsg<Trays> msg = new ValidateMsg<Trays>() { Valid = false };
         ITraysRep tr = new TraysRep(unit);
         List<Trays> ts = tr.GetByIds(trayIds);
         foreach (Trays t in ts)
             t.status = (int)status;
         unit.Submit();
     }
 }
示例#2
0
 public static ValidateMsg<Trays> TrayCanPrint(string trayId)
 {
     using (IUnitOfWork unit = MSSqlHelper.DataContext())
     {
         ValidateMsg<Trays> msg = new ValidateMsg<Trays>() { Valid = false };
         ITraysRep tr = new TraysRep(unit);
         Trays t = tr.GetSingleById(trayId);
         if (t == null)
             msg.Message.Add("托盘标签:"+trayId+" 错误!");
         else
             msg.Valid = true;
         return msg;
     }
 }
示例#3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";
            //context.Response.Write("Hello World");
            int action = Convert.ToInt32(context.Request["action"]);

            if (action == 1)
            {
                string      name   = context.Request["name"];
                BookBll     bll    = new BookBll();
                ValidateMsg v1     = new ValidateMsg();
                int         result = bll.BookExist(name);
                if (result > 0)
                {
                    v1.Success = true;
                    v1.OkMsg   = "用户名已存在!!!";
                }
                else
                {
                    v1.Success = false;
                    v1.OkMsg   = "输入正确!!!";
                }
                JavaScriptSerializer js = new JavaScriptSerializer();
                string str = js.Serialize(v1);
                context.Response.Write(str);
            }
            if (action == 2)
            {
                if (context.Request["num"] != "")
                {
                    int         name   = Convert.ToInt32(context.Request["num"]);
                    BookBll     bll    = new BookBll();
                    ValidateMsg v1     = new ValidateMsg();
                    int         result = bll.NumExist(name);
                    if (result > 0)
                    {
                        v1.Success = true;
                        v1.OkMsg   = "图书编号已存在!!!";
                    }
                    else
                    {
                        v1.Success = false;
                        v1.OkMsg   = "输入正确!!!";
                    }
                    JavaScriptSerializer js = new JavaScriptSerializer();
                    string str = js.Serialize(v1);
                    context.Response.Write(str);
                }
            }
        }
示例#4
0
        public PrintDataMessage GenSingleTrayLabel(string trayId, string dateFormat, string[] keepers)
        {
            PrintDataMessage    pdm = new PrintDataMessage();
            ValidateMsg <Trays> msg = TraysHelper.TrayCanPrint(trayId);

            if (msg.Valid)
            {
                List <TrayPackView> tpv = TrayPackViewHelper.GetTPVByTrayIdsGropSumPartNr(new List <string>()
                {
                    trayId
                });
                string[]         dateFormats = dateFormat.Split(',');
                List <PrintTask> tasks       = new List <PrintTask>();
                foreach (string keeper in keepers)
                {
                    RecordSet rs   = new RecordSet();
                    PrintTask task = new PrintTask()
                    {
                        DataSet = rs
                    };
                    foreach (TrayPackView t in tpv)
                    {
                        RecordData label = new RecordData();
                        label.Add("TrayId", t.trayId);
                        label.Add("Warehouse", t.warehouse);
                        label.Add("Position", t.position);
                        label.Add("customerPNr", t.customerPartNr);
                        label.Add("PartNr", t.partNr);
                        label.Add("Capa", t.capa.ToString());
                        label.Add("Keeper", keeper);
                        label.Add("CreateTime", t.createTime.ToString(dateFormats[0]));
                        label.Add("StoreCreateTime", t.createTime.ToString(dateFormats[1]));
                        rs.Add(label);
                    }
                    tasks.Add(task);
                }
                pdm.PrintTask      = tasks;
                pdm.ReturnedResult = true;
            }
            else
            {
                pdm.ReturnedResult = false;
                pdm.ReturnedMessage.Add(msg.ToString());
            }
            return(pdm);
        }
示例#5
0
 public static void UpdateTraysStatus(List <string> trayIds, TrayStatus status)
 {
     using (IUnitOfWork unit = MSSqlHelper.DataContext())
     {
         ValidateMsg <Trays> msg = new ValidateMsg <Trays>()
         {
             Valid = false
         };
         ITraysRep    tr = new TraysRep(unit);
         List <Trays> ts = tr.GetByIds(trayIds);
         foreach (Trays t in ts)
         {
             t.status = (int)status;
         }
         unit.Submit();
     }
 }
示例#6
0
 private void validateTBPackageID()
 {
     if (TBPackageId.Text.Length > 0)
     {
         ValidateMsg <SinglePackage> msg = packageStoreService.SingleCheckStore(TBPackageId.Text);
         if (!msg.Valid)
         {
             new InfoBoard(MsgLevel.Mistake, msg.ToString()).ShowDialog();
         }
         else
         {
             bool scand = false;
             if (DGTrayItemsDetail.ItemsSource != null)
             {
                 foreach (var i in DGTrayItemsDetail.ItemsSource)
                 {
                     if ((i as SinglePackage).packageID.Equals(msg.Target.packageID))
                     {
                         new InfoBoard(MsgLevel.Mistake, TBPackageId.Text + " 已经扫入!").ShowDialog();
                         scand = true;
                         break;
                     }
                 }
             }
             if (!scand)
             {
                 if (SPDataSource == null)
                 {
                     SPDataSource = new List <SinglePackage>();
                 }
                 SPDataSource.Insert(0, msg.Target);
                 DGTrayItemsDetail.ItemsSource = null;
                 DGTrayItemsDetail.ItemsSource = SPDataSource;
                 LabPackNum.Content            = SPDataSource.Count;
                 //  BtnNew.IsEnabled = false;
                 BtnFinsh.IsEnabled = true;
             }
         }
         TBPackageId.Text = string.Empty;
     }
 }
示例#7
0
 public static ValidateMsg <Trays> TrayCanPrint(string trayId)
 {
     using (IUnitOfWork unit = MSSqlHelper.DataContext())
     {
         ValidateMsg <Trays> msg = new ValidateMsg <Trays>()
         {
             Valid = false
         };
         ITraysRep tr = new TraysRep(unit);
         Trays     t  = tr.GetSingleById(trayId);
         if (t == null)
         {
             msg.Message.Add("托盘标签:" + trayId + " 错误!");
         }
         else
         {
             msg.Valid = true;
         }
         return(msg);
     }
 }
 public ValidateMsg <SinglePackage> SingleCheckStore(string packageId)
 {
     using (IUnitOfWork unit = MSSqlHelper.DataContext())
     {
         ValidateMsg <SinglePackage> msg = new ValidateMsg <SinglePackage>()
         {
             Valid = true
         };
         try
         {
             ISinglePackageRep spr = new SinglePackageRep(unit);
             SinglePackage     sp  = spr.GetSingleById(packageId);
             msg.Target = sp;
             if (sp == null)
             {
                 msg.Valid = false;
                 msg.Message.Add("包装箱:" + packageId + " 不存在");
             }
             else
             if (!PackageStatusHelper.CanStoredStatus(sp.status))
             {
                 msg.Valid = false;
                 msg.Message.Add("包装箱:" + packageId + " 还未结束包装或标签为开箱标签!");
             }
             else
             if (!spr.Valid(sp.packageID))
             {
                 msg.Valid = false;
                 msg.Message.Add("包装箱:" + packageId + " 已经入库!");
             }
         }
         catch (Exception e)
         {
             msg.Valid = false;
             msg.Message.Add("错误:" + e.Message);
         }
         return(msg);
     }
 }
 public ValidateMsg<SinglePackage> SingleCheckStore(string packageId)
 {
     using (IUnitOfWork unit = MSSqlHelper.DataContext())
     {
         ValidateMsg<SinglePackage> msg = new ValidateMsg<SinglePackage>() { Valid = true };
         try
         {
             ISinglePackageRep spr = new SinglePackageRep(unit);
             SinglePackage sp = spr.GetSingleById(packageId);
             msg.Target = sp;
             if (sp == null)
             {
                 msg.Valid = false;
                 msg.Message.Add("包装箱:" + packageId + " 不存在");
             }
             else
                 if (!PackageStatusHelper.CanStoredStatus(sp.status))
                 {
                     msg.Valid = false;
                     msg.Message.Add("包装箱:" + packageId + " 还未结束包装或标签为开箱标签!");
                 }
                 else
                     if (!spr.Valid(sp.packageID))
                     {
                         msg.Valid = false;
                         msg.Message.Add("包装箱:" + packageId + " 已经入库!");
                     }
         }
         catch (Exception e)
         {
             msg.Valid = false;
             msg.Message.Add("错误:" + e.Message);
         }
         return msg;
     }
 }