public int Insert(ASSETKKF_MODEL.Data.Mssql.Mcis.MtWorkOrderSequence_Mch d, string userID = "") { var param = new Dapper.DynamicParameters(); param.Add("@WorkDate", d.WorkDate); param.Add("@ItemNo", d.ItemNo); param.Add("@WorkStationGrpCd", d.WorkStationGrpCd); param.Add("@EmployeeId", d.EmployeeId); param.Add("@WorkOrderId", d.WorkOrderId); param.Add("@StartTime", d.StartTime); param.Add("@EndTime", d.EndTime); param.Add("@QtyAmt", d.QtyAmt); param.Add("@StdTime", d.StdTime); param.Add("@ActTime", d.ActTime); param.Add("@DiffTime", d.DiffTime); param.Add("@Use_FreeTimeOT", d.Use_FreeTimeOT); param.Add("@User_Id", d.User_Id); param.Add("@User_date", d.User_date); param.Add("@DrawingCd", d.DrawingCd); param.Add("@CusCod", d.CusCod); param.Add("@Post_flag", d.Post_flag); param.Add("@SupplierCd", d.SupplierCd); param.Add("@Remark", d.Remark); param.Add("@Wantdate", d.Wantdate); param.Add("@ReworkFlag", d.ReworkFlag); param.Add("@Pause_Flag", d.Pause_Flag); string cmd = "INSERT INTO mcis.dbo.MtWorkOrderSequence_Mch " + $" (WorkDate, ItemNo, WorkStationGrpCd, EmployeeId, WorkOrderId, StartTime, EndTime, QtyAmt, StdTime, ActTime, DiffTime, Use_FreeTimeOT, User_Id, User_date, DrawingCd, CusCod, Post_flag, SupplierCd, Remark, Wantdate, ReworkFlag, Pause_Flag) " + $"VALUES(@WorkDate, @ItemNo, @WorkStationGrpCd, @EmployeeId, @WorkOrderId, @StartTime, @EndTime, @QtyAmt, @StdTime, @ActTime, @DiffTime, @Use_FreeTimeOT, @User_Id, @User_date, @DrawingCd, @CusCod, @Post_flag, @SupplierCd, @Remark, @Wantdate, @ReworkFlag, @Pause_Flag); " + $"SELECT SCOPE_IDENTITY();"; return(ExecuteScalar <int>(cmd, param)); }
public int Delete(ASSETKKF_MODEL.Data.Mssql.Mcis.MtWorkOrderSequence_Mch d, string userID = "", SqlTransaction transac = null) { var param = new Dapper.DynamicParameters(); param.Add("@WorkDate", d.WorkDate); param.Add("@ItemNo", d.ItemNo); param.Add("@WorkStationGrpCd", d.WorkStationGrpCd.GetValue()); param.Add("@EmployeeId", d.EmployeeId.GetValue()); param.Add("@WorkOrderId", d.WorkOrderId.GetValue()); param.Add("@StartTime", d.StartTime); param.Add("@EndTime", d.EndTime); param.Add("@QtyAmt", d.QtyAmt); param.Add("@StdTime", d.StdTime); param.Add("@ActTime", d.ActTime); param.Add("@DiffTime", d.DiffTime); param.Add("@Use_FreeTimeOT", d.Use_FreeTimeOT.GetValue()); param.Add("@User_Id", d.User_Id.GetValue()); param.Add("@User_date", d.User_date); param.Add("@DrawingCd", d.DrawingCd.GetValue()); param.Add("@CusCod", d.CusCod.GetValue()); param.Add("@Post_flag", d.Post_flag.GetValue()); param.Add("@SupplierCd", d.SupplierCd.GetValue()); param.Add("@Remark", d.Remark.GetValue()); param.Add("@Wantdate", d.Wantdate); param.Add("@ReworkFlag", d.ReworkFlag.GetValue()); param.Add("@Pause_Flag", d.Pause_Flag.GetValue()); string cmd = ""; /* * cmd = DELETE FROM mcis.dbo.MtWorkOrderSequence_Mch "+ * "WHERE WorkDate = @.WorkDate "+ * " AND ItemNo = @.ItemNo "+ * " AND WorkStationGrpCd = @.WorkStationGrpCd "+ * " AND EmployeeId = @.EmployeeId "+ * " AND WorkOrderId = @.WorkOrderId "+ * " AND StartTime = @.StartTime "+ * " AND EndTime = @.EndTime "+ * " AND QtyAmt = @.QtyAmt "+ * " AND StdTime = @.StdTime "+ * " AND ActTime = @.ActTime "+ * " AND DiffTime = @.DiffTime "+ * " AND Use_FreeTimeOT = @.Use_FreeTimeOT "+ * " AND User_Id = @.User_Id "+ * " AND User_date = @.User_date "+ * " AND DrawingCd = @.DrawingCd "+ * " AND CusCod = @.CusCod "+ * " AND Post_flag = @.Post_flag "+ * " AND SupplierCd = @.SupplierCd "+ * " AND Remark = @.Remark "+ * " AND Wantdate = @.Wantdate "+ * " AND ReworkFlag = @.ReworkFlag "+ * " AND Pause_Flag = @.Pause_Flag "+ * " "; */ var res = ExecuteNonQuery(transac, cmd, param); return(res); }