public int SaveDataEntryTable(DataEntryTest datentry, int userid) { try { accessManager.SqlConnectionOpen(DataBase.WorkerInsentive); List <SqlParameter> aParameters = new List <SqlParameter>(); aParameters.Add(new SqlParameter("@requestId", datentry.RequestId)); aParameters.Add(new SqlParameter("@requestFor", datentry.RequestFor)); aParameters.Add(new SqlParameter("@businessunit", datentry.BusinessUnitId)); aParameters.Add(new SqlParameter("@buyer", datentry.BuyerId)); aParameters.Add(new SqlParameter("@userId", userid)); aParameters.Add(new SqlParameter("@instructions", datentry.Instructions)); aParameters.Add(new SqlParameter("@priority", datentry.Priority)); int primarykey = accessManager.SaveDataReturnPrimaryKey("sp_TestTableDataEntry", aParameters); return(primarykey); } catch (Exception exception) { accessManager.SqlConnectionClose(true); throw exception; } finally { accessManager.SqlConnectionClose(); } }
public ActionResult SubmitValueToMerchandise(DataEntryTest dataEntryTest) { if (Session["IncentiveUserId"] == null) { return(RedirectToAction("Index", "Account")); } int userid = Convert.ToInt32(Session["IncentiveUserId"]); int primarykey = homeDal.SaveDataEntryTable(dataEntryTest, userid); return(Json(primarykey, JsonRequestBehavior.AllowGet)); }