public TblBeamFinishDetails SaveBeamFinishDetail(TblBeamFinishDetails detail) { var res = new TblBeamFinishDetails(); var dt = new DataTable(); try { dt = InsertOrUpdateBeamFinishDetail("SP_INSERT_BEAM_FINISH_DETAIL_INFO", "SAVE_DETAIL", detail); res.SaveStatus = Operation.Success.ToString(); res.BIID = Convert.ToInt32(dt.Rows[0]["BIID"].ToString()); } catch (Exception ex) { res.SaveStatus = ex.Message; } return(res); }
public TblBeamFinishDetails SaveBeamFinishDetail(TblBeamFinishDetails detail) { return(_service.SaveBeamFinishDetail(detail)); }
public DataTable InsertOrUpdateBeamFinishDetail(string procedure, string callname, TblBeamFinishDetails detail) { dbConn = new SqlConnection(ConnectionString); dbConn.Open(); cmd = new SqlCommand(procedure, dbConn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@call_name", callname)); cmd.Parameters.Add(new SqlParameter("@BIID", detail.BIID)); cmd.Parameters.Add(new SqlParameter("@BID", detail.BID)); cmd.Parameters.Add(new SqlParameter("@Loom", detail.Loom)); cmd.Parameters.Add(new SqlParameter("@SetNo", detail.SetNo)); cmd.Parameters.Add(new SqlParameter("@SS", detail.SS)); cmd.Parameters.Add(new SqlParameter("@BeamNo", detail.BeamNo)); cmd.Parameters.Add(new SqlParameter("@Remarks", detail.Remarks)); da = new SqlDataAdapter(cmd); dt = new DataTable(); da.Fill(dt); dbConn.Close(); return(dt); }