コード例 #1
0
        //public void ProcessFields2(DataRow dr, int col)
        public void ProcessFields2(int FieldID, int FieldLabelID, string FieldLabel, string FieldType, int PredecessorFieldID, int ParentFieldID,
                                   string StringValue, string FileValue, string OtherRef, string SelectedItemsIDs)
        {
            try
            {
                Field f = null;

                switch (FieldType)
                {
                case "tb":
                    f = new LabelTextBoxField(PanelIDString, FieldID, FieldLabel, StringValue);
                    break;

                case "rb":
                    f = new LabelRadioButtonFields(PanelIDString, FieldID.ToString(), FieldLabel);
                    ((LabelRadioButtonFields)f).RadioButtons.SetSelectedItems(SelectedItemsIDs);
                    break;

                case "cb":
                    f = new LabelCheckBoxFields(PanelIDString, FieldID.ToString(), FieldLabel);
                    ((LabelCheckBoxFields)f).CheckBoxes.SetSelectedItems(SelectedItemsIDs);
                    break;

                case "ddlb":
                    f = new LabelDropDownListBox(PanelIDString, FieldID.ToString(), FieldLabel);
                    ((LabelDropDownListBox)f).DropDown.SetSelectedItems(SelectedItemsIDs);
                    break;

                case "rb-item":
                case "cb-item":
                case "ddlb-item":
                    TempMultiSelectItem tmsi = new TempMultiSelectItem();
                    tmsi.StringValue = FieldLabel;
                    //tmsi.OtherRef = DBUtil.GetInt(dr, col + 8);
                    tmsi.ParentFieldID     = ParentFieldID.ToString();
                    tmsi.MultiSelectItemID = FieldID.ToString();

                    AllMultiSelectItem.Add(tmsi);
                    break;

                default:
                    break;
                }
                if (f != null)
                {
                    Fields.Add(f);
                }
            }
            catch (Exception e)
            {
                Console.Out.WriteLine(e.ToString());
            }
        }
コード例 #2
0
ファイル: Project.cs プロジェクト: msvarovsky/PDMSCore
        public void CreateNew()
        {
            // jdi do DB a vytvor novy projekt.
            //ID = (Int32)DateTime.Now.Ticks;
            //ID = DateTime.Now.Hour * 100000000 + DateTime.Now.Minute * 1000000 + DateTime.Now.Second * 10000 + DateTime.Now.Millisecond * 100;
            ProjectID = DateTime.Now.Millisecond * 100;

            Page.SideMenu.GetRandomMenu();
            List <Field> fields = new List <Field>();

            fields.Add(new LabelTextBoxField("1", ProjectID++, "Project name", "", "...", "Give your project a name."));
            fields.Add(new LabelTextAreaField("1", ProjectID++.ToString(), "Project description:"));
            //fields.Add(Field.NewLine());
            fields.Add(new NewLine());

            LabelDropDownListBox dd = new LabelDropDownListBox("1", ProjectID++.ToString(), "Project type:");

            dd.DropDown.AddItem("1", "Novy");
            dd.DropDown.AddItem("2", "Stary", true);
            dd.DropDown.AddItem("3", "Refresh");
            fields.Add(dd);

            LabelDropDownListBox dd2 = new LabelDropDownListBox("1", ProjectID++.ToString(), "pt:");

            dd2.DropDown.AddItem("1", "Novy");
            dd2.DropDown.AddItem("2", "Stary", true);
            dd2.DropDown.AddItem("3", "Refresh");
            fields.Add(dd2);


            fields.Add(new LabelDatePickerField("1", ProjectID++, "Creation date:", DateTime.Now));

            fields.Add(new LabelSelectableTextBoxField(ProjectID++, "Choose user:"******"...", "sp_AllUsers"));


            Panel panel = new Panel(1, "New project:", 2);

            panel.GenerateRandomPanelMenuItems(5);
            panel.Fields = fields;

            Page.Panels.PanelList.Add(panel);
            //PanelList.Add(panel);
        }
コード例 #3
0
        public void ProcessFields(DataRow dr, int col)
        {
            try
            {
                Field f = null;

                int    FieldID            = DBUtil.GetInt(dr, col);
                string Label              = DBUtil.GetString(dr, col + 1);
                int    PredecessorFieldID = DBUtil.GetInt(dr, col + 2);
                string FieldType          = DBUtil.GetString(dr, col + 3);

                string StringValue = DBUtil.GetString(dr, col + 5);

                switch (FieldType)
                {
                case "tb":
                    f = new LabelTextBoxField(PanelIDString, FieldID, Label, StringValue);
                    break;

                case "rb":
                    //f = new LabelRBCBControl<LabelRadioButtonField>(FieldID.ToString(), Label);
                    //((LabelRBCBControl<LabelRadioButtonField>)f).OtherRef = DBUtil.GetInt(dr, col+8);
                    //((LabelRBCBControl<LabelRadioButtonField>)f).SelectedValues = StringValue.Split(',');

                    //f = new LabelRBCBControl<RadioButtonField>(FieldID.ToString(), Label);
                    //((LabelRBCBControl<RadioButtonField>)f).RBCBControl.items.OtherRef = DBUtil.GetInt(dr, col + 8);
                    //((LabelRBCBControl<RadioButtonField>)f).RBCBControl.items.SelectedValues = StringValue.Split(',');

                    f = new LabelRadioButtonFields(PanelIDString, FieldID.ToString(), Label);
                    ((LabelRadioButtonFields)f).RadioButtons.SetSelectedItems(DBUtil.GetString(dr, col + 8));

                    break;

                case "cb":
                    //f = new LabelRBCBControl<LabelCheckBoxField>(FieldID.ToString(), Label);
                    //((LabelRBCBControl<LabelCheckBoxField>)f).OtherRef = DBUtil.GetInt(dr, col + 8);
                    //((LabelRBCBControl<LabelCheckBoxField>)f).SelectedValues = StringValue.Split(',');

                    //f = new LabelRBCBControl<CheckBoxField>(FieldID.ToString(), Label);
                    //((LabelRBCBControl<CheckBoxField>)f).RBCBControl.items.OtherRef = DBUtil.GetInt(dr, col + 8);
                    //((LabelRBCBControl<CheckBoxField>)f).RBCBControl.items.SelectedValues = StringValue.Split(',');

                    f = new LabelCheckBoxFields(PanelIDString, FieldID.ToString(), Label);
                    ((LabelCheckBoxFields)f).CheckBoxes.SetSelectedItems(DBUtil.GetString(dr, col + 8));

                    break;

                case "ddlb":
                    //f = new LabelDropDownField(FieldID, Label);
                    //((LabelDropDownField)f).Dropdown.OtherRef = DBUtil.GetInt(dr, col + 8);
                    //((LabelDropDownField)f).Dropdown.SelectedValues = StringValue.Split(',');

                    f = new LabelDropDownListBox(PanelIDString, FieldID.ToString(), Label);
                    ((LabelDropDownListBox)f).DropDown.SetSelectedItems(DBUtil.GetString(dr, col + 8));
                    break;

                case "rb-item":
                case "cb-item":
                case "ddlb-item":
                    TempMultiSelectItem tmsi = new TempMultiSelectItem();
                    tmsi.StringValue = Label;
                    //tmsi.OtherRef = DBUtil.GetInt(dr, col + 8);
                    tmsi.ParentFieldID     = DBUtil.GetString(dr, col + 4);
                    tmsi.MultiSelectItemID = FieldID.ToString();

                    AllMultiSelectItem.Add(tmsi);
                    break;

                default:
                    break;
                }
                if (f != null)
                {
                    Fields.Add(f);
                }
            }
            catch (Exception e)
            {
                Console.Out.WriteLine(e.ToString());
            }
        }
コード例 #4
0
ファイル: Project.cs プロジェクト: msvarovsky/PDMSCore
        public void GetRandom()
        {
            Page.SideMenu.GetRandomMenu();

            int  id         = 1;
            long randonName = DateTime.Now.Ticks;

            List <Field> fields = new List <Field>();

            //TextBoxField tb = new TextBoxField((randonName++).ToString(), "Pocet projektu", "5");

            fields.Add(new LabelField("Normalni text"));
            fields.Add(new NewLine());
            fields.Add(new LabelField("Bold text", true));
            fields.Add(new NewLine());

            fields.Add(LabelTextBoxField.GetRandom(id++));
            fields.Add(LabelTextAreaField.GetRandom(id++));
            fields.Add(new NewLine());

            fields.Add(LabelRadioButtonFields.GetRandom((id++).ToString(), 3));
            fields.Add(LabelRadioButtonFields.GetRandom((id++).ToString(), 4));

            fields.Add(LabelDropDownListBox.GetRandom(id++.ToString(), 4));
            fields.Add(LabelDatePickerField.GetRandom(id++));

            fields.Add(LabelFileUploadField.GetRandom());
            fields.Add(LabelFileUploadField.GetRandom(true));

            fields.Add(LabelFileDownloadField.GetRandom());


            /*fields.Add(LabelCheckBoxesControl.GetRandom(2));
             * fields.Add(LabelRadioButtonsControl.GetRandom(2));*/


            //fields.Add(new Field { Label = "Pocet projektu", tagName = 1, Type = FieldType.Indicator, Value = "5" });
            //fields.Add(new Field { Label = "Pocet otevrenych projektu", tagName = 2, Type = FieldType.Indicator, Value = "5" });

            Panel panel = new Panel(1, "GetRandom", 1);

            //panel.Content = fields;
            fields = new List <Field>();
            fields.Add(LabelTextBoxField.GetRandom(id++));
            panel.GenerateRandomPanelMenuItems(5);
            panel.Fields = fields;
            //ToShow.Add(panel);

            Panel        panel2  = new Panel(2, "Grid", 1);
            List <Field> fields2 = new List <Field>();

            fields2.Add(LabelTextBoxField.GetRandom(id++));
            fields2.Add(LabelDataGridField.GetRandom("Grid"));

            panel2.Fields = fields2;
            panel2.GenerateRandomPanelMenuItems(2);


            //PanelList.Add(panel);
            //PanelList.Add(panel2);
        }