protected void Page_Load(object sender, EventArgs e) { SetPageTitle(Translation.GetTranslation.Term("Manufacturers.LBL_NAME")); Visible = Security.IS_ADMIN; Visible = Security.ADMIN_TYPE == 0 ? true : false; if (!Visible) { return; } reqNAME.DataBind(); reqLIST_ORDER.DataBind(); gID = CommonTypeConvert.ToGuid(Request["ID"]); if (!IsPostBack) { ctlDynamicButtons.AppendButtons(m_sMODULE + ".EditView", Guid.Empty, null); lstSTATUS.DataSource = CRMCache.List("manufacturer_status_dom"); lstSTATUS.DataBind(); if (!CommonTypeConvert.IsEmptyGuid(gID)) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["Administration_Manufacturers_EditView"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gID); using (SqlDataReader rdr = oQuery.ExecuteReader(CommandBehavior.SingleRow)) { if (rdr.Read()) { txtNAME.Text = CommonTypeConvert.ToString(rdr["NAME"]); ctlListHeader.Title = Translation.GetTranslation.Term("Manufacturers.LBL_NAME") + " " + txtNAME.Text; txtLIST_ORDER.Text = CommonTypeConvert.ToString(rdr["LIST_ORDER"]); lstSTATUS.SelectedValue = CommonTypeConvert.ToString(rdr["STATUS"]); } } } else { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["Manufacturers_EditView_113"].ToString(); oQuery.CommandText = innerSql; txtLIST_ORDER.Text = (CommonTypeConvert.ToInteger(oQuery.ExecuteScalar()) + 1).ToString(); } } }
public static string ReportingFilterColumnsListName(string sMODULE_NAME, string sDATA_FIELD) { Cache Cache = HttpRuntime.Cache; var sLIST_NAME = Cache.Get("vwSqlColumns_ListName." + sMODULE_NAME + "." + sDATA_FIELD) as string; if (sLIST_NAME == null) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_529"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@OBJECTNAME", SqlDbType.VarChar, 100, "vw" + sMODULE_NAME); oQuery.Add("@DATA_FIELD", SqlDbType.VarChar, 100, sDATA_FIELD); sLIST_NAME = CommonTypeConvert.ToString(oQuery.ExecuteScalar()); Cache.Insert("vwSqlColumns_ListName." + sMODULE_NAME + "." + sDATA_FIELD, sLIST_NAME, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return(sLIST_NAME); }
protected void Page_Load(object sender, EventArgs e) { SetPageTitle(Translation.GetTranslation.Term("ProductTypes.LBL_NAME")); if (!Visible) { return; } reqNAME.DataBind(); reqLIST_ORDER.DataBind(); gID = CommonTypeConvert.ToGuid(Request["ID"]); if (!IsPostBack) { ctlDynamicButtons.AppendButtons(m_sMODULE + ".EditView", Guid.Empty, null); if (!CommonTypeConvert.IsEmptyGuid(gID)) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["Administration_ProductTypes_EditView"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gID); using (SqlDataReader rdr = oQuery.ExecuteReader(CommandBehavior.SingleRow)) { if (rdr.Read()) { txtNAME.Text = CommonTypeConvert.ToString(rdr["NAME"]); ctlListHeader.Title = Translation.GetTranslation.Term("ProductTypes.LBL_NAME") + " " + txtNAME.Text; txtDESCRIPTION.Text = CommonTypeConvert.ToString(rdr["DESCRIPTION"]); txtLIST_ORDER.Text = CommonTypeConvert.ToString(rdr["LIST_ORDER"]); } } } else { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["ProductTypes_EditView_104"].ToString(); oQuery.CommandText = innerSql; txtLIST_ORDER.Text = (CommonTypeConvert.ToInteger(oQuery.ExecuteScalar()) + 1).ToString(); } } }
protected void BindGrid() { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["Products_relatedProducts_58"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gID); gACCOUNT_ID = CommonTypeConvert.ToGuid(oQuery.ExecuteScalar()); innerSql = "select " + CommonTypeConvert.FormatSelectFields(arrSelectFields) + " from vwPRODUCTS_RELATED_PRODUCTS" + ControlChars.CrLf + " where 1 = 1 " + ControlChars.CrLf; oQuery.CommandText = innerSql; TypeConvert.AppendParameter(oQuery, gID, "PARENT_ID"); oQuery.CommandText += grdMain.OrderByClause("DATE_ENTERED", "desc"); DataTable dt = oQuery.GetTable(); vwMain = dt.DefaultView; grdMain.DataSource = vwMain; grdMain.DataBind(); }
protected void BindGrid() { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["Products_relatedProducts_58"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gID); gACCOUNT_ID = CommonTypeConvert.ToGuid(oQuery.ExecuteScalar()); innerSql = "select " + CommonTypeConvert.FormatSelectFields(arrSelectFields) + " from vwPRODUCTS_RELATED_PRODUCTS" + ControlChars.CrLf + " where 1 = 1 " + ControlChars.CrLf; oQuery.CommandText = innerSql; TypeConvert.AppendParameter(oQuery, gID, "PARENT_ID"); oQuery.CommandText += grdMain.OrderByClause("DATE_ENTERED", "desc"); DataTable dt = oQuery.GetTable(); vwMain = dt.DefaultView; grdMain.DataSource = vwMain; grdMain.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { SetPageTitle(Translation.GetTranslation.Term("Manufacturers.LBL_NAME")); Visible = Security.IS_ADMIN; Visible = Security.ADMIN_TYPE == 0 ? true : false; if (!Visible) return; reqNAME.DataBind(); reqLIST_ORDER.DataBind(); gID = CommonTypeConvert.ToGuid(Request["ID"]); if (!IsPostBack) { ctlDynamicButtons.AppendButtons(m_sMODULE + ".EditView", Guid.Empty, null); lstSTATUS.DataSource = CRMCache.List("manufacturer_status_dom"); lstSTATUS.DataBind(); if (!CommonTypeConvert.IsEmptyGuid(gID)) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["Administration_Manufacturers_EditView"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gID); using (SqlDataReader rdr = oQuery.ExecuteReader(CommandBehavior.SingleRow)) { if (rdr.Read()) { txtNAME.Text = CommonTypeConvert.ToString(rdr["NAME"]); ctlListHeader.Title = Translation.GetTranslation.Term("Manufacturers.LBL_NAME") + " " + txtNAME.Text; txtLIST_ORDER.Text = CommonTypeConvert.ToString(rdr["LIST_ORDER"]); lstSTATUS.SelectedValue = CommonTypeConvert.ToString(rdr["STATUS"]); } } } else { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["Manufacturers_EditView_113"].ToString(); oQuery.CommandText = innerSql; txtLIST_ORDER.Text = (CommonTypeConvert.ToInteger(oQuery.ExecuteScalar()) + 1).ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { SetPageTitle(Translation.GetTranslation.Term("ProductTypes.LBL_NAME")); if (!Visible) return; reqNAME.DataBind(); reqLIST_ORDER.DataBind(); gID = CommonTypeConvert.ToGuid(Request["ID"]); if (!IsPostBack) { ctlDynamicButtons.AppendButtons(m_sMODULE + ".EditView", Guid.Empty, null); if (!CommonTypeConvert.IsEmptyGuid(gID)) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["Administration_ProductTypes_EditView"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gID); using (SqlDataReader rdr = oQuery.ExecuteReader(CommandBehavior.SingleRow)) { if (rdr.Read()) { txtNAME.Text = CommonTypeConvert.ToString(rdr["NAME"]); ctlListHeader.Title = Translation.GetTranslation.Term("ProductTypes.LBL_NAME") + " " + txtNAME.Text; txtDESCRIPTION.Text = CommonTypeConvert.ToString(rdr["DESCRIPTION"]); txtLIST_ORDER.Text = CommonTypeConvert.ToString(rdr["LIST_ORDER"]); } } } else { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["ProductTypes_EditView_104"].ToString(); oQuery.CommandText = innerSql; txtLIST_ORDER.Text = (CommonTypeConvert.ToInteger(oQuery.ExecuteScalar()) + 1).ToString(); } } }
public static string ReportingFilterColumnsListName(string sMODULE_NAME, string sDATA_FIELD) { Cache Cache = HttpRuntime.Cache; var sLIST_NAME = Cache.Get("vwSqlColumns_ListName." + sMODULE_NAME + "." + sDATA_FIELD) as string; if (sLIST_NAME == null) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_529"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@OBJECTNAME", SqlDbType.VarChar, 100, "vw" + sMODULE_NAME); oQuery.Add("@DATA_FIELD", SqlDbType.VarChar, 100, sDATA_FIELD); sLIST_NAME = CommonTypeConvert.ToString(oQuery.ExecuteScalar()); Cache.Insert("vwSqlColumns_ListName." + sMODULE_NAME + "." + sDATA_FIELD, sLIST_NAME, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return sLIST_NAME; }