public static Int32 Save(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, STD_WEB_PAGES objSave) { Int32 objReturn = 0; STD_WEB_PAGESDB objDB = new STD_WEB_PAGESDB(); objReturn = objDB.Save(CURRENT_USER, CURRENT_REGISTRY_ID, objSave); return(objReturn); }
public static STD_WEB_PAGES GetItem(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, Int32 PAGE_ID) { STD_WEB_PAGES objReturn = null; STD_WEB_PAGESDB objDB = new STD_WEB_PAGESDB(); objReturn = objDB.GetItem(CURRENT_USER, CURRENT_REGISTRY_ID, PAGE_ID); return(objReturn); }
private void LoadPageForm(int id) { ResetPageForm(); STD_WEB_PAGES page = ServiceInterfaceManager.STD_WEB_PAGES_GET(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, id); if (page != null) { hidePageId.Value = page.PAGE_ID.ToString(); txtName.Text = page.NAME; txtDisplayText.Text = page.DISPLAY_TEXT; txtUrl.Text = page.URL; listCorePage.SelectedValue = page.CORE_PAGE.ToString().ToLower(); } }
public STD_WEB_PAGES ParseReaderCustom(DataRow row) { STD_WEB_PAGES objReturn = new STD_WEB_PAGES { CORE_PAGE = (bool)GetNullableObject(row.Field <object>("STD_WEB_PAGES_CORE_PAGE")), CREATED = (DateTime)GetNullableObject(row.Field <object>("STD_WEB_PAGES_CREATED")), CREATEDBY = (string)GetNullableObject(row.Field <object>("STD_WEB_PAGES_CREATEDBY")), DISPLAY_TEXT = (string)GetNullableObject(row.Field <object>("STD_WEB_PAGES_DISPLAY_TEXT")), INACTIVE_DATE = (DateTime?)GetNullableObject(row.Field <object>("STD_WEB_PAGES_INACTIVE_DATE")), INACTIVE_FLAG = (bool)GetNullableObject(row.Field <object>("STD_WEB_PAGES_INACTIVE_FLAG")), NAME = (string)GetNullableObject(row.Field <object>("STD_WEB_PAGES_NAME")), PAGE_ID = (Int32)GetNullableObject(row.Field <object>("STD_WEB_PAGES_PAGE_ID")), UPDATED = (DateTime)GetNullableObject(row.Field <object>("STD_WEB_PAGES_UPDATED")), UPDATEDBY = (string)GetNullableObject(row.Field <object>("STD_WEB_PAGES_UPDATEDBY")), URL = (string)GetNullableObject(row.Field <object>("STD_WEB_PAGES_URL")) }; return(objReturn); }
private bool SavePageForm(ref string strResult) { STD_WEB_PAGES page = null; // if (!string.IsNullOrEmpty(txtName.Text) && !string.IsNullOrEmpty(txtDisplayText.Text) && !string.IsNullOrEmpty(txtUrl.Text)) if (string.IsNullOrEmpty(txtName.Text)) { strResult = "<ul><li>Page Name is Required</li></ul>"; } else if (string.IsNullOrEmpty(txtDisplayText.Text)) { strResult = "<ul><li>Display Text is Required</li></ul>"; } else if (string.IsNullOrEmpty(txtUrl.Text)) { strResult = "<ul><li>URL is Required</li></ul>"; } else { int id = 0; if (!string.IsNullOrEmpty(hidePageId.Value)) { int.TryParse(hidePageId.Value, out id); } if (id > 0) { page = ServiceInterfaceManager.STD_WEB_PAGES_GET(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, id); } if (page == null) { page = new STD_WEB_PAGES(); } page.CREATEDBY = page.UPDATEDBY = HttpContext.Current.User.Identity.Name; page.INACTIVE_FLAG = false; page.NAME = txtName.Text; page.DISPLAY_TEXT = txtDisplayText.Text; page.URL = txtUrl.Text; bool corePage = false; bool.TryParse(listCorePage.SelectedValue, out corePage); page.CORE_PAGE = corePage; page.PAGE_ID = ServiceInterfaceManager.STD_WEB_PAGES_SAVE(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, page); if (page.PAGE_ID > 0) { hidePageId.Value = page.PAGE_ID.ToString(); strResult = "Save successful<br /><br />"; listPageName.DataBind(); listMenuPageName.DataBind(); return(true); } else { strResult = "Error saving Page, please try again<br /><br />"; } // else // { // strResult = "<ul><li>Please enter a value Page Name, Display Text, and URL</li></ul>"; // } } return(false); }
public STD_WEB_PAGES GetItem(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, Int32 PAGE_ID) { STD_WEB_PAGES objReturn = null; SqlConnection sConn = null; SqlCommand sCmd = null; SqlDataAdapter sAdapter = null; DataSet objTemp = null; try { sConn = new SqlConnection(SqlConnectionString); sConn.Open(); sCmd = new SqlCommand("CRS.usp_STD_WEB_PAGES_getitem", sConn); sCmd.CommandTimeout = SqlCommandTimeout; sCmd.CommandType = CommandType.StoredProcedure; sCmd.Parameters.AddWithValue("@CURRENT_USER", CURRENT_USER); sCmd.Parameters.AddWithValue("@CURRENT_REGISTRY_ID", CURRENT_REGISTRY_ID); sCmd.Parameters.AddWithValue("@PAGE_ID", PAGE_ID); objTemp = new DataSet(); sAdapter = new SqlDataAdapter(sCmd); LogDetails logDetails = new LogDetails(String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), CURRENT_USER, CURRENT_REGISTRY_ID); sAdapter.Fill(objTemp); LogManager.LogTiming(logDetails); CheckDataSet(objTemp); if (objTemp != null && objTemp.Tables.Count > 0 && objTemp.Tables[0].Rows.Count > 0) { objReturn = ParseReader(objTemp.Tables[0].Rows[0]); } sConn.Close(); } catch (Exception ex) { LogManager.LogError(ex.Message, String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), CURRENT_USER, CURRENT_REGISTRY_ID); throw ex; } finally { if (sAdapter != null) { sAdapter.Dispose(); sAdapter = null; } if (sCmd != null) { sCmd.Dispose(); sCmd = null; } if (sConn != null) { if (sConn.State != ConnectionState.Closed) { sConn.Close(); } sConn.Dispose(); sConn = null; } } return(objReturn); }
public Int32 Save(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, STD_WEB_PAGES objSave) { Int32 objReturn = 0; SqlConnection sConn = null; SqlCommand sCmd = null; SqlParameter p = null; SqlDataAdapter sAdapter = null; DataSet objTemp = null; try { sConn = new SqlConnection(SqlConnectionString); sConn.Open(); sCmd = new SqlCommand("CRS.usp_STD_WEB_PAGES_save", sConn); sCmd.CommandTimeout = SqlCommandTimeout; sCmd.CommandType = CommandType.StoredProcedure; sCmd.Parameters.AddWithValue("@CURRENT_USER", CURRENT_USER); sCmd.Parameters.AddWithValue("@CURRENT_REGISTRY_ID", CURRENT_REGISTRY_ID); p = new SqlParameter("@CORE_PAGE", SqlDbType.Bit, 1); p.Precision = 1; p.Scale = 0; AddParameter(ref sCmd, ref p, objSave.CORE_PAGE); p = new SqlParameter("@CREATED", SqlDbType.DateTime, 8); p.Precision = 23; p.Scale = 3; AddParameter(ref sCmd, ref p, objSave.CREATED); p = new SqlParameter("@CREATEDBY", SqlDbType.VarChar, 30); p.Precision = 0; p.Scale = 0; AddParameter(ref sCmd, ref p, objSave.CREATEDBY); p = new SqlParameter("@DISPLAY_TEXT", SqlDbType.NVarChar, 100); p.Precision = 0; p.Scale = 0; AddParameter(ref sCmd, ref p, objSave.DISPLAY_TEXT); p = new SqlParameter("@INACTIVE_DATE", SqlDbType.DateTime, 8); p.Precision = 23; p.Scale = 3; AddParameter(ref sCmd, ref p, objSave.INACTIVE_DATE); p = new SqlParameter("@INACTIVE_FLAG", SqlDbType.Bit, 1); p.Precision = 1; p.Scale = 0; AddParameter(ref sCmd, ref p, objSave.INACTIVE_FLAG); p = new SqlParameter("@NAME", SqlDbType.NVarChar, 100); p.Precision = 0; p.Scale = 0; AddParameter(ref sCmd, ref p, objSave.NAME); p = new SqlParameter("@PAGE_ID", SqlDbType.Int, 4); p.Direction = ParameterDirection.InputOutput; p.Precision = 10; p.Scale = 0; AddParameter(ref sCmd, ref p, objSave.PAGE_ID); p = new SqlParameter("@UPDATED", SqlDbType.DateTime, 8); p.Precision = 23; p.Scale = 3; AddParameter(ref sCmd, ref p, objSave.UPDATED); p = new SqlParameter("@UPDATEDBY", SqlDbType.VarChar, 30); p.Precision = 0; p.Scale = 0; AddParameter(ref sCmd, ref p, objSave.UPDATEDBY); p = new SqlParameter("@URL", SqlDbType.NVarChar, 100); p.Precision = 0; p.Scale = 0; AddParameter(ref sCmd, ref p, objSave.URL); objTemp = new DataSet(); sAdapter = new SqlDataAdapter(sCmd); LogDetails logDetails = new LogDetails(String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), CURRENT_USER, CURRENT_REGISTRY_ID); //int cnt = sCmd.ExecuteNonQuery(); sAdapter.Fill(objTemp); LogManager.LogTiming(logDetails); CheckDataSet(objTemp); objReturn = (Int32)sCmd.Parameters["@PAGE_ID"].Value; sConn.Close(); } catch (Exception ex) { LogManager.LogError(ex.Message, String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), CURRENT_USER, CURRENT_REGISTRY_ID); throw ex; } finally { if (sAdapter != null) { sAdapter.Dispose(); sAdapter = null; } if (sCmd != null) { sCmd.Dispose(); sCmd = null; } if (sConn != null) { if (sConn.State != ConnectionState.Closed) { sConn.Close(); } sConn.Dispose(); sConn = null; } } return(objReturn); }
public static Boolean Delete(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, STD_WEB_PAGES objDelete) { return(Delete(CURRENT_USER, CURRENT_REGISTRY_ID, objDelete.PAGE_ID)); }