private void BindRenderer()
        {
            FormDocumentData = null;
            try
            {
                FormDocumentData = FormDocument.Load(MetaClassName, FormName);

                if (FormDocumentData == null)
                {
                    FormDocumentData = FormController.ReCreateFormDocument(MetaClassName, FormName);
                }

                if (MetaUIManager.MetaUITypeIsSystem(FormDocumentData.MetaClassName, FormDocumentData.MetaUITypeId) ||
                    FormName == FormDocumentData.MetaUITypeId)
                {
                    lblFormName.Text = CHelper.GetFormName(FormName);
                }
                else
                {
                    lblFormName.Text = String.Format("{0} ({1})", CHelper.GetFormName(FormName), CHelper.GetFormName(FormDocumentData.MetaUITypeId));
                }
            }
            catch { }
            BindRendererInner();
        }
示例#2
0
        protected void grdMain_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            string id = e.CommandArgument.ToString();

            FormDocument fd = FormDocument.Load(mc.Name, id);

            fd.Delete();
            if (id == FormController.GeneralViewFormType || id == FormController.GeneralViewHistoryFormType)
            {
                MetaDataWrapper.RemoveClassAttribute(mc, "HasCompositePage");
            }

            CHelper.RequireDataBind();
        }
示例#3
0
        protected void grdMain_RowCommand(object source, DataGridCommandEventArgs e)
        {
            if (e == null)
            {
                return;
            }

            if (e.CommandName == deleteCommand)
            {
                string       id = e.CommandArgument.ToString();
                FormDocument fd = FormDocument.Load(mc.Name, id);
                fd.Delete();
                if (id == FormController.GeneralViewFormType || id == FormController.GeneralViewHistoryFormType)
                {
                    MetaDataWrapper.RemoveClassAttribute(mc, "HasCompositePage");
                }
            }
            else if (e.CommandName == resetCommand)
            {
                string       id = e.CommandArgument.ToString();
                FormDocument fd = FormDocument.Load(mc.Name, id);
                fd.Delete();
            }
            else if (e.CommandName == recreateCommand)
            {
                string id = e.CommandArgument.ToString();

                FormDocument fd = FormDocument.Load(mc.Name, id);

                if (fd != null)
                {
                    fd = FormController.ReCreateFormDocument(mc.Name, fd.Name);

                    //ListApp Fix
                    if (ListManager.MetaClassIsList(mc.Name) && fd.FormTable.Rows[0].Cells[0].Sections.Count > 0)
                    {
                        fd.FormTable.Rows[0].Cells[0].Sections[0].BorderType = (int)BorderType.None;
                        fd.FormTable.Rows[0].Cells[0].Sections[0].ShowLabel  = false;
                    }
                }
            }

            CHelper.RequireDataBind();
        }
        //#region SaveXml
        //protected void btnSave2_Click(object sender, EventArgs e)
        //{
        //    FormDocumentData.LoadFormTableFromXml(txtXml.Text);
        //    fRenderer.FormDocumentData = FormDocumentData;
        //    fRenderer.DataBind();
        //}
        //#endregion


        #region CreateDocument
        private void CreateDocument()
        {
            FormTable tL = new FormTable();

            tL.Columns     = "50%;*";
            tL.Width       = "100%";
            tL.CellPadding = 5;

            FormRow  row1   = new FormRow();
            FormCell cell11 = new FormCell();

            cell11.ColSpan = 2;
            cell11.Name    = "cell_11";
            row1.Cells.Add(cell11);
            tL.Rows.Add(row1);

            FormRow  row2   = new FormRow();
            FormCell cell21 = new FormCell();
            FormCell cell22 = new FormCell();

            cell21.ColSpan = 1;
            cell22.ColSpan = 1;
            cell21.Name    = "cell_21";
            cell22.Name    = "cell_22";
            row2.Cells.Add(cell21);
            row2.Cells.Add(cell22);
            tL.Rows.Add(row2);

            FormRow  row3   = new FormRow();
            FormCell cell31 = new FormCell();

            cell31.ColSpan = 2;
            cell31.Name    = "cell_31";
            row3.Cells.Add(cell31);
            tL.Rows.Add(row3);

            FormSection sec1 = new FormSection();

            sec1.BorderType = 1;
            sec1.ItemIndex  = 1;
            sec1.ShowLabel  = true;
            sec1.Uid        = "dd6acdd98240403984e561399d33d9a9";
            sec1.Labels.Add(new FormLabel("Sec1", Thread.CurrentThread.CurrentUICulture.Name));
            cell11.Sections.Add(sec1);

            FormSection sec2 = new FormSection();

            sec2.BorderType = 0;
            sec2.ItemIndex  = 1;
            sec2.ShowLabel  = true;
            sec2.Uid        = "886cb9a3aae34e68ac8ef234d0ce8ce2";
            sec2.Labels.Add(new FormLabel("Sec2", Thread.CurrentThread.CurrentUICulture.Name));
            cell21.Sections.Add(sec2);

            FormSection sec3 = new FormSection();

            sec3.BorderType = 0;
            sec3.ItemIndex  = 1;
            sec3.ShowLabel  = true;
            sec3.Uid        = "bb6acbb98240403784e561397b33d7a7";
            sec3.Labels.Add(new FormLabel("Sec3", Thread.CurrentThread.CurrentUICulture.Name));
            cell22.Sections.Add(sec3);

            FormSection sec4 = new FormSection();

            sec4.BorderType = 0;
            sec4.ItemIndex  = 1;
            sec4.ShowLabel  = true;
            sec4.Uid        = Guid.NewGuid().ToString("N");
            sec4.Labels.Add(new FormLabel("Sec4", Thread.CurrentThread.CurrentUICulture.Name));
            cell31.Sections.Add(sec4);

            FormControl ctrl1 = new FormControl(FormController.SmartTableLayoutType);

            ctrl1.Columns     = "50%;*";
            ctrl1.Width       = "100%";
            ctrl1.CellPadding = 5;

            FormItem item1 = new FormItem();

            item1.LabelWidth = "120px";
            item1.ShowLabel  = true;
            item1.Labels.Add(new FormLabel("test label1:", Thread.CurrentThread.CurrentUICulture.Name));
            item1.Uid       = "9b3c4642e59b405faa2a1f38559a06cc";
            item1.RowIndex  = 1;
            item1.CellIndex = 1;
            item1.RowSpan   = 1;
            item1.ColSpan   = 2;
            FormControl item1c = new FormControl(FormController.MetaPrimitiveControlType);

            item1c.Uid    = Guid.NewGuid().ToString("N");
            item1c.Source = "Title";
            item1.Control = item1c;
            ctrl1.Items.Add(item1);

            FormItem item2 = new FormItem();

            item2.LabelWidth = "120px";
            item2.ShowLabel  = true;
            item2.Labels.Add(new FormLabel("test label2:", Thread.CurrentThread.CurrentUICulture.Name));
            item2.Uid       = "cafa725a31b74ad6a069e3b6446d89c0";
            item2.RowIndex  = 2;
            item2.CellIndex = 1;
            item2.RowSpan   = 1;
            item2.ColSpan   = 1;
            FormControl item2c = new FormControl(FormController.MetaPrimitiveControlType);

            item2c.Uid    = Guid.NewGuid().ToString("N");
            item2c.Source = "Priority";
            item2.Control = item2c;
            ctrl1.Items.Add(item2);

            FormItem item3 = new FormItem();

            item3.LabelWidth = "120px";
            item3.ShowLabel  = true;
            item3.Labels.Add(new FormLabel("test label3:", Thread.CurrentThread.CurrentUICulture.Name));
            item3.Uid       = "8d36be893c3f4cf1b5295be6853eb246";
            item3.RowIndex  = 3;
            item3.CellIndex = 1;
            item3.RowSpan   = 1;
            item3.ColSpan   = 1;
            FormControl item3c = new FormControl(FormController.MetaPrimitiveControlType);

            item3c.Uid    = Guid.NewGuid().ToString("N");
            item3c.Source = "Created";
            item3.Control = item3c;
            ctrl1.Items.Add(item3);

            FormItem item4 = new FormItem();

            item4.LabelWidth = "120px";
            item4.ShowLabel  = true;
            item4.Labels.Add(new FormLabel("test label4:", Thread.CurrentThread.CurrentUICulture.Name));
            item4.Uid       = "a5d87024cbf849cea5d273d77a292e6f";
            item4.RowIndex  = 2;
            item4.CellIndex = 2;
            item4.RowSpan   = 2;
            item4.ColSpan   = 1;
            FormControl item4c = new FormControl(FormController.MetaPrimitiveControlType);

            item4c.Uid    = Guid.NewGuid().ToString("N");
            item4c.Source = "Description";
            item4.Control = item4c;
            ctrl1.Items.Add(item4);

            sec1.Control = ctrl1;

            //FormDocument fd = new FormDocument();
            FormDocument fd = FormDocument.Load("Task", "[MC_BaseForm]");

            fd.MetaClassName = "Task";
            fd.Name          = "[MC_BaseForm]";
            fd.FormTable     = tL;
            fd.Save();
        }