Beispiel #1
0
    private void getTypes()
    {
        tblItemTypes types = new tblItemTypes();

        types.LoadAll();

        do
        {
            DropDownList1.Items.Add(new ListItem(types.ItemTypeTitle, types.ItemTypeId.ToString()));
        } while (types.MoveNext());
    }
Beispiel #2
0
    private void getTypes()
    {
        tblItemTypes types = new tblItemTypes();
        types.LoadAll();

        do
        {
            DropDownList1.Items.Add(new ListItem(types.ItemTypeTitle, types.ItemTypeId.ToString()));
        } while (types.MoveNext());
    }
Beispiel #3
0
    public void LoadItem(int itemId)
    {
        _itemId = itemId;

        tblItems item = new tblItems();
        item.LoadByPrimaryKey(itemId);

        tblItemTypes type = new tblItemTypes();
        type.LoadByPrimaryKey(item.ItemTypeId);

        lbItemName.Text = item.ItemTitle;
        if ((int)UserContext.GetContextItemAsInt("userlevel") == 1)
            lbItemName.Text += "[" + item.ItemId.ToString() + "]";

        _itemTypeTitle = type.ItemTypeTitle;
        switch (_itemTypeTitle)
        {
            case "epicCMSRichTextControl":
              // cmsTextEditControl edit = new adm
                admin_controls_cmsTextEditControl txt = (admin_controls_cmsTextEditControl)Page.LoadControl("~/admin/controls/cmsTextEditControl.ascx");
                txt.ItemId = itemId;
                PlaceHolder1.Controls.Add(txt);

                lbApprove.Visible = false;
                    lbReject.Visible = false;
                    if (txt.IsTemp())
                    {
                        if ((int)UserContext.GetContextItemAsInt("userlevel") > 2)
                        {
                            Label1.Visible = false;
                        }
                        else
                        {
                            tblItemFieldsXValue val = new tblItemFieldsXValue();
                            val.Where.ItemId.Value = _itemId;
                            val.Where.ItemFieldId.Value = 7;
                            val.Where.LanguageId.Value = int.Parse(Request["langId"]);

                            val.Query.Load();

                            //if (val.ItemFieldStringTempId > -1)
                            //{
                            //    lbApprove.Visible = true;
                            //    lbReject.Visible = true;
                            //}
                        }
                    }
                break;
            case "epicCMSTextControl":
                admin_controls_cmsBasicTextEditControl txt4 = (admin_controls_cmsBasicTextEditControl)Page.LoadControl("~/admin/controls/cmsBasicTextEditControl.ascx");
                txt4.ItemId = itemId;
                PlaceHolder1.Controls.Add(txt4);

                lbApprove.Visible = false;
                lbReject.Visible = false;
                if (txt4.IsTemp())
                {
                    if ((int)UserContext.GetContextItemAsInt("userlevel") > 2)
                    {
                        Label1.Visible = false;
                    }
                    else
                    {
                        tblItemFieldsXValue val = new tblItemFieldsXValue();
                        val.Where.ItemId.Value = _itemId;
                        val.Where.ItemFieldId.Value = 7;
                        val.Where.LanguageId.Value = int.Parse(Request["langId"]);

                        val.Query.Load();

                        //if (val.ItemFieldStringTempId > -1)
                        //{
                        //    lbApprove.Visible = true;
                        //    lbReject.Visible = true;
                        //}
                    }
                }
                break;
            case "epicCMSImageControl":
               //admin_controls_cmsImageEditControl img = (admin_controls_cmsImageEditControl)Page.LoadControl("~/admin/controls/cmsImageEditControl.ascx");
                admin_controls_cmsSelectImage img = (admin_controls_cmsSelectImage)Page.LoadControl("~/admin/controls/cmsSelectImage.ascx");
               img.ItemId = itemId;
                PlaceHolder1.Controls.Add(img);

                lbApprove.Visible = false;
                lbReject.Visible = false;
                if (img.IsTemp())
                {
                    if ((int)UserContext.GetContextItemAsInt("userlevel") > 2)
                    {
                        Label1.Visible = false;
                    }
                    else
                    {
                         tblItemFieldsXValue val = new tblItemFieldsXValue();
                         val.Where.ItemId.Value = _itemId;
                         val.Where.ItemFieldId.Value = 3;
                         val.Where.LanguageId.Value = int.Parse(Request["langId"]);

                         val.Query.Load();

                         //if (val.ItemFieldStringTempId > -1)
                         //{
                         //lbApprove.Visible = true;
                         // lbReject.Visible = true;
                         //}
                    }
                }
                break;
            case "epicCMSPDFControl":
                admin_controls_cmsPDFEditControl img2 = (admin_controls_cmsPDFEditControl)Page.LoadControl("~/admin/controls/cmsPDFEditControl.ascx");
                admin_controls_cmsSelectPdf pdf = (admin_controls_cmsSelectPdf)Page.LoadControl("~/admin/controls/cmsSelectPDF.ascx");
                img2.ItemId = itemId;
                pdf.ItemId = itemId;
                PlaceHolder1.Controls.Add(pdf);

                lbApprove.Visible = false;
                lbReject.Visible = false;
                if (pdf.IsTemp())
                {
                    if ((int)UserContext.GetContextItemAsInt("userlevel") > 2)
                    {
                        Label1.Visible = false;
                    }
                    //else
                    //{
                    //    lbApprove.Visible = true;
                    //    lbReject.Visible = true;
                    //}
                }
                break;
            case "epicCMSImageTextControl":
                admin_controls_cmsTextImageEditControl te = (admin_controls_cmsTextImageEditControl)Page.LoadControl("~/admin/controls/cmsTextImageEditControl.ascx");
                te.ItemId = itemId;
                PlaceHolder1.Controls.Add(te);
                break;

        }
        if (ConfigurationManager.AppSettings["usesApprovals"] != "true")
        {
            lbApprove.Visible = false;
            lbReject.Visible = false;
        }
    }
Beispiel #4
0
    public void LoadItem(int itemId)
    {
        _itemId = itemId;

        tblItems item = new tblItems();

        item.LoadByPrimaryKey(itemId);

        tblItemTypes type = new tblItemTypes();

        type.LoadByPrimaryKey(item.ItemTypeId);

        lbItemName.Text = item.ItemTitle;
        if ((int)UserContext.GetContextItemAsInt("userlevel") == 1)
        {
            lbItemName.Text += "[" + item.ItemId.ToString() + "]";
        }

        _itemTypeTitle = type.ItemTypeTitle;
        switch (_itemTypeTitle)
        {
        case "epicCMSRichTextControl":
            // cmsTextEditControl edit = new adm
            admin_controls_cmsTextEditControl txt = (admin_controls_cmsTextEditControl)Page.LoadControl("~/admin/controls/cmsTextEditControl.ascx");
            txt.ItemId = itemId;
            PlaceHolder1.Controls.Add(txt);

            lbApprove.Visible = false;
            lbReject.Visible  = false;
            if (txt.IsTemp())
            {
                if ((int)UserContext.GetContextItemAsInt("userlevel") > 2)
                {
                    Label1.Visible = false;
                }
                else
                {
                    tblItemFieldsXValue val = new tblItemFieldsXValue();
                    val.Where.ItemId.Value      = _itemId;
                    val.Where.ItemFieldId.Value = 7;
                    val.Where.LanguageId.Value  = int.Parse(Request["langId"]);

                    val.Query.Load();

                    //if (val.ItemFieldStringTempId > -1)
                    //{
                    //    lbApprove.Visible = true;
                    //    lbReject.Visible = true;
                    //}
                }
            }
            break;

        case "epicCMSTextControl":
            admin_controls_cmsBasicTextEditControl txt4 = (admin_controls_cmsBasicTextEditControl)Page.LoadControl("~/admin/controls/cmsBasicTextEditControl.ascx");
            txt4.ItemId = itemId;
            PlaceHolder1.Controls.Add(txt4);

            lbApprove.Visible = false;
            lbReject.Visible  = false;
            if (txt4.IsTemp())
            {
                if ((int)UserContext.GetContextItemAsInt("userlevel") > 2)
                {
                    Label1.Visible = false;
                }
                else
                {
                    tblItemFieldsXValue val = new tblItemFieldsXValue();
                    val.Where.ItemId.Value      = _itemId;
                    val.Where.ItemFieldId.Value = 7;
                    val.Where.LanguageId.Value  = int.Parse(Request["langId"]);

                    val.Query.Load();

                    //if (val.ItemFieldStringTempId > -1)
                    //{
                    //    lbApprove.Visible = true;
                    //    lbReject.Visible = true;
                    //}
                }
            }
            break;

        case "epicCMSImageControl":
            //admin_controls_cmsImageEditControl img = (admin_controls_cmsImageEditControl)Page.LoadControl("~/admin/controls/cmsImageEditControl.ascx");
            admin_controls_cmsSelectImage img = (admin_controls_cmsSelectImage)Page.LoadControl("~/admin/controls/cmsSelectImage.ascx");
            img.ItemId = itemId;
            PlaceHolder1.Controls.Add(img);

            lbApprove.Visible = false;
            lbReject.Visible  = false;
            if (img.IsTemp())
            {
                if ((int)UserContext.GetContextItemAsInt("userlevel") > 2)
                {
                    Label1.Visible = false;
                }
                else
                {
                    tblItemFieldsXValue val = new tblItemFieldsXValue();
                    val.Where.ItemId.Value      = _itemId;
                    val.Where.ItemFieldId.Value = 3;
                    val.Where.LanguageId.Value  = int.Parse(Request["langId"]);

                    val.Query.Load();

                    //if (val.ItemFieldStringTempId > -1)
                    //{
                    //lbApprove.Visible = true;
                    // lbReject.Visible = true;
                    //}
                }
            }
            break;

        case "epicCMSPDFControl":
            admin_controls_cmsPDFEditControl img2 = (admin_controls_cmsPDFEditControl)Page.LoadControl("~/admin/controls/cmsPDFEditControl.ascx");
            admin_controls_cmsSelectPdf      pdf  = (admin_controls_cmsSelectPdf)Page.LoadControl("~/admin/controls/cmsSelectPDF.ascx");
            img2.ItemId = itemId;
            pdf.ItemId  = itemId;
            PlaceHolder1.Controls.Add(pdf);

            lbApprove.Visible = false;
            lbReject.Visible  = false;
            if (pdf.IsTemp())
            {
                if ((int)UserContext.GetContextItemAsInt("userlevel") > 2)
                {
                    Label1.Visible = false;
                }
                //else
                //{
                //    lbApprove.Visible = true;
                //    lbReject.Visible = true;
                //}
            }
            break;

        case "epicCMSImageTextControl":
            admin_controls_cmsTextImageEditControl te = (admin_controls_cmsTextImageEditControl)Page.LoadControl("~/admin/controls/cmsTextImageEditControl.ascx");
            te.ItemId = itemId;
            PlaceHolder1.Controls.Add(te);
            break;
        }
        if (ConfigurationManager.AppSettings["usesApprovals"] != "true")
        {
            lbApprove.Visible = false;
            lbReject.Visible  = false;
        }
    }