public TblBeamStock SaveBeamStock(TblBeamStock master) { var res = new TblBeamStock(); var dt = new DataTable(); try { dt = InserOrUpdateBeamStock("SP_INSERT_BEAM_STOCK_MASTER_INFO", "SAVE_MASTER", master); res.SaveStatus = Operation.Success.ToString(); res.BID = Convert.ToInt32(dt.Rows[0]["BID"].ToString()); } catch (Exception ex) { res.SaveStatus = ex.Message; } return(res); }
public DataTable InserOrUpdateBeamStock(string procedure, string callname, TblBeamStock master) { 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("@BID", master.BID)); cmd.Parameters.Add(new SqlParameter("@BDate", master.BDate.Value.ToString("yyyy/MM/dd"))); cmd.Parameters.Add(new SqlParameter("@UCode", master.UCode)); cmd.Parameters.Add(new SqlParameter("@DCode", master.DCode)); cmd.Parameters.Add(new SqlParameter("@UName", master.UName)); cmd.Parameters.Add(new SqlParameter("@DName", master.DName)); cmd.Parameters.Add(new SqlParameter("@Remarks", master.Remarks)); da = new SqlDataAdapter(cmd); dt = new DataTable(); da.Fill(dt); dbConn.Close(); return(dt); }
public JsonResult SaveBeamStock(TblBeamStock master) { var result = _repository.SaveBeamStock(master); return(Json(result, JsonRequestBehavior.AllowGet)); }
public TblBeamStock SaveBeamStock(TblBeamStock master) { return(_service.SaveBeamStock(master)); }