public DataTable CreateVoucher(Report_ISO_Result entity) { Console.WriteLine("Report_ISO_Result-AddISO():" + DateTime.Now.ToString()); try { DataTable dt = new DataTable(); if (entity.SampleName == "S03020001") { dt = acQC.DbHelper.ExecuteStoredProcedure("RY_Create_Stable_ISO_Voucher", new string[] { "UserID", "SampleName", "LOT_NO", "ColorLabel", "B", "E", "Line", "VoucherType" }, new object[] { entity.CreateBy, entity.SampleName, entity.LOT_NO, entity.ColorLabel, entity.BeginDate, entity.EndDate, entity.Line, entity.ColorLabel }).Tables[0]; } else { dt = acQC.DbHelper.ExecuteStoredProcedure("RY_Create_ISO_Voucher", new string[] { "UserID", "SampleName", "LOT_NO", "ColorLabel", "B", "E", "Line", "Vendor" }, new object[] { entity.CreateBy, entity.SampleName, entity.LOT_NO, entity.ColorLabel, entity.BeginDate, entity.EndDate, entity.Line, entity.Vendor }).Tables[0]; } return(dt); } catch (Exception e) { log.Error(e); throw new Exception("Create ReportISO_Result Eror:" + e.Message); } }
public IHttpActionResult CreateRYVoucher(Report_ISO_Result entity) { var result = otherISO.CreateVoucher(entity); JsonObject json = new JsonObject(); json["Success"] = result; Loger.Info(string.Format(@"ISOController/CreateRYVoucher/CreateVoucher:\n {0} create RYVoucherID VoucherID {1} | LOT_NO {2} | Colorlabel {3} | SampleName {4} ", entity.CreateBy, entity.VoucherID, entity.ColorLabel, entity.LOT_NO, entity.SampleName)); return(Ok(json)); }