public StickyEnds SaveStickyEnd(StickyEnds stickyEnd) { var res = new StickyEnds(); var dt = new DataTable(); try { dt = InsertOrUpdateStickyEnd("sp_insert_sticky_end", "save_sticky_end", stickyEnd); res.SaveStatus = Operation.Success.ToString(); res.SID = Convert.ToInt32(dt.Rows[0]["SID"].ToString()); } catch (Exception ex) { res.SaveStatus = ex.Message; } return(res); }
public DataTable InsertOrUpdateStickyEnd(string procedure, string callname, StickyEnds stickyEnd) { 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("@SID", stickyEnd.SID)); cmd.Parameters.Add(new SqlParameter("@SDate", stickyEnd.SDate)); cmd.Parameters.Add(new SqlParameter("@DCode", stickyEnd.DCode)); cmd.Parameters.Add(new SqlParameter("@DName", stickyEnd.DName)); cmd.Parameters.Add(new SqlParameter("@UCode", stickyEnd.UCode)); cmd.Parameters.Add(new SqlParameter("@UName", stickyEnd.UName)); cmd.Parameters.Add(new SqlParameter("@Remarks", stickyEnd.Remarks)); cmd.Parameters.Add(new SqlParameter("@TrackDate", stickyEnd.TrackDate)); da = new SqlDataAdapter(cmd); dt = new DataTable(); da.Fill(dt); dbConn.Close(); return(dt); }
public JsonResult SaveStickyEndData(StickyEnds stickyEnd, StickyEndsDetails stickyEndDetail) { var res1 = new StickyEnds(); if (ModelState.IsValid) { //res1 = _repository.SaveStickyEnd(stickyEnd); if (res1.SaveStatus == Operation.Success.ToString()) { var res2 = new StickyEndsDetails(); stickyEndDetail.SID = res1.SID; //res2 = _repository.SaveStickyEndDeatils(stickyEndDetail); res1.SaveStatus = res2.SaveStatus; } } else { res1.SaveStatus = Operation.Failed.ToString(); } return(Json(res1, JsonRequestBehavior.AllowGet)); }
public StickyEnds SaveStickyEnd(StickyEnds stickyEnd) { return(_service.SaveStickyEnd(stickyEnd)); }