コード例 #1
0
 public void SaveToolData(string toolType, string Barcode, float clearance, float height, float width, float length, string comments, string byWho, out string resCode, out string resDesc)
 {
     try
     {
         Log.AppendText("กำลังบันทึกข้อมูล Tool {" + toolType + ", " + Barcode + ", " + clearance.ToString() + ", " + height.ToString() + ", " + width.ToString() + ", " + length.ToString() + "} by " + byWho);
         ManageBiz ms = new ManageBiz();
         DataTable dtUser;
         dtUser = ms.GetToolBy(toolType);
         if (dtUser.Rows.Count == 0)
         {
             Log.AppendText("ตรวจสอบ ToolType เรียบร้อย");
             ms.AddNewTool(toolType, Barcode, clearance, height, width, length, comments);
             resCode = "00";
             resDesc = "";
         }
         else
         {
             Log.AppendText("WARNING! : ToolType ซ้ำ");
             Log.AppendText("เริ่มต้น Update Tool...");
             ms.UpdateToolData(toolType, Barcode, clearance, height, width, length, comments);
             resCode = "01";
             resDesc = "";
         }
     }
     catch (Exception ex)
     {
         resCode = "EX";
         resDesc = ex.Message;
         Log.AppendText(ex.Message);
     }
 }