diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 65761837..f7c0aea9 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -1730,7 +1730,10 @@ namespace AMESCoreStudio.Web.Controllers { model.wipBarcodeOther.WipNO = model.wipInfo.WipNO; model.wipBarcodeOther.TypeNO = type_no.TypeNo; - result = await _pcsApi.PutWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther)); + if (model.wipBarcodeOther.OtherID != 0) + result = await _pcsApi.PutWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther)); + else + result = await _pcsApi.PostWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther)); } } @@ -1740,10 +1743,15 @@ namespace AMESCoreStudio.Web.Controllers var mACInfo = await _pcsApi.GetMACInfo(model.wipAtt.ItemNO); if (mACInfo != null) { - model.wipMAC.WipNO = model.wipInfo.WipNO; model.wipMAC.Title = mACInfo.Title; model.wipMAC.ClassGroup = mACInfo.ClassGroup; - result = await _pcsApi.PutWipMAC(JsonConvert.SerializeObject(model.wipMAC)); + if (!string.IsNullOrWhiteSpace(model.wipMAC.WipNO)) + result = await _pcsApi.PutWipMAC(JsonConvert.SerializeObject(model.wipMAC)); + else + { + model.wipMAC.WipNO = model.wipInfo.WipNO; + result = await _pcsApi.PostWipMAC(JsonConvert.SerializeObject(model.wipMAC)); + } result = await _pcsApi.PutMACInfoByClassGroup(mACInfo.ClassGroup, model.wipMAC.EndNO); } } diff --git a/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs b/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs index 2352a86a..4eb3d232 100644 --- a/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs +++ b/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs @@ -19,6 +19,8 @@ namespace AMESCoreStudio.Web.ViewModels.PCS Outfits = new List(); WipSops = new List(); WipOutfits = new List(); + wipMAC = new WipMAC(); + wipBarcodeOther = new WipBarcodeOther(); } /// diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index 997e52b5..33d7d16c 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -26,6 +26,8 @@ + +
@@ -579,7 +581,7 @@
- +
@@ -757,105 +759,105 @@ @* 治具組合sheet *@ -
- 新增 - - - @{int l = 0;} - - - - - - - - - - @foreach (var index in Model.WipOutfits) - { +
+ 新增 + +
- 設備編碼 - - 設備名稱 - - 生產單位 - - -
+ @{int l = 0;} + - - - - + + + + - l++; - } - -
- - - - - - - - 刪除 - + 設備編碼 + + 設備名稱 + + 生產單位 + + +
-
+ + + @foreach (var index in Model.WipOutfits) + { + + + + + + + + + + + + + 刪除 + + + l++; + } + + + @* SOP文件 sheet *@ -
- 新增 - - - @{int i = 0;} - - - - - - - - - - - @foreach (var index in Model.WipSops) - { - - - - - - - - i++; - } - -
- SOP檔案名稱 - - SOP路徑 - - SOP類型 - - 生產單位 - - -
- - - - - - - - - - 刪除 -
-
- +
+ 新增 + + + @{int i = 0;} + + + + + + + + + + + @foreach (var index in Model.WipSops) + { + + + + + + + + i++; + } + +
+ SOP檔案名稱 + + SOP路徑 + + SOP類型 + + 生產單位 + + +
+ + + + + + + + + + 刪除 +
+
+ +
-
@* 標籤選項sheet *@
diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeOthersController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeOthersController.cs index 065a23f6..4c66061c 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeOthersController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeOthersController.cs @@ -93,6 +93,8 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES public async Task> PostWipBarcodeOther([FromBody] WipBarcodeOther wipBarcodeOther) { ResultModel result = new ResultModel(); + Helper helper = new Helper(_context); + wipBarcodeOther.OtherID = helper.GetIDKey("OTHER_ID").Result; _context.WipBarcodeOthers.Add(wipBarcodeOther); try { @@ -109,9 +111,9 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES } /// - /// 更新檢驗结果維護 + /// 更新 /// - /// + /// /// [HttpPut] public async Task> PutWipBarcodeOther(WipBarcodeOther wipBarcodeOther) diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipMACController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipMACController.cs index 1c96c70b..83eaf805 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipMACController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipMACController.cs @@ -141,15 +141,10 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES ResultModel result = new ResultModel(); var getWipMAC = GetWipMAC(wipMAC.WipNO).Result.Value; - if (getWipMAC != null) { - _context.Entry(getWipMAC).State = EntityState.Modified; - getWipMAC.ClassGroup = wipMAC.ClassGroup; - getWipMAC.StartNO = wipMAC.StartNO; - getWipMAC.EndNO = wipMAC.EndNO; - getWipMAC.Title = wipMAC.Title; - getWipMAC.UpdateDate = DateTime.Now; + _context.WipMACs.Remove(getWipMAC); + _context.WipMACs.Add(wipMAC); } else { diff --git a/其他專案資料/AMES_AP/AMES_AP/Login.Designer.cs b/其他專案資料/AMES_AP/AMES_AP/Login.Designer.cs index d1c12a1b..29810132 100644 --- a/其他專案資料/AMES_AP/AMES_AP/Login.Designer.cs +++ b/其他專案資料/AMES_AP/AMES_AP/Login.Designer.cs @@ -62,6 +62,7 @@ this.txtUserName.Size = new System.Drawing.Size(392, 48); this.txtUserName.TabIndex = 0; this.txtUserName.TabStop = false; + this.txtUserName.Text = "1"; this.txtUserName.TextAlign = System.Windows.Forms.HorizontalAlignment.Left; this.txtUserName.TrailingIcon = null; this.txtUserName.UseSystemPasswordChar = false; @@ -105,6 +106,7 @@ this.txtPassword.Size = new System.Drawing.Size(392, 48); this.txtPassword.TabIndex = 2; this.txtPassword.TabStop = false; + this.txtPassword.Text = "1"; this.txtPassword.TextAlign = System.Windows.Forms.HorizontalAlignment.Left; this.txtPassword.TrailingIcon = null; this.txtPassword.UseSystemPasswordChar = true; @@ -135,6 +137,7 @@ this.btnLogin.HighEmphasis = true; this.btnLogin.Icon = null; this.btnLogin.Location = new System.Drawing.Point(162, 306); + this.btnLogin.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6); this.btnLogin.MouseState = MaterialSkin.MouseState.HOVER; this.btnLogin.Name = "btnLogin"; this.btnLogin.NoAccentTextColor = System.Drawing.Color.Empty; diff --git a/其他專案資料/AMES_AP/AMES_AP/StockControlForm.cs b/其他專案資料/AMES_AP/AMES_AP/StockControlForm.cs index 409e34da..df0c24a6 100644 --- a/其他專案資料/AMES_AP/AMES_AP/StockControlForm.cs +++ b/其他專案資料/AMES_AP/AMES_AP/StockControlForm.cs @@ -62,21 +62,6 @@ namespace AMES_AP UnitSelect.ValueMember = "Key"; GetLineSelect(); - //string apiUrl = "WebService_Entire.asmx/Get_LINE?CompanyID=01"; - //var result = ApiHelper.GetMethod(apiUrl); - //dynamic[] Json = JsonConvert.DeserializeObject(result); - //Json.Select(s => { s.LINENAME = s.LINEID + "-" + s.LINENAME; return s; }).ToList(); - //ArrayList myline = new ArrayList(); - //foreach (var item in Json.OrderBy(o => o.LINEID).ToList()) - //{ - // myline.Add(new DictionaryEntry(item.LINEID, item.LINENAME)); - //} - //cbLine.DataSource = new BindingSource(myline, null); - //cbLine.DisplayMember = "Value"; - //cbLine.ValueMember = "Key"; - //// 預設C4 - //int index = cbLine.FindString("C4"); - //cbLine.SelectedIndex = index; } /// @@ -125,18 +110,6 @@ namespace AMES_AP } #endregion - private void btnChooseFile_Click(object sender, EventArgs e) - { - var aa = ApiHelper.GetMethod("api/WipInfos"); - //DialogResult result = openFileDialog.ShowDialog(); - //if (result == DialogResult.OK) // Test result. - //{ - // lblFileName.Text = openFileDialog.FileName; - // //Do whatever you want - // //openFileDialog1.FileName ..... - //} - } - private void UnitSelect_SelectionChangeCommitted(object sender, EventArgs e) { GetLineSelect(); @@ -290,6 +263,10 @@ namespace AMES_AP } } + /// + /// 工單基本資料 + /// + /// private void GetWipInfoData(WipInfo wipInfo) { WipNo.Text = wipInfo.WipNO; @@ -357,11 +334,10 @@ namespace AMES_AP } var result_wipBox = JsonConvert.DeserializeObject(query_wipBox); - var result = true; if (result_wipBox == null) - result = ApiHelper.PostInsertMethod("api/WipBox", JsonConvert.SerializeObject(wipBox)); + ApiHelper.PostInsertMethod("api/WipBox", JsonConvert.SerializeObject(wipBox)); else - result = ApiHelper.PutMethod("api/WipBox", JsonConvert.SerializeObject(wipBox)); + ApiHelper.PutMethod("api/WipBox", JsonConvert.SerializeObject(wipBox)); // 自動裝箱 if (checkbox) @@ -400,7 +376,7 @@ namespace AMES_AP return; } - var result = ApiHelper.PutMethod("api/WipBox", JsonConvert.SerializeObject(wipBox)); + ApiHelper.PutMethod("api/WipBox", JsonConvert.SerializeObject(wipBox)); string BoxNoOrder = NowBoxNo.Text.Substring(NowBoxNo.Text.Length - 3, 3); BoxNoOrder = (int.Parse(BoxNoOrder) + 1).ToString().PadLeft(3, '0');