public JsonResult SaveElectionDate(BacklogElectionDate objdata) { BacklogElectionDate objele = new BacklogElectionDate { SocietyTransId = Convert.ToString(Session["SocietyTransID"]), IPAddress = GetIPAddress(), BrowserName = GetWebBrowserName(), Updatedby = Convert.ToInt32(Session["UserId"]), ElectionDate = objdata.ElectionDate }; return(Json(objBdata.SaveElectionDate(objele), JsonRequestBehavior.AllowGet)); }
public int SaveElectionDate(BacklogElectionDate objelection) { connection.Open(); SqlCommand cmd = new SqlCommand("[dbo].[Blog_SaveElectionDate]", connection) { CommandType = CommandType.StoredProcedure }; cmd.Parameters.AddWithValue("@SocietyTransID", objelection.SocietyTransId); cmd.Parameters.AddWithValue("@ElectionDate", objelection.ElectionDate); cmd.Parameters.AddWithValue("@IPAddress", objelection.IPAddress); cmd.Parameters.AddWithValue("@BrowserName", objelection.BrowserName); cmd.Parameters.AddWithValue("@LoginID", objelection.Updatedby); var details = cmd.ExecuteNonQuery(); if (details >= 1) { return(1); } connection.Close(); return(0); }