public static R MyContents(MyConents myContents) { var m = new R(); try { SqlParameter[] param = { new SqlParameter("@MID",myContents.MID), new SqlParameter("@CID",myContents.CID), new SqlParameter("@CCID",myContents.CCID), new SqlParameter("@Second",myContents.Second), new SqlParameter("@Status",myContents.Status) }; var r = SqlHelper.ExecuteNonQuery(C.conn, CommandType.StoredProcedure, "Update_MyContents", param); m.Code = 0; } catch (Exception ex) { m.Code = 300; m.Message = ex.Message; log.Fatal(ex.Message); log.FatalException(ex.Message, ex); } return m; }
public ActionResult UpdateCC(MyConents myContents) { log.Debug("myContents.MID:{0}", myContents.MID); log.Debug("CID:{0}", myContents.CID); log.Debug("CCID:{0}", myContents.CCID); log.Debug("Second:{0}", myContents.Second); log.Debug("Status:{0}", myContents.Status); log.Debug("Client.MID:{0}", Client.MID); myContents.MID = Client.MID; var r = DAL.Update.MyContents(myContents); return Json(r); }
new public static List<MyConents> Contents(int MID, int CID) { var l = new List<MyConents>(); try { SqlParameter[] param = { new SqlParameter("@MID",MID), new SqlParameter("@CID",CID) }; var dr = SqlHelper.ExecuteReader(C.conn, CommandType.StoredProcedure, "Get_MyContents", param); while (dr.Read()) { var m = new MyConents(); m.CID = CID; m.MID = MID; m.CCID = Convert.ToInt32(dr["CCID"]); m.Name = Convert.ToString(dr["Name"]); m.Url = Convert.ToString(dr["Url"]); if (DBNull.Value != dr["Minutes"]) m.Minutes = Convert.ToInt32(dr["Minutes"]); if (DBNull.Value != dr["Second"]) m.Second = Convert.ToDecimal(dr["Second"]); if (DBNull.Value != dr["Status"]) m.Status = Convert.ToInt32(dr["Status"]); if (DBNull.Value != dr["MIME"]) m.MIME = Convert.ToString(dr["MIME"]); l.Add(m); } dr.Close(); } catch (Exception ex) { log.Fatal("{0},{1}",ex.Message,ex.StackTrace); } return l; }