protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int nACLACCESS_Delete = Security.GetUserAccess(m_sMODULE, "delete"); int nACLACCESS_Edit = Security.GetUserAccess(m_sMODULE, "edit"); btnDelete.Visible = (nACLACCESS_Delete >= 0); btnUpdate.Visible = (nACLACCESS_Edit >= 0); lstPAYMENT_TYPE.DataSource = CRMCache.List("payment_type_dom"); lstPAYMENT_TYPE.DataBind(); lstPAYMENT_TYPE.Items.Insert(0, new ListItem(Translation.GetTranslation.Term(".LBL_NONE"), "")); } }
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) { if (!IsPostBack) { int nACLACCESS_Delete = Security.GetUserAccess(m_sMODULE, "delete"); int nACLACCESS_Edit = Security.GetUserAccess(m_sMODULE, "edit"); btnDelete.Visible = (nACLACCESS_Delete >= 0); btnUpdate.Visible = (nACLACCESS_Edit >= 0); lstSTATUS.DataSource = CRMCache.List("product_status_dom"); lstSTATUS.DataBind(); lstSTATUS.Items.Insert(0, new ListItem(Translation.GetTranslation.Term(".LBL_NONE"), "")); lstTAX_CLASS.DataSource = CRMCache.List("tax_class_dom"); lstTAX_CLASS.DataBind(); lstTAX_CLASS.Items.Insert(0, new ListItem(Translation.GetTranslation.Term(".LBL_NONE"), "")); lstSUPPORT_TERM.DataSource = CRMCache.List("support_term_dom"); lstSUPPORT_TERM.DataBind(); lstSUPPORT_TERM.Items.Insert(0, new ListItem(Translation.GetTranslation.Term(".LBL_NONE"), "")); } }