/// <summary> /// Creates a cSummaryComments object. It will be saved in permanent storage only /// on calling Save() /// </summary> /// <returns>cSummaryComments object</returns> public static cSummaryComments Create() { cSummaryComments oObj = new cSummaryComments(); SecurityCheck((int)enSummaryComments_Action.Create); // Create an object in memory, will be saved to storage on calling Save() oObj.m_bCreating = true; oObj.m_bInvalid = false; return(oObj); }
/// <summary> /// Ensures that an object with the specified name exists, while creating other properties are set to their default values /// </summary> /// <param name="i_sName">Name</param> /// <returns>cSummaryComments object</returns> public static cSummaryComments CreateIfRequiredAndGet(string i_sName) { cSummaryComments oObj = cSummaryComments.Get_Name(i_sName); if (oObj == null) { oObj = cSummaryComments.Create(); oObj.sName = i_sName; oObj.Save(); } return(oObj); }
/// <summary> /// Finds and return cSummaryComments objects matching the specified criteria /// </summary> /// <param name="i_oFilter">Filter criteria (WHERE clause)</param> /// <returns>cSummaryComments objects</returns> public static List <cSummaryComments> Find(cFilter i_oFilter) { DataTable dt = Find_DataTable(i_oFilter, null); List <cSummaryComments> l = new List <cSummaryComments>(); cSummaryComments oObj; for (int i = 0; i < dt.Rows.Count; i++) { oObj = new cSummaryComments(); oObj.m_iID = Convert.ToInt32(dt.Rows[i]["iID"]); oObj.m_sName = dt.Rows[i]["sName"].ToString(); oObj.m_dtCreatedOn = Convert.ToDateTime(dt.Rows[i]["dtCreatedOn"]); oObj.m_dtLastUpdatedOn = Convert.ToDateTime(dt.Rows[i]["dtLastUpdatedOn"]); oObj.m_sDescription = Convert.ToString(dt.Rows[i]["sDescription"]); oObj.m_objEmpLogin.iObjectID = Convert.ToInt32(dt.Rows[i]["objEmpLogin"].ToString()); oObj.m_bInvalid = false; l.Add(oObj); } return(l); }
public void SaveSummaryComments() { try { string Summarys = Request.QueryString["SummaryComments"]; Summarys = Summarys.Substring(1, Summarys.Length - 1); string[] strSummaryList = Summarys.Split(new[] { ',' }); int LoginId = Convert.ToInt32(HttpContext.User.Identity.Name); for (int i = 0; i < strSummaryList.Length; i++) { cSummaryComments objSummaryComments = cSummaryComments.Create(); objSummaryComments.sDescription = strSummaryList[i]; objSummaryComments.objEmpLogin.iObjectID = LoginId; objSummaryComments.Save(); } } catch (Exception ex) { throw ex; } }
using System;