public static DataTable SavedSearch(string sMODULE) { HttpSessionState Session = HttpContext.Current.Session; var dt = Session["vwSAVED_SEARCH." + sMODULE] as DataTable; if (dt == null) { dt = new DataTable(); if (Security.IsAuthenticated()) { var oQuery = new InlineQueryDBManager(); string innerSql = "select ID " + ControlChars.CrLf + " , NAME " + ControlChars.CrLf + " , CONTENTS " + ControlChars.CrLf + " from vwSAVED_SEARCH " + ControlChars.CrLf + " where ASSIGNED_USER_ID = @USER_ID" + ControlChars.CrLf + " and SEARCH_MODULE = @MODULE " + ControlChars.CrLf + " order by NAME " + ControlChars.CrLf; oQuery.CommandText = innerSql; oQuery.Add("@USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID); oQuery.Add("@MODULE", SqlDbType.VarChar, sMODULE); dt = oQuery.GetTable(); Session["vwSAVED_SEARCH." + sMODULE] = dt; } } return(dt); }
protected void Page_Load(object sender, EventArgs e) { SetPageTitle(Translation.GetTranslation.Term(".moduleList." + m_sMODULE)); Visible = (Security.GetUserAccess(m_sMODULE, "edit") >= 0); if (!Visible) { return; } gID = CommonTypeConvert.ToGuid(Request["ID"]); if (!IsPostBack) { ctlDynamicButtons.AppendButtons(m_sMODULE + ".EditView", Guid.Empty, null); Guid gDuplicateID = CommonTypeConvert.ToGuid(Request["DuplicateID"]); if (!CommonTypeConvert.IsEmptyGuid(gID) || !CommonTypeConvert.IsEmptyGuid(gDuplicateID)) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["Administration_ProductTemplates_EditView"].ToString(); oQuery.CommandText = innerSql; if (!CommonTypeConvert.IsEmptyGuid(gDuplicateID)) { oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gDuplicateID); gID = Guid.Empty; } else { oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gID); } using (SqlDataReader rdr = oQuery.ExecuteReader(CommandBehavior.SingleRow)) { if (rdr.Read()) { ctlModuleHeader.Title = CommonTypeConvert.ToString(rdr["NAME"]); SetPageTitle(Translation.GetTranslation.Term(".moduleList." + m_sMODULE) + " - " + ctlModuleHeader.Title); Utils.UpdateTracker(Page, m_sMODULE, gID, ctlModuleHeader.Title); ViewState["ctlModuleHeader.Title"] = ctlModuleHeader.Title; AppendEditViewFields(m_sMODULE + ".EditView", tblMain, rdr); } } } else { AppendEditViewFields(m_sMODULE + ".EditView", tblMain, null); } } else { ctlModuleHeader.Title = CommonTypeConvert.ToString(ViewState["ctlModuleHeader.Title"]); SetPageTitle(Translation.GetTranslation.Term(".moduleList." + m_sMODULE) + " - " + ctlModuleHeader.Title); } }
public static DataTable ReportingModules() { Cache Cache = HttpRuntime.Cache; var dt = Cache.Get("vwMODULES_Reporting_" + Security.USER_ID) as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql = "select MODULE_NAME " + ControlChars.CrLf + " , DISPLAY_NAME " + ControlChars.CrLf + " from vwMODULES_Reporting " + ControlChars.CrLf + " where USER_ID = @USER_ID " + ControlChars.CrLf + " or USER_ID is null " + ControlChars.CrLf; oQuery.CommandText = innerSql; oQuery.Add("@USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID); dt = oQuery.GetTable(); foreach (DataRow row in dt.Rows) { row["DISPLAY_NAME"] = Translation.GetTranslation.Term(CommonTypeConvert.ToString(row["DISPLAY_NAME"])); } Cache.Insert("vwMODULES_Reporting_" + Security.USER_ID, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return(dt); }
private void UpdateContact(Guid gCONTACT_ID, bool bUpdateBilling, bool bUpdateShipping) { string innerSql = ApplicationSQL.SQL["Invoices_EditView_267"].ToString(); var oQuery = new InlineQueryDBManager(); oQuery.CommandText = innerSql; oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gCONTACT_ID); using (SqlDataReader rdr = oQuery.ExecuteReader(CommandBehavior.SingleRow)) { if (rdr.Read()) { if (bUpdateBilling) { new DynamicControl(this, "BILLING_CONTACT_ID").ID = CommonTypeConvert.ToGuid(rdr["ID"]); new DynamicControl(this, "BILLING_CONTACT_NAME").Text = CommonTypeConvert.ToString(rdr["NAME"]); } if (bUpdateShipping) { new DynamicControl(this, "SHIPPING_CONTACT_ID").ID = CommonTypeConvert.ToGuid(rdr["ID"]); new DynamicControl(this, "SHIPPING_CONTACT_NAME").Text = CommonTypeConvert.ToString(rdr["NAME"]); } Guid gACCOUNT_ID = CommonTypeConvert.ToGuid(rdr["ACCOUNT_ID"]); if (!CommonTypeConvert.IsEmptyGuid(gACCOUNT_ID)) { UpdateAccount(gACCOUNT_ID, bUpdateBilling, bUpdateShipping); } } } }
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); }
public static DataTable List(string sModuleName, string sListName) { Cache Cache = HttpRuntime.Cache; var dt = Cache.Get(Translation.GetTranslation.NAME + "." + sListName) as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_177"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@MODULE_NAME", SqlDbType.NVarChar, sModuleName.ToLower()); oQuery.Add("@LIST_NAME", SqlDbType.NVarChar, sListName.ToLower()); oQuery.Add("@LANG", SqlDbType.NVarChar, Translation.GetTranslation.NAME.ToLower()); dt = oQuery.GetTable(); Cache.Insert(Translation.GetTranslation.NAME + "." + sListName, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return(dt); }
public static DataTable Shortcuts(string sMODULE_NAME) { var dt = HttpContext.Current.Session["vwSHORTCUTS_Menu_ByUser." + sMODULE_NAME + "." + Security.USER_ID] as DataTable; if (dt == null) { dt = new DataTable(); if (Security.IsAuthenticated()) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_1304"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@MODULE_NAME", SqlDbType.VarChar, 100, sMODULE_NAME); oQuery.Add("@USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID); dt = oQuery.GetTable(); HttpContext.Current.Session["vwSHORTCUTS_Menu_ByUser." + sMODULE_NAME + "." + Security.USER_ID] = dt; } } return(dt); }
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("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(".moduleList." + m_sMODULE)); Visible = (Security.GetUserAccess(m_sMODULE, "view") >= 0); if (!Visible) { return; } gID = CommonTypeConvert.ToGuid(Request["ID"]); if (!IsPostBack) { if (!CommonTypeConvert.IsEmptyGuid(gID)) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["Administration_ProductTemplates_EditView"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gID); using (SqlDataReader rdr = oQuery.ExecuteReader(CommandBehavior.SingleRow)) { if (rdr.Read()) { ctlModuleHeader.Title = CommonTypeConvert.ToString(rdr["NAME"]); SetPageTitle(Translation.GetTranslation.Term(".moduleList." + m_sMODULE) + " - " + ctlModuleHeader.Title); Utils.UpdateTracker(Page, m_sMODULE, gID, ctlModuleHeader.Title); AppendDetailViewFields(m_sMODULE + ".DetailView", tblMain, rdr, Page_Command); ctlDynamicButtons.AppendButtons(m_sMODULE + ".DetailView", Guid.Empty, rdr); } else { plcSubPanel.Visible = false; ctlDynamicButtons.AppendButtons(m_sMODULE + ".DetailView", Guid.Empty, null); ctlDynamicButtons.DisableAll(); ctlDynamicButtons.ErrorText = Translation.GetTranslation.Term("ACL.LBL_NO_ACCESS"); } } } else { ctlDynamicButtons.AppendButtons(m_sMODULE + ".DetailView", Guid.Empty, null); ctlDynamicButtons.DisableAll(); } } }
public static DataTable ReportingFilterColumns(string sMODULE_NAME) { Cache Cache = HttpRuntime.Cache; var dt = Cache.Get("vwSqlColumns_Reporting." + sMODULE_NAME) as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_491"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@OBJECTNAME", SqlDbType.VarChar, 100, "vw" + sMODULE_NAME); dt = oQuery.GetTable(); Cache.Insert("vwSqlColumns_Reporting." + sMODULE_NAME, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return(dt); }
public static DataTable FieldsMetaData_Validated(string sMODULE) { Cache Cache = HttpRuntime.Cache; var dt = Cache.Get("vwFIELDS_META_DATA_Validated." + sMODULE) as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_1741"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@CUSTOM_MODULE", SqlDbType.VarChar, sMODULE); dt = oQuery.GetTable(); Cache.Insert("vwFIELDS_META_DATA_Validated." + sMODULE, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return(dt); }
public static DataTable FieldsMetaData_UnvalidatedCustomFields(string sTABLE_NAME) { Cache Cache = HttpRuntime.Cache; var dt = Cache.Get("vwFIELDS_META_DATA_Unvalidated." + sTABLE_NAME) as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_1694"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@TABLE_NAME", SqlDbType.VarChar, sTABLE_NAME + "_CSTM"); dt = oQuery.GetTable(); Cache.Insert("vwFIELDS_META_DATA_Unvalidated." + sTABLE_NAME, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return(dt); }
protected void BindGrid() { var oQuery = new InlineQueryDBManager(); string innerSql = "select " + CommonTypeConvert.FormatSelectFields(arrSelectFields) + " from vwPRODUCT_TEMPLATES_NOTES" + ControlChars.CrLf + " where 1 = 1 " + ControlChars.CrLf; oQuery.CommandText = innerSql; oQuery.Add("@PRODUCT_TEMPLATE_ID", SqlDbType.UniqueIdentifier, gID); TypeConvert.AppendParameter(oQuery, gID, "PRODUCT_TEMPLATE_ID"); oQuery.CommandText += grdMain.OrderByClause("DATE_MODIFIED", "asc"); DataTable dt = oQuery.GetTable(); vwMain = dt.DefaultView; grdMain.DataSource = vwMain; grdMain.DataBind(); }
public static DataTable MobileMenu() { HttpSessionState Session = HttpContext.Current.Session; var dt = Session["vwMODULES_MobileMenu_ByUser." + Security.USER_ID] as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_1252"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID); dt = oQuery.GetTable(); Session["vwMODULES_MobileMenu_ByUser." + Security.USER_ID] = dt; } return(dt); }
protected void Page_Load(object sender, EventArgs e) { SetPageTitle(Translation.GetTranslation.Term(".moduleList." + m_sMODULE)); Visible = (Security.GetUserAccess(m_sMODULE, "view") >= 0); if (!Visible) return; gID = CommonTypeConvert.ToGuid(Request["ID"]); if (!IsPostBack) { if (!CommonTypeConvert.IsEmptyGuid(gID)) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["Administration_ProductTemplates_EditView"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gID); using (SqlDataReader rdr = oQuery.ExecuteReader(CommandBehavior.SingleRow)) { if (rdr.Read()) { ctlModuleHeader.Title = CommonTypeConvert.ToString(rdr["NAME"]); SetPageTitle(Translation.GetTranslation.Term(".moduleList." + m_sMODULE) + " - " + ctlModuleHeader.Title); Utils.UpdateTracker(Page, m_sMODULE, gID, ctlModuleHeader.Title); AppendDetailViewFields(m_sMODULE + ".DetailView", tblMain, rdr, Page_Command); ctlDynamicButtons.AppendButtons(m_sMODULE + ".DetailView", Guid.Empty, rdr); } else { plcSubPanel.Visible = false; ctlDynamicButtons.AppendButtons(m_sMODULE + ".DetailView", Guid.Empty, null); ctlDynamicButtons.DisableAll(); ctlDynamicButtons.ErrorText = Translation.GetTranslation.Term("ACL.LBL_NO_ACCESS"); } } } else { ctlDynamicButtons.AppendButtons(m_sMODULE + ".DetailView", Guid.Empty, null); ctlDynamicButtons.DisableAll(); } } }
private void UpdateAccount(Guid gACCOUNT_ID, bool bUpdateBilling, bool bUpdateShipping) { string innerSql = ApplicationSQL.SQL["Invoices_EditView_223"].ToString(); var oQuery = new InlineQueryDBManager(); oQuery.CommandText = innerSql; oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gACCOUNT_ID); using (SqlDataReader rdr = oQuery.ExecuteReader(CommandBehavior.SingleRow)) { if (rdr.Read()) { if (bUpdateBilling) { new DynamicControl(this, "BILLING_ACCOUNT_ID").ID = CommonTypeConvert.ToGuid(rdr["ID"]); new DynamicControl(this, "BILLING_ACCOUNT_NAME").Text = CommonTypeConvert.ToString(rdr["NAME"]); new DynamicControl(this, "BILLING_ADDRESS_STREET").Text = CommonTypeConvert.ToString(rdr["BILLING_ADDRESS_STREET"]); new DynamicControl(this, "BILLING_ADDRESS_CITY").Text = CommonTypeConvert.ToString(rdr["BILLING_ADDRESS_CITY"]); new DynamicControl(this, "BILLING_ADDRESS_STATE").Text = CommonTypeConvert.ToString(rdr["BILLING_ADDRESS_STATE"]); new DynamicControl(this, "BILLING_ADDRESS_POSTALCODE").Text = CommonTypeConvert.ToString(rdr["BILLING_ADDRESS_POSTALCODE"]); new DynamicControl(this, "BILLING_ADDRESS_COUNTRY").Text = CommonTypeConvert.ToString(rdr["BILLING_ADDRESS_COUNTRY"]); } if (bUpdateShipping) { new DynamicControl(this, "SHIPPING_ACCOUNT_ID").ID = CommonTypeConvert.ToGuid(rdr["ID"]); new DynamicControl(this, "SHIPPING_ACCOUNT_NAME").Text = CommonTypeConvert.ToString(rdr["NAME"]); new DynamicControl(this, "SHIPPING_ADDRESS_STREET").Text = CommonTypeConvert.ToString(rdr["SHIPPING_ADDRESS_STREET"]); new DynamicControl(this, "SHIPPING_ADDRESS_CITY").Text = CommonTypeConvert.ToString(rdr["SHIPPING_ADDRESS_CITY"]); new DynamicControl(this, "SHIPPING_ADDRESS_STATE").Text = CommonTypeConvert.ToString(rdr["SHIPPING_ADDRESS_STATE"]); new DynamicControl(this, "SHIPPING_ADDRESS_POSTALCODE").Text = CommonTypeConvert.ToString(rdr["SHIPPING_ADDRESS_POSTALCODE"]); new DynamicControl(this, "SHIPPING_ADDRESS_COUNTRY").Text = CommonTypeConvert.ToString(rdr["SHIPPING_ADDRESS_COUNTRY"]); } } } }
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 DataTable AssignedUser() { Cache Cache = HttpRuntime.Cache; bool bTeamFilter = !Security.IS_ADMIN && Config.enable_team_management(); string sCACHE_NAME = String.Empty; if (bTeamFilter) { sCACHE_NAME = "vwTEAMS_ASSIGNED_TO." + Security.USER_ID; } else { sCACHE_NAME = "vwUSERS_ASSIGNED_TO"; } var dt = Cache.Get(sCACHE_NAME) as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql; if (bTeamFilter) { innerSql = ApplicationSQL.SQL["_code_CRMCache_256"].ToString(); } else { innerSql = "select ID " + ControlChars.CrLf + " , USER_NAME " + ControlChars.CrLf + " from vwUSERS_ASSIGNED_TO" + ControlChars.CrLf + " order by USER_NAME " + ControlChars.CrLf; } oQuery.CommandText = innerSql; if (bTeamFilter) { oQuery.Add("@MEMBERSHIP_USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID); } dt = oQuery.GetTable(); Cache.Insert(sCACHE_NAME, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return(dt); }
public static DataTable TabMenuDescription() { HttpSessionState Session = HttpContext.Current.Session; var dt = Session["vwMODULES_DESCRIPTION_ByUser." + Security.USER_ID] as DataTable; if (dt == null) { dt = new DataTable(); if (Security.IsAuthenticated()) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_1939"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID); dt = oQuery.GetTable(); Session["vwMODULES_DESCRIPTION_ByUser." + Security.USER_ID] = dt; } } return(dt); }
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("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 DataTable ImportModules() { Cache Cache = HttpRuntime.Cache; var dt = Cache.Get("vwMODULES_Import_" + Security.USER_ID) as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_RMCache_392"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID); dt = oQuery.GetTable(); foreach (DataRow row in dt.Rows) { row["DISPLAY_NAME"] = Translation.GetTranslation.Term(CommonTypeConvert.ToString(row["DISPLAY_NAME"])); } Cache.Insert("vwMODULES_Import_" + Security.USER_ID, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return(dt); }
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(); }
public static DataTable ReportingModules() { Cache Cache = HttpRuntime.Cache; var dt = Cache.Get("vwMODULES_Reporting_" + Security.USER_ID) as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql = "select MODULE_NAME " + ControlChars.CrLf + " , DISPLAY_NAME " + ControlChars.CrLf + " from vwMODULES_Reporting " + ControlChars.CrLf + " where USER_ID = @USER_ID " + ControlChars.CrLf + " or USER_ID is null " + ControlChars.CrLf; oQuery.CommandText = innerSql; oQuery.Add("@USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID); dt = oQuery.GetTable(); foreach (DataRow row in dt.Rows) { row["DISPLAY_NAME"] = Translation.GetTranslation.Term(CommonTypeConvert.ToString(row["DISPLAY_NAME"])); } Cache.Insert("vwMODULES_Reporting_" + Security.USER_ID, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return dt; }
public static DataTable ImportColumns(string sMODULE_NAME) { Cache Cache = HttpRuntime.Cache; var dt = Cache.Get("vwSqlColumns_Import." + sMODULE_NAME) as DataTable; if (dt == null) { string sTABLE_NAME = CommonTypeConvert.ToString(HttpContext.Current.Application["Modules." + sMODULE_NAME + ".TableName"]); if (CommonTypeConvert.IsEmptyString(sTABLE_NAME)) sTABLE_NAME = sMODULE_NAME.ToUpper(); var oQuery = new InlineQueryDBManager(); dt = new DataTable(); dt.Columns.Add("ColumnName", Type.GetType("System.String")); dt.Columns.Add("NAME", Type.GetType("System.String")); dt.Columns.Add("DISPLAY_NAME", Type.GetType("System.String")); dt.Columns.Add("ColumnType", Type.GetType("System.String")); dt.Columns.Add("Size", Type.GetType("System.Int32")); dt.Columns.Add("Scale", Type.GetType("System.Int32")); dt.Columns.Add("Precision", Type.GetType("System.Int32")); dt.Columns.Add("colid", Type.GetType("System.Int32")); dt.Columns.Add("CustomField", Type.GetType("System.Boolean")); { oQuery = null; try { oQuery = InlineQueryDBManager.Factory("stp_Zpro_" + sTABLE_NAME + "_Import"); if (oQuery == null) throw new Exception(); } catch { oQuery = InlineQueryDBManager.Factory("stp_Zpro_" + sTABLE_NAME + "_Update"); } for (int i = 0; i < oQuery.Count; i++) { SqlParameter par = oQuery[i]; DataRow row = dt.NewRow(); dt.Rows.Add(row); row["ColumnName"] = par.ParameterName; row["NAME"] = CommonTypeConvert.ExtractDbName(par.ParameterName); row["DISPLAY_NAME"] = row["NAME"]; row["ColumnType"] = par.DbType.ToString(); row["Size"] = par.Size; row["Scale"] = par.Scale; row["Precision"] = par.Precision; row["colid"] = i; row["CustomField"] = false; } string sSQL; if (Config.enable_team_management()) { bool bModuleIsTeamed = CommonTypeConvert.ToBoolean( HttpContext.Current.Application["Modules." + sMODULE_NAME + ".Teamed"]); DataRow row = dt.NewRow(); row = dt.NewRow(); row["ColumnName"] = "@TEAM_NAME"; row["NAME"] = "TEAM_NAME"; row["DISPLAY_NAME"] = "TEAM_NAME"; row["ColumnType"] = "string"; row["Size"] = 128; row["colid"] = dt.Rows.Count; row["CustomField"] = false; dt.Rows.Add(row); } sSQL = ApplicationSQL.SQL["_code_CRMCache_629"]; oQuery = new InlineQueryDBManager(); oQuery.CommandText = sSQL; oQuery.Add("@OBJECTNAME", SqlDbType.NVarChar, sTABLE_NAME + "_CSTM"); DataTable dtCSTM = oQuery.GetTable(); foreach (DataRow rowCSTM in dtCSTM.Rows) { DataRow row = dt.NewRow(); row["ColumnName"] = CommonTypeConvert.ToString(rowCSTM["ColumnName"]); row["NAME"] = CommonTypeConvert.ToString(rowCSTM["ColumnName"]); row["DISPLAY_NAME"] = CommonTypeConvert.ToString(rowCSTM["ColumnName"]); row["ColumnType"] = CommonTypeConvert.ToString(rowCSTM["CsType"]); row["Size"] = CommonTypeConvert.ToInteger(rowCSTM["length"]); row["colid"] = dt.Rows.Count; row["CustomField"] = true; dt.Rows.Add(row); } Cache.Insert("vwSqlColumns_Import." + sMODULE_NAME, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } } return dt; //return new DataTable(); }
public static DataTable ImportModules() { Cache Cache = HttpRuntime.Cache; var dt = Cache.Get("vwMODULES_Import_" + Security.USER_ID) as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_RMCache_392"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID); dt = oQuery.GetTable(); foreach (DataRow row in dt.Rows) { row["DISPLAY_NAME"] = Translation.GetTranslation.Term(CommonTypeConvert.ToString(row["DISPLAY_NAME"])); } Cache.Insert("vwMODULES_Import_" + Security.USER_ID, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return dt; }
public static DataTable List(string sModuleName, string sListName) { Cache Cache = HttpRuntime.Cache; var dt = Cache.Get(Translation.GetTranslation.NAME + "." + sListName) as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_177"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@MODULE_NAME", SqlDbType.NVarChar, sModuleName.ToLower()); oQuery.Add("@LIST_NAME", SqlDbType.NVarChar, sListName.ToLower()); oQuery.Add("@LANG", SqlDbType.NVarChar, Translation.GetTranslation.NAME.ToLower()); dt = oQuery.GetTable(); Cache.Insert(Translation.GetTranslation.NAME + "." + sListName, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return dt; }
public static DataTable MobileMenu() { HttpSessionState Session = HttpContext.Current.Session; var dt = Session["vwMODULES_MobileMenu_ByUser." + Security.USER_ID] as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_1252"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID); dt = oQuery.GetTable(); Session["vwMODULES_MobileMenu_ByUser." + Security.USER_ID] = dt; } return dt; }
public static DataTable FieldsMetaData_UnvalidatedCustomFields(string sTABLE_NAME) { Cache Cache = HttpRuntime.Cache; var dt = Cache.Get("vwFIELDS_META_DATA_Unvalidated." + sTABLE_NAME) as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_1694"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@TABLE_NAME", SqlDbType.VarChar, sTABLE_NAME + "_CSTM"); dt = oQuery.GetTable(); Cache.Insert("vwFIELDS_META_DATA_Unvalidated." + sTABLE_NAME, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return dt; }
public static DataTable ImportColumns(string sMODULE_NAME) { Cache Cache = HttpRuntime.Cache; var dt = Cache.Get("vwSqlColumns_Import." + sMODULE_NAME) as DataTable; if (dt == null) { string sTABLE_NAME = CommonTypeConvert.ToString(HttpContext.Current.Application["Modules." + sMODULE_NAME + ".TableName"]); if (CommonTypeConvert.IsEmptyString(sTABLE_NAME)) { sTABLE_NAME = sMODULE_NAME.ToUpper(); } var oQuery = new InlineQueryDBManager(); dt = new DataTable(); dt.Columns.Add("ColumnName", Type.GetType("System.String")); dt.Columns.Add("NAME", Type.GetType("System.String")); dt.Columns.Add("DISPLAY_NAME", Type.GetType("System.String")); dt.Columns.Add("ColumnType", Type.GetType("System.String")); dt.Columns.Add("Size", Type.GetType("System.Int32")); dt.Columns.Add("Scale", Type.GetType("System.Int32")); dt.Columns.Add("Precision", Type.GetType("System.Int32")); dt.Columns.Add("colid", Type.GetType("System.Int32")); dt.Columns.Add("CustomField", Type.GetType("System.Boolean")); { oQuery = null; try { oQuery = InlineQueryDBManager.Factory("stp_Zpro_" + sTABLE_NAME + "_Import"); if (oQuery == null) { throw new Exception(); } } catch { oQuery = InlineQueryDBManager.Factory("stp_Zpro_" + sTABLE_NAME + "_Update"); } for (int i = 0; i < oQuery.Count; i++) { SqlParameter par = oQuery[i]; DataRow row = dt.NewRow(); dt.Rows.Add(row); row["ColumnName"] = par.ParameterName; row["NAME"] = CommonTypeConvert.ExtractDbName(par.ParameterName); row["DISPLAY_NAME"] = row["NAME"]; row["ColumnType"] = par.DbType.ToString(); row["Size"] = par.Size; row["Scale"] = par.Scale; row["Precision"] = par.Precision; row["colid"] = i; row["CustomField"] = false; } string sSQL; if (Config.enable_team_management()) { bool bModuleIsTeamed = CommonTypeConvert.ToBoolean( HttpContext.Current.Application["Modules." + sMODULE_NAME + ".Teamed"]); DataRow row = dt.NewRow(); row = dt.NewRow(); row["ColumnName"] = "@TEAM_NAME"; row["NAME"] = "TEAM_NAME"; row["DISPLAY_NAME"] = "TEAM_NAME"; row["ColumnType"] = "string"; row["Size"] = 128; row["colid"] = dt.Rows.Count; row["CustomField"] = false; dt.Rows.Add(row); } sSQL = ApplicationSQL.SQL["_code_CRMCache_629"]; oQuery = new InlineQueryDBManager(); oQuery.CommandText = sSQL; oQuery.Add("@OBJECTNAME", SqlDbType.NVarChar, sTABLE_NAME + "_CSTM"); DataTable dtCSTM = oQuery.GetTable(); foreach (DataRow rowCSTM in dtCSTM.Rows) { DataRow row = dt.NewRow(); row["ColumnName"] = CommonTypeConvert.ToString(rowCSTM["ColumnName"]); row["NAME"] = CommonTypeConvert.ToString(rowCSTM["ColumnName"]); row["DISPLAY_NAME"] = CommonTypeConvert.ToString(rowCSTM["ColumnName"]); row["ColumnType"] = CommonTypeConvert.ToString(rowCSTM["CsType"]); row["Size"] = CommonTypeConvert.ToInteger(rowCSTM["length"]); row["colid"] = dt.Rows.Count; row["CustomField"] = true; dt.Rows.Add(row); } Cache.Insert("vwSqlColumns_Import." + sMODULE_NAME, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } } return(dt); //return new DataTable(); }
public static DataTable FieldsMetaData_Validated(string sMODULE) { Cache Cache = HttpRuntime.Cache; var dt = Cache.Get("vwFIELDS_META_DATA_Validated." + sMODULE) as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_1741"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@CUSTOM_MODULE", SqlDbType.VarChar, sMODULE); dt = oQuery.GetTable(); Cache.Insert("vwFIELDS_META_DATA_Validated." + sMODULE, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return dt; }
private void UpdateAccount(Guid gACCOUNT_ID, bool bUpdateBilling, bool bUpdateShipping) { string innerSql = ApplicationSQL.SQL["Invoices_EditView_223"].ToString(); var oQuery = new InlineQueryDBManager(); oQuery.CommandText = innerSql; oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gACCOUNT_ID); using (SqlDataReader rdr = oQuery.ExecuteReader(CommandBehavior.SingleRow)) { if (rdr.Read()) { if (bUpdateBilling) { new DynamicControl(this, "BILLING_ACCOUNT_ID").ID = CommonTypeConvert.ToGuid(rdr["ID"]); new DynamicControl(this, "BILLING_ACCOUNT_NAME").Text = CommonTypeConvert.ToString(rdr["NAME"]); new DynamicControl(this, "BILLING_ADDRESS_STREET").Text = CommonTypeConvert.ToString(rdr["BILLING_ADDRESS_STREET"]); new DynamicControl(this, "BILLING_ADDRESS_CITY").Text = CommonTypeConvert.ToString(rdr["BILLING_ADDRESS_CITY"]); new DynamicControl(this, "BILLING_ADDRESS_STATE").Text = CommonTypeConvert.ToString(rdr["BILLING_ADDRESS_STATE"]); new DynamicControl(this, "BILLING_ADDRESS_POSTALCODE").Text = CommonTypeConvert.ToString(rdr["BILLING_ADDRESS_POSTALCODE"]); new DynamicControl(this, "BILLING_ADDRESS_COUNTRY").Text = CommonTypeConvert.ToString(rdr["BILLING_ADDRESS_COUNTRY"]); } if (bUpdateShipping) { new DynamicControl(this, "SHIPPING_ACCOUNT_ID").ID = CommonTypeConvert.ToGuid(rdr["ID"]); new DynamicControl(this, "SHIPPING_ACCOUNT_NAME").Text = CommonTypeConvert.ToString(rdr["NAME"]); new DynamicControl(this, "SHIPPING_ADDRESS_STREET").Text = CommonTypeConvert.ToString(rdr["SHIPPING_ADDRESS_STREET"]); new DynamicControl(this, "SHIPPING_ADDRESS_CITY").Text = CommonTypeConvert.ToString(rdr["SHIPPING_ADDRESS_CITY"]); new DynamicControl(this, "SHIPPING_ADDRESS_STATE").Text = CommonTypeConvert.ToString(rdr["SHIPPING_ADDRESS_STATE"]); new DynamicControl(this, "SHIPPING_ADDRESS_POSTALCODE").Text = CommonTypeConvert.ToString(rdr["SHIPPING_ADDRESS_POSTALCODE"]); new DynamicControl(this, "SHIPPING_ADDRESS_COUNTRY").Text = CommonTypeConvert.ToString(rdr["SHIPPING_ADDRESS_COUNTRY"]); } } } }
public static DataTable SavedSearch(string sMODULE) { HttpSessionState Session = HttpContext.Current.Session; var dt = Session["vwSAVED_SEARCH." + sMODULE] as DataTable; if (dt == null) { dt = new DataTable(); if (Security.IsAuthenticated()) { var oQuery = new InlineQueryDBManager(); string innerSql = "select ID " + ControlChars.CrLf + " , NAME " + ControlChars.CrLf + " , CONTENTS " + ControlChars.CrLf + " from vwSAVED_SEARCH " + ControlChars.CrLf + " where ASSIGNED_USER_ID = @USER_ID" + ControlChars.CrLf + " and SEARCH_MODULE = @MODULE " + ControlChars.CrLf + " order by NAME " + ControlChars.CrLf; oQuery.CommandText = innerSql; oQuery.Add("@USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID); oQuery.Add("@MODULE", SqlDbType.VarChar, sMODULE); dt = oQuery.GetTable(); Session["vwSAVED_SEARCH." + sMODULE] = dt; } } return dt; }
public static DataTable TabMenuDescription() { HttpSessionState Session = HttpContext.Current.Session; var dt = Session["vwMODULES_DESCRIPTION_ByUser." + Security.USER_ID] as DataTable; if (dt == null) { dt = new DataTable(); if (Security.IsAuthenticated()) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_1939"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID); dt = oQuery.GetTable(); Session["vwMODULES_DESCRIPTION_ByUser." + Security.USER_ID] = dt; } } return dt; }
public static DataTable SearchColumns(string sVIEW_NAME) { Cache Cache = HttpRuntime.Cache; var dt = Cache.Get("vwSqlColumns_Searching." + sVIEW_NAME) as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_1926"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@OBJECTNAME", SqlDbType.VarChar, sVIEW_NAME); dt = oQuery.GetTable(); Cache.Insert("vwSqlColumns_Searching." + sVIEW_NAME, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return dt; }
public static DataTable Shortcuts(string sMODULE_NAME) { var dt = HttpContext.Current.Session["vwSHORTCUTS_Menu_ByUser." + sMODULE_NAME + "." + Security.USER_ID] as DataTable; if (dt == null) { dt = new DataTable(); if (Security.IsAuthenticated()) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["_code_CRMCache_1304"].ToString(); oQuery.CommandText = innerSql; oQuery.Add("@MODULE_NAME", SqlDbType.VarChar, 100, sMODULE_NAME); oQuery.Add("@USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID); dt = oQuery.GetTable(); HttpContext.Current.Session["vwSHORTCUTS_Menu_ByUser." + sMODULE_NAME + "." + Security.USER_ID] = dt; } } return dt; }
private void UpdateContact(Guid gCONTACT_ID, bool bUpdateBilling, bool bUpdateShipping) { string innerSql = ApplicationSQL.SQL["Invoices_EditView_267"].ToString(); var oQuery = new InlineQueryDBManager(); oQuery.CommandText = innerSql; oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gCONTACT_ID); using (SqlDataReader rdr = oQuery.ExecuteReader(CommandBehavior.SingleRow)) { if (rdr.Read()) { if (bUpdateBilling) { new DynamicControl(this, "BILLING_CONTACT_ID").ID = CommonTypeConvert.ToGuid(rdr["ID"]); new DynamicControl(this, "BILLING_CONTACT_NAME").Text = CommonTypeConvert.ToString(rdr["NAME"]); } if (bUpdateShipping) { new DynamicControl(this, "SHIPPING_CONTACT_ID").ID = CommonTypeConvert.ToGuid(rdr["ID"]); new DynamicControl(this, "SHIPPING_CONTACT_NAME").Text = CommonTypeConvert.ToString(rdr["NAME"]); } Guid gACCOUNT_ID = CommonTypeConvert.ToGuid(rdr["ACCOUNT_ID"]); if (!CommonTypeConvert.IsEmptyGuid(gACCOUNT_ID)) { UpdateAccount(gACCOUNT_ID, bUpdateBilling, bUpdateShipping); } } } }
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; }
public static DataTable AssignedUser() { Cache Cache = HttpRuntime.Cache; bool bTeamFilter = !Security.IS_ADMIN && Config.enable_team_management(); string sCACHE_NAME = String.Empty; if (bTeamFilter) sCACHE_NAME = "vwTEAMS_ASSIGNED_TO." + Security.USER_ID; else sCACHE_NAME = "vwUSERS_ASSIGNED_TO"; var dt = Cache.Get(sCACHE_NAME) as DataTable; if (dt == null) { var oQuery = new InlineQueryDBManager(); string innerSql; if (bTeamFilter) { innerSql = ApplicationSQL.SQL["_code_CRMCache_256"].ToString(); } else { innerSql = "select ID " + ControlChars.CrLf + " , USER_NAME " + ControlChars.CrLf + " from vwUSERS_ASSIGNED_TO" + ControlChars.CrLf + " order by USER_NAME " + ControlChars.CrLf; } oQuery.CommandText = innerSql; if (bTeamFilter) oQuery.Add("@MEMBERSHIP_USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID); dt = oQuery.GetTable(); Cache.Insert(sCACHE_NAME, dt, null, DefaultCacheExpiration(), Cache.NoSlidingExpiration); } return dt; }
protected void Page_Load(object sender, EventArgs e) { SetPageTitle(Translation.GetTranslation.Term(".moduleList." + m_sMODULE)); Visible = (Security.GetUserAccess(m_sMODULE, "edit") >= 0); if (!Visible) return; gID = CommonTypeConvert.ToGuid(Request["ID"]); if (!IsPostBack) { ctlDynamicButtons.AppendButtons(m_sMODULE + ".EditView", Guid.Empty, null); Guid gDuplicateID = CommonTypeConvert.ToGuid(Request["DuplicateID"]); if (!CommonTypeConvert.IsEmptyGuid(gID) || !CommonTypeConvert.IsEmptyGuid(gDuplicateID)) { var oQuery = new InlineQueryDBManager(); string innerSql = ApplicationSQL.SQL["Administration_ProductTemplates_EditView"].ToString(); oQuery.CommandText = innerSql; if (!CommonTypeConvert.IsEmptyGuid(gDuplicateID)) { oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gDuplicateID); gID = Guid.Empty; } else { oQuery.Add("@ID", SqlDbType.UniqueIdentifier, gID); } using (SqlDataReader rdr = oQuery.ExecuteReader(CommandBehavior.SingleRow)) { if (rdr.Read()) { ctlModuleHeader.Title = CommonTypeConvert.ToString(rdr["NAME"]); SetPageTitle(Translation.GetTranslation.Term(".moduleList." + m_sMODULE) + " - " + ctlModuleHeader.Title); Utils.UpdateTracker(Page, m_sMODULE, gID, ctlModuleHeader.Title); ViewState["ctlModuleHeader.Title"] = ctlModuleHeader.Title; AppendEditViewFields(m_sMODULE + ".EditView", tblMain, rdr); } } } else { AppendEditViewFields(m_sMODULE + ".EditView", tblMain, null); } } else { ctlModuleHeader.Title = CommonTypeConvert.ToString(ViewState["ctlModuleHeader.Title"]); SetPageTitle(Translation.GetTranslation.Term(".moduleList." + m_sMODULE) + " - " + ctlModuleHeader.Title); } }