林豪 左 3 éve
szülő
commit
93152bd982

+ 1 - 3
WCS_Client/Frm/Equipment/WCS_TASK.cs

@@ -40,8 +40,6 @@ namespace WCS_Client.Frm
 
         public string DEVICE { get; set; }
 
-        public string SCSTATION { get; set; }
-
         public DateTime CREATETIME { get; set; } = DateTime.Now;
         public DateTime? STARTTIME { get; set; }
         public DateTime? ENDTIME { get; set; }
@@ -62,7 +60,7 @@ namespace WCS_Client.Frm
         public short FULLQTY { get; set; }  
         public short HEIGHT { get; set; }
         public int WMSTASK { get; set; }  
-        public int GROUPTASK { get; set; }
+     
         public TaskStatus UPLOADED { get; set; }
         public string UPDATEUSER { get; set; }
         public DateTime UPDATETIME { get; set; }

+ 40 - 34
WCS_Client/Frm/MBtn_Task/FrmUpdatePriority.cs

@@ -1,4 +1,6 @@
-using DevComponents.DotNetBar;
+using CCWin.SkinClass;
+using DevComponents.DotNetBar;
+using SyntacticSugar;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -15,19 +17,23 @@ namespace WCS_Client.Frm
 {
     public partial class FrmUpdatePriority : Office2007Form
     {
-        DataRow dr = null;DataTable dt = null;
+        DataRow dr = null; DataTable dt = null;
         public FrmUpdatePriority(DataTable datarow)
         {
             InitializeComponent();
             dt = datarow;
-            //dr = datarow;
-            //lbltask_no.Text = dr["ID"].ToString();
-            //lblwmstask_no.Text = dr["WMSTASK"].ToString();
-            //lblBarCode.Text = dr["BARCODE"].ToString();
-            //lblStartAddress.Text = dr["ADDRFROM"].ToString();
-            //lblwcsNextAddress.Text = dr["ADDRNEXT"].ToString();
-            //lblEndAddress.Text = dr["ADDRTO"].ToString();
-            //nudPriority.Value = Convert.ToInt32(dr["Priority"].ToString());
+
+            int maxPriority = 0;
+
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                var pr = dt.Rows[i]["Priority"].ToInt32();
+                if (pr > maxPriority)
+                {
+                    maxPriority = pr;
+                }
+            }
+            nudPriority.Value = maxPriority;
         }
 
         private void btnCancel_Click(object sender, EventArgs e)
@@ -51,30 +57,30 @@ namespace WCS_Client.Frm
                 {
                     var dr = dt.Rows[i];
                     var task_no = Convert.ToInt32(dr["ID"].ToString());
-                    int priority = Convert.ToInt32(dr["Priority"].ToString());
-                     res = TryCachHelper.TryTranExecute((db) =>
-                    {
-                        var task = db.Queryable<WCS_TASK>().First(v => v.ID == task_no);
-                        if (task == null)
-                        {
-                            throw new Exception(string.Format("未查询到WCS任务[{0}]信息", task_no));
-                        }
-                        else
-                        {
-                            if (db.Updateable<WCS_TASK>()
-                                  .UpdateColumns(it => new WCS_TASK
-                                  {
-                                      Priority = priority,
-                                      UPDATEUSER = CurrentHelper.User.Use_Name,
-                                      UPDATETIME = DateTime.Now
-                                  })
-                                  .Where(v => v.ID == task_no).ExecuteCommand() < 0)
-                            {
-                                throw new Exception(string.Format("WCS任务[{0}]调整优先级失败", task_no));
-                            }
-                            //string msg = string.Format("任务[{0}]调整优先级为[{1}]成功。", task_no, priority);
-                        }
-                    });
+                    int priority = nudPriority.Value.ToInt32();
+                    res = TryCachHelper.TryTranExecute((db) =>
+                   {
+                       var task = db.Queryable<WCS_TASK>().First(v => v.ID == task_no);
+                       if (task == null)
+                       {
+                           throw new Exception(string.Format("未查询到WCS任务[{0}]信息", task_no));
+                       }
+                       else
+                       {
+                           if (db.Updateable<WCS_TASK>()
+                                 .UpdateColumns(it => new WCS_TASK
+                                 {
+                                     Priority = priority,
+                                     UPDATEUSER = CurrentHelper.User.Use_Name,
+                                     UPDATETIME = DateTime.Now
+                                 })
+                                 .Where(v => v.ID == task_no).ExecuteCommand() < 0)
+                           {
+                               throw new Exception(string.Format("WCS任务[{0}]调整优先级失败", task_no));
+                           }
+                           //string msg = string.Format("任务[{0}]调整优先级为[{1}]成功。", task_no, priority);
+                       }
+                   });
                     if (string.IsNullOrWhiteSpace(res))
                     {
                         //res = string.Format("任务[{0}]调整优先级[{1}]成功。", task_no.ToString(), priority);