public static void populateDropdown(Combobox a)
 {
 }
Beispiel #2
0
 public JsonResult Status()
 {
     return(Json(Combobox.Listar(typeof(Status))));
 }
Beispiel #3
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginUser loginUser = new LoginUser(context, "EnforcementName");
                if (!loginUser.Pass)//权限验证
                {
                    return;
                }

                EnforcementNameBLL bll = new EnforcementNameBLL(context, loginUser);
                if (context.Request["action"] == "gridLoad")
                {
                    //加载DataGrid
                    int    page = int.Parse(context.Request["page"]);
                    int    rows = int.Parse(context.Request["rows"]);
                    string EnforcementNameId = context.Request["EnforcementNameId"];
                    string EnforcementName   = context.Request["EnforcementName"];

                    string EnforcementTypeId = context.Request["EnforcementTypeId"];
                    bll.LoadGrid(page, rows, EnforcementNameId, EnforcementName, EnforcementTypeId);
                }
                else if (context.Request["action"] == "EnforcementTypeListLoad")
                {
                    Combobox com = new Combobox(context, loginUser);
                    com.EnforcementTypeCombobox();
                }
                else if (context.Request["action"] == "TemplateListLoad")
                {
                    Combobox com = new Combobox(context, loginUser);
                    com.EnforcementTemplateCombobox();
                }



                else if (context.Request["action"] == "load")
                {
                    //加载信息
                    bll.Load(context.Request["EnforcementNameId"]);
                }
                else if (context.Request["action"] == "add")
                {
                    //增加
                    TBEnforcementName tbEnforcementName = new TBEnforcementName();
                    //   tbEnforcementName.EnforcementNameId = context.Request["EnforcementNameId"];
                    tbEnforcementName.EnforcementName   = context.Request["EnforcementName"];
                    tbEnforcementName.EnforcementTypeId = context.Request["EnforcementTypeId"];
                    //    tbEnforcementName.FillingTime = context.Request["FillingTime"];
                    //    tbEnforcementName.FillingPerson = context.Request["FillPerson"];
                    tbEnforcementName.IsEmpty = context.Request["IsEmpty"];
                    tbEnforcementName.F1      = context.Request["F1"];
                    tbEnforcementName.EnforcementTemplateId = context.Request["EnforcementTemplateId"];

                    bll.Add(tbEnforcementName);
                }
                else if (context.Request["action"] == "edit")
                {
                    //修改
                    TBEnforcementName tbEnforcementName = new TBEnforcementName();
                    tbEnforcementName.EnforcementNameId = context.Request["EnforcementNameId"];
                    tbEnforcementName.EnforcementName   = context.Request["EnforcementName"];
                    tbEnforcementName.EnforcementTypeId = context.Request["EnforcementTypeId"];
                    tbEnforcementName.FillingTime       = context.Request["FillingTime"];
                    tbEnforcementName.FillingPerson     = context.Request["FillingPerson"];
                    tbEnforcementName.IsEmpty           = context.Request["IsEmpty"];
                    tbEnforcementName.F1 = context.Request["F1"];

                    bll.Edit(tbEnforcementName);
                }

                else if (context.Request["action"] == "delete")
                {
                    //删除
                    string EnforcementNameId = context.Request["EnforcementNameId"];
                    bll.Delete(EnforcementNameId);
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }
Beispiel #4
0
        public SplitScreen(BaseScreenComponent manager) : base(manager)
        {
            Background = new BorderBrush(Color.Gray);                               //Hintergrundfarbe festlegen

            Button backButton = Button.TextButton(manager, "Back");                 //Neuen TextButton erzeugen

            backButton.HorizontalAlignment = HorizontalAlignment.Left;              //Links
            backButton.VerticalAlignment   = VerticalAlignment.Top;                 //Oben
            backButton.LeftMouseClick     += (s, e) => { manager.NavigateBack(); }; //KlickEvent festlegen
            Controls.Add(backButton);                                               //Button zum Screen hinzufügen



            //ScrollContainer
            ScrollContainer scrollContainer = new ScrollContainer(manager)  //Neuen ScrollContainer erzeugen
            {
                VerticalAlignment   = VerticalAlignment.Stretch,            // 100% Höhe
                HorizontalAlignment = HorizontalAlignment.Stretch           //100% Breite
            };

            Controls.Add(scrollContainer);                                  //ScrollContainer zum Root(Screen) hinzufügen



            //Stackpanel - SubControls werden Horizontal oder Vertikal gestackt
            StackPanel panel = new StackPanel(manager);                 //Neues Stackpanel erzeugen

            panel.VerticalAlignment = VerticalAlignment.Stretch;        //100% Höhe
            scrollContainer.Content = panel;                            //Ein Scroll Container kann nur ein Control beherbergen
            panel.ControlSpacing    = 20;

            //Label
            Label label = new Label(manager)
            {
                Text = "Control Showcase"
            };                                                              //Neues Label erzeugen

            panel.Controls.Add(label);                                      //Label zu Panel hinzufügen

            Button tB = Button.TextButton(manager, "TEST");

            tB.Background = new TextureBrush(LoadTexture2DFromFile("./test_texture_round.png", manager.GraphicsDevice), TextureBrushMode.Stretch);
            panel.Controls.Add(tB);

            //Button
            Button button = Button.TextButton(manager, "Dummy Button"); //Neuen TextButton erzeugen

            panel.Controls.Add(button);                                 //Button zu Panel hinzufügen

            //Progressbar
            ProgressBar pr = new ProgressBar(manager)                   //Neue ProgressBar erzeugen
            {
                Value  = 99,                                            //Aktueller Wert
                Height = 20,                                            //Höhe
                Width  = 200                                            //Breite
            };

            panel.Controls.Add(pr);                                     //ProgressBar zu Panel hinzufügen

            //ListBox
            Listbox <string> list = new Listbox <string>(manager);      //Neue ListBox erstellen

            list.TemplateGenerator = (item) =>                          //Template Generator festlegen
            {
                return(new Label(manager)
                {
                    Text = item
                });                                                     //Control (Label) erstellen
            };
            panel.Controls.Add(list);                                   //Liste zu Panel hinzufügen

            list.Items.Add("Hallo");                                    //Items zur Liste hinzufügen
            list.Items.Add("Welt");                                     //...

            //Combobox
            Combobox <string> combobox = new Combobox <string>(manager) //Neue Combobox erstellen
            {
                Height = 20,                                            //Höhe 20
                Width  = 100                                            //Breite 100
            };

            combobox.TemplateGenerator = (item) =>                      //Template Generator festlegen
            {
                return(new Label(manager)
                {
                    Text = item
                });                                                     //Control (Label) erstellen
            };
            panel.Controls.Add(combobox);                               //Combobox zu Panel  hinzufügen

            combobox.Items.Add("Combobox");                             //Items zu Combobox hinzufügen
            combobox.Items.Add("Item");
            combobox.Items.Add("Hallo");


            Button clearCombobox = Button.TextButton(manager, "Clear Combobox");

            clearCombobox.LeftMouseClick += (s, e) => {
                combobox.Items.Clear();
                list.Items.Clear();
            };
            panel.Controls.Add(clearCombobox);

            //Slider Value Label
            Label labelSliderHorizontal = new Label(manager);

            //Horizontaler Slider
            Slider sliderHorizontal = new Slider(manager)
            {
                Width  = 150,
                Height = 20,
            };

            sliderHorizontal.ValueChanged += (value) => { labelSliderHorizontal.Text = "Value: " + value; }; //Event on Value Changed
            panel.Controls.Add(sliderHorizontal);
            labelSliderHorizontal.Text = "Value: " + sliderHorizontal.Value;                                 //Set Text initially
            panel.Controls.Add(labelSliderHorizontal);

            //Slider Value Label
            Label labelSliderVertical = new Label(manager);

            //Vertikaler Slider
            Slider sliderVertical = new Slider(manager)
            {
                Range       = 100,
                Height      = 200,
                Width       = 20,
                Orientation = Orientation.Vertical
            };

            sliderVertical.ValueChanged += (value) => { labelSliderVertical.Text = "Value: " + value; };
            panel.Controls.Add(sliderVertical);
            labelSliderVertical.Text = "Value: " + sliderVertical.Value;
            panel.Controls.Add(labelSliderVertical);

            Checkbox checkbox = new Checkbox(manager);

            panel.Controls.Add(checkbox);


            //Textbox
            textbox = new Textbox(manager)                              //Neue TextBox erzeugen
            {
                Background          = new BorderBrush(Color.LightGray), //Festlegen eines Backgrounds für ein Control
                HorizontalAlignment = HorizontalAlignment.Stretch,      //100% Breite
                Text     = "TEXTBOX!",                                  //Voreingestellter text
                MinWidth = 100                                          //Eine Textbox kann ihre Größe automatisch anpassen
            };

            Button clearTextbox = new Button(manager);

            clearTextbox.LeftMouseClick += (s, e) =>
            {
                textbox.SelectionStart = 0;
                textbox.Text           = "";
            };
            panel.Controls.Add(clearTextbox);
            panel.Controls.Add(textbox);                                //Textbox zu Panel hinzufügen
        }
 public PengajuanProposalController(DBINTEGRASI_MASTER_BAYUPPKU2Context context, Combobox combobox)
 {
     _context  = context;
     _combobox = combobox;
 }
Beispiel #6
0
 public void cargar()
 {
     _objViewModel = new Combobox();
     SourceContext();
     InitialOperations();
 }
Beispiel #7
0
        public CreateCharTradeGump(PlayerMobile character, ProfessionInfo profession) : base(0, 0)
        {
            _character = character;

            foreach (Skill skill in _character.Skills)
            {
                skill.ValueFixed = 0;
                skill.BaseFixed  = 0;
                skill.CapFixed   = 0;
                skill.Lock       = Lock.Locked;
            }

            Add
            (
                new ResizePic(2600)
            {
                X = 100, Y = 80, Width = 470, Height = 372
            }
            );

            // center menu with fancy top
            // public GumpPic(AControl parent, int x, int y, int gumpID, int hue)
            Add(new GumpPic(291, 42, 0x0589, 0));
            Add(new GumpPic(214, 58, 0x058B, 0));
            Add(new GumpPic(300, 51, 0x15A9, 0));

            bool isAsianLang = string.Compare(Settings.GlobalSettings.Language, "CHT", StringComparison.InvariantCultureIgnoreCase) == 0 ||
                               string.Compare(Settings.GlobalSettings.Language, "KOR", StringComparison.InvariantCultureIgnoreCase) == 0 ||
                               string.Compare(Settings.GlobalSettings.Language, "JPN", StringComparison.InvariantCultureIgnoreCase) == 0;

            bool   unicode = isAsianLang;
            byte   font    = (byte)(isAsianLang ? 1 : 2);
            ushort hue     = (ushort)(isAsianLang ? 0xFFFF : 0x0386);

            // title text
            //TextLabelAscii(AControl parent, int x, int y, int font, int hue, string text, int width = 400)
            Add
            (
                new Label(ClilocLoader.Instance.GetString(3000326), unicode, hue, font: font)
            {
                X = 148, Y = 132
            }
            );

            // strength, dexterity, intelligence
            Add
            (
                new Label(ClilocLoader.Instance.GetString(3000111), unicode, 1, font: 1)
            {
                X = 158, Y = 170
            }
            );

            Add
            (
                new Label(ClilocLoader.Instance.GetString(3000112), unicode, 1, font: 1)
            {
                X = 158, Y = 250
            }
            );

            Add
            (
                new Label(ClilocLoader.Instance.GetString(3000113), unicode, 1, font: 1)
            {
                X = 158, Y = 330
            }
            );

            // sliders for attributes
            _attributeSliders = new HSliderBar[3];

            Add
            (
                _attributeSliders[0] = new HSliderBar
                                       (
                    164,
                    196,
                    93,
                    10,
                    60,
                    ProfessionInfo._VoidStats[0],
                    HSliderBarStyle.MetalWidgetRecessedBar,
                    true
                                       )
            );

            Add
            (
                _attributeSliders[1] = new HSliderBar
                                       (
                    164,
                    276,
                    93,
                    10,
                    60,
                    ProfessionInfo._VoidStats[1],
                    HSliderBarStyle.MetalWidgetRecessedBar,
                    true
                                       )
            );

            Add
            (
                _attributeSliders[2] = new HSliderBar
                                       (
                    164,
                    356,
                    93,
                    10,
                    60,
                    ProfessionInfo._VoidStats[2],
                    HSliderBarStyle.MetalWidgetRecessedBar,
                    true
                                       )
            );

            string[] skillList = new string[SkillsLoader.Instance.SortedSkills.Count];

            for (int i = 0; i < skillList.Length; ++i)
            {
                SkillEntry entry = SkillsLoader.Instance.SortedSkills[i];

                if ((World.ClientFeatures.Flags & CharacterListFlags.CLF_SAMURAI_NINJA) == 0 && (entry.Index == 52 || entry.Index == 47 || entry.Index == 53) || entry.Index == 54)
                {
                    skillList[i] = string.Empty;
                }
                else
                {
                    skillList[i] = entry.Name;
                }
            }


            int y = 172;

            _skillSliders = new HSliderBar[CharCreationGump._skillsCount];
            _skills       = new Combobox[CharCreationGump._skillsCount];

            for (int i = 0; i < CharCreationGump._skillsCount; i++)
            {
                Add
                (
                    _skills[i] = new Combobox
                                 (
                        344,
                        y,
                        182,
                        skillList,
                        -1,
                        200,
                        false,
                        "Click here"
                                 )
                );

                Add
                (
                    _skillSliders[i] = new HSliderBar
                                       (
                        344,
                        y + 32,
                        93,
                        0,
                        50,
                        ProfessionInfo._VoidSkills[i, 1],
                        HSliderBarStyle.MetalWidgetRecessedBar,
                        true
                                       )
                );

                y += 70;
            }

            Add
            (
                new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2)
            {
                X = 586, Y = 445, ButtonAction = ButtonAction.Activate
            }
            );

            Add
            (
                new Button((int)Buttons.Next, 0x15A4, 0x15A6, 0x15A5)
            {
                X = 610, Y = 445, ButtonAction = ButtonAction.Activate
            }
            );

            for (int i = 0; i < _attributeSliders.Length; i++)
            {
                for (int j = 0; j < _attributeSliders.Length; j++)
                {
                    if (i != j)
                    {
                        _attributeSliders[i].AddParisSlider(_attributeSliders[j]);
                    }
                }
            }

            for (int i = 0; i < _skillSliders.Length; i++)
            {
                for (int j = 0; j < _skillSliders.Length; j++)
                {
                    if (i != j)
                    {
                        _skillSliders[i].AddParisSlider(_skillSliders[j]);
                    }
                }
            }
        }
Beispiel #8
0
        public void ProcessRequest(HttpContext context)
        {
            LoginUser       loginUser = new LoginUser(context, "WinPrizeReport");
            LotteryOrderBLL bll       = new LotteryOrderBLL(context, loginUser);

            //加载DataGrid
            if (context.Request["action"] == "gridLoad")
            {
                int    page        = int.Parse(context.Request["page"]);
                int    rows        = int.Parse(context.Request["rows"]);
                string startDate   = context.Request["startDate"];
                string endDate     = context.Request["endDate"];
                string city        = context.Request["cityId"];
                string county      = context.Request["countyId"];
                string siteId      = context.Request["siteId"];
                string terminalId  = context.Request["terminalId"];
                string lotteryType = context.Request["lotteryType"];
                string gameId      = context.Request["gameId"];
                bll.WinPrizeDataLoadGrid(page, rows, startDate, endDate, city, county, siteId, terminalId, lotteryType, gameId);
            }
            if (context.Request["action"] == "totalFee")
            {
                string startDate   = context.Request["startDate"];
                string endDate     = context.Request["endDate"];
                string city        = context.Request["cityId"];
                string county      = context.Request["countyId"];
                string siteId      = context.Request["siteId"];
                string terminalId  = context.Request["terminalId"];
                string lotteryType = context.Request["lotteryType"];
                string gameId      = context.Request["gameId"];
                context.Response.Write(bll.GetTotalWinPrize(startDate, endDate, city, county, siteId, terminalId, lotteryType, gameId));
            }
            //加载市
            if (context.Request["action"] == "cityListLoad")
            {
                Combobox com = new Combobox(context, loginUser);
                com.CityCombobox();
            }
            //加载区县
            if (context.Request["action"] == "countyListLoad")
            {
                string   cityId = context.Request["cityId"];
                Combobox com    = new Combobox(context, loginUser);
                com.CountyCombobox(cityId);
            }
            //加载执法文书类型
            if (context.Request["action"] == "siteListLoad")
            {
                Combobox com      = new Combobox(context, loginUser);
                string   cityId   = context.Request["cityId"];
                string   countyId = context.Request["countyId"];
                com.SiteByAreaCombobox(cityId, countyId);
            }
            //加载彩种
            if (context.Request["action"] == "lotteryTypeListLoad")
            {
                Combobox com = new Combobox(context, loginUser);
                com.LotteryTypeCombobox();
            }
            //加载游戏
            if (context.Request["action"] == "gameListLoad")
            {
                Combobox com = new Combobox(context, loginUser);
                com.GameCombobox();
            }
            if (context.Request["action"] == "ToExcel")
            {
                string startDate   = context.Request["startDate"];
                string endDate     = context.Request["endDate"];
                string city        = context.Request["cityId"];
                string county      = context.Request["countyId"];
                string siteId      = context.Request["siteId"];
                string terminalId  = context.Request["terminalId"];
                string lotteryType = context.Request["lotteryType"];
                string gameId      = context.Request["gameId"];

                DataTable dt        = bll.WinPrizeDataReport(startDate, endDate, city, county, siteId, terminalId, lotteryType, gameId);
                object    sumObject = dt.Compute("sum(awardmoney)", "TRUE");
                context.Response.ContentType = "application/x-excel";
                string fileName = HttpUtility.UrlEncode(startDate + "至" + endDate + "中奖数据报表.xls");
                context.Response.AddHeader("Content-Disposition", "attachment; fileName=" + fileName);
                IWorkbook workbook = new HSSFWorkbook();
                //创建表
                ISheet sheet = workbook.CreateSheet("中奖数据报表");
                //设置单元的宽度
                sheet.SetColumnWidth(0, 10 * 256);
                sheet.SetColumnWidth(1, 10 * 256);
                sheet.SetColumnWidth(2, 15 * 256);
                sheet.SetColumnWidth(3, 10 * 256);
                sheet.SetColumnWidth(4, 13 * 256);
                sheet.SetColumnWidth(5, 10 * 256);
                sheet.SetColumnWidth(6, 10 * 256);
                sheet.SetColumnWidth(7, 13 * 256);
                sheet.SetColumnWidth(8, 20 * 256);
                sheet.SetColumnWidth(9, 30 * 256);
                sheet.SetColumnWidth(10, 15 * 256);
                #region 合并单元格
                CellRangeAddress regionTitle = new CellRangeAddress(0, 0, 0, 10);
                sheet.AddMergedRegion(regionTitle);
                CellRangeAddress regionDate = new CellRangeAddress(1, 1, 0, 10);
                sheet.AddMergedRegion(regionDate);

                CellRangeAddress regionSearch = new CellRangeAddress(2, 2, 0, 10);
                sheet.AddMergedRegion(regionSearch);

                //CellRangeAddress()该方法的参数次序是:开始行号,结束行号,开始列号,结束列号。

                IRow row0 = sheet.CreateRow(0);
                row0.Height = 20 * 20;
                ICell icell1top0 = row0.CreateCell(0);
                icell1top0.SetCellValue("中奖数据报表");
                NOPIHelper.RegionMethod(workbook, sheet, regionTitle, NOPIHelper.Stylexls.标题);
                IRow row1 = sheet.CreateRow(1);
                row1.Height = 20 * 20;
                ICell icell1top1 = row1.CreateCell(0);
                icell1top1.SetCellValue("日期:" + startDate + "至" + endDate + " 中奖总额:" + double.Parse(sumObject == DBNull.Value ? "0" : sumObject.ToString()).ToString("¥#,##0.00") + "");
                NOPIHelper.RegionMethod(workbook, sheet, regionDate, NOPIHelper.Stylexls.头);

                IRow row2 = sheet.CreateRow(2);
                row2.Height = 20 * 20;
                ICell icell1top2 = row2.CreateCell(0);

                var        cityName    = "";
                var        countyName  = "";
                var        siteName    = "";
                var        lotteryName = "";
                var        gameName    = "";
                SiteBLL    siteBLL     = new SiteBLL(context, loginUser);
                AreaBLL    areaBLL     = new AreaBLL(context, loginUser);
                LotteryBLL lotteryBLL  = new LotteryBLL(context, loginUser);
                GameBLL    gameBLL     = new GameBLL(context, loginUser);
                if (!string.IsNullOrEmpty(siteId))
                {
                    siteName = siteBLL.Get(siteId).siteName;
                }
                if (!string.IsNullOrEmpty(city))
                {
                    cityName = areaBLL.Get(city).areaName;
                }
                if (!string.IsNullOrEmpty(county))
                {
                    countyName = areaBLL.Get(county).areaName;
                }
                if (!string.IsNullOrEmpty(lotteryType))
                {
                    lotteryName = lotteryBLL.Get(lotteryType).LotteryTypeName;
                }
                if (!string.IsNullOrEmpty(gameId))
                {
                    gameName = gameBLL.Get(gameId).gameName;
                }

                icell1top2.SetCellValue("市:" + cityName + " 区县:" + countyName + " 执法文书类型:" + siteName + " 终端号:" + terminalId + " 彩种:" + lotteryName + " 游戏:" + gameName + "");//搜索条件
                NOPIHelper.RegionMethod(workbook, sheet, regionSearch, NOPIHelper.Stylexls.头);
                #endregion
                #region 设置表头
                int  rowsNum = 3; //行号
                IRow row3    = sheet.CreateRow(rowsNum);
                row3.Height = 20 * 20;

                ICell icell1top = row3.CreateCell(0);
                icell1top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头);
                icell1top.SetCellValue("市");

                ICell icell2top = row3.CreateCell(1);
                icell2top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头);
                icell2top.SetCellValue("区(县)");

                ICell icell3top = row3.CreateCell(2);
                icell3top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头);
                icell3top.SetCellValue("执法文书类型名称");

                ICell icell4top = row3.CreateCell(3);
                icell4top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头);
                icell4top.SetCellValue("终端号");

                ICell icell5top = row3.CreateCell(4);
                icell5top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头);
                icell5top.SetCellValue("客户编号");

                ICell icell6top = row3.CreateCell(5);
                icell6top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头);
                icell6top.SetCellValue("彩种");

                ICell icell7top = row3.CreateCell(6);
                icell7top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头);
                icell7top.SetCellValue("游戏");

                ICell icell8top = row3.CreateCell(7);
                icell8top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头);
                icell8top.SetCellValue("期次");

                ICell icell9top = row3.CreateCell(8);
                icell9top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头);
                icell9top.SetCellValue("交易时间");

                ICell icell10top = row3.CreateCell(9);
                icell10top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头);
                icell10top.SetCellValue("订单号");

                ICell icell11top = row3.CreateCell(10);
                icell11top.CellStyle = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.头);
                icell11top.SetCellValue("中奖金额");

                #endregion

                rowsNum = 4;  //行号
                ICellStyle cellStyleMoney   = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.钱);
                ICellStyle cellStyleTime    = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.时间);
                ICellStyle cellStyleDefault = NOPIHelper.Getcellstyle(workbook, NOPIHelper.Stylexls.默认);

                foreach (DataRow dr in dt.Rows)
                {
                    /******************写入字段值*********************/
                    row3 = sheet.CreateRow(rowsNum);
                    ICell icel1City = row3.CreateCell(0);
                    icel1City.SetCellValue(dr["city"].ToString());
                    icel1City.CellStyle = cellStyleDefault;

                    ICell icellCounty = row3.CreateCell(1);
                    icellCounty.SetCellValue(dr["county"].ToString());
                    icellCounty.CellStyle = cellStyleDefault;

                    ICell icellSiteName = row3.CreateCell(2);
                    icellSiteName.SetCellValue(dr["siteName"].ToString());
                    icellSiteName.CellStyle = cellStyleDefault;

                    ICell icel1TerminalId = row3.CreateCell(3);
                    icel1TerminalId.SetCellValue(dr["terminalId"].ToString());
                    icel1TerminalId.CellStyle = cellStyleDefault;

                    ICell icel1ClientId = row3.CreateCell(4);
                    icel1ClientId.SetCellValue(dr["clientId"].ToString());
                    icel1ClientId.CellStyle = cellStyleDefault;

                    ICell icel1LotteryType = row3.CreateCell(5);
                    icel1LotteryType.SetCellValue(dr["lotteryType"].ToString());
                    icel1LotteryType.CellStyle = cellStyleDefault;

                    ICell icel1GameId = row3.CreateCell(6);
                    icel1GameId.SetCellValue(dr["gameId"].ToString());
                    icel1GameId.CellStyle = cellStyleDefault;

                    ICell icel1Period = row3.CreateCell(7);
                    icel1Period.SetCellValue(dr["period"].ToString());
                    icel1Period.CellStyle = cellStyleDefault;

                    ICell icel1AwardTime = row3.CreateCell(8);
                    icel1AwardTime.SetCellValue(dr["awardtime"].ToString());
                    icel1AwardTime.CellStyle = cellStyleTime;

                    ICell icel1OrderId = row3.CreateCell(9);
                    icel1OrderId.SetCellValue(dr["orderid"].ToString());
                    icel1OrderId.CellStyle = cellStyleDefault;

                    ICell icel1AwardMoney = row3.CreateCell(10);
                    icel1AwardMoney.SetCellValue(double.Parse(dr["awardmoney"].ToString()));
                    icel1AwardMoney.CellStyle = cellStyleMoney;

                    rowsNum++;
                }
                workbook.Write(context.Response.OutputStream);  //输出到流中
            }
        }
Beispiel #9
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginUser loginUser = new LoginUser(context, "LotteryOrder");
                if (!loginUser.Pass)//权限验证
                {
                    return;
                }

                //加载DataGrid
                if (context.Request["action"] == "gridLoad")
                {
                    LotteryOrderBLL bll             = new LotteryOrderBLL(context, loginUser);
                    int             page            = int.Parse(context.Request["page"]);
                    int             rows            = int.Parse(context.Request["rows"]);
                    string          orderId         = context.Request["orderId"];     //订单号
                    string          period          = context.Request["period"];      //期次
                    string          orderStatus     = context.Request["orderStatus"]; //订单状态
                    string          awardResult     = context.Request["awardResult"]; //中奖状态
                    string          srcType         = context.Request["srcType"];     //来源方式
                    string          clientQuery     = context.Request["clientQuery"];
                    string          clientQueryText = context.Request["clientQueryText"];
                    string          startDate       = context.Request["startDate"];
                    string          endDate         = context.Request["endDate"];
                    bll.LoadGrid(page, rows, "", "", orderId, period, orderStatus, awardResult, srcType, clientQuery, clientQueryText, startDate, endDate);
                    return;
                }
                //用户查找分类
                if (context.Request["action"] == "clientQueryListLoad")
                {
                    Combobox com = new Combobox(context, loginUser);
                    com.ClientQueryCombobox();
                }
                //订单状态下拉框信息
                if (context.Request["action"] == "ddlOrderStatusLoad")
                {
                    Combobox com = new Combobox(context, loginUser);
                    com.OrderStatusCombobox();
                    return;
                }
                //中奖状态下拉框信息
                if (context.Request["action"] == "ddlAwardResultLoad")
                {
                    Combobox com = new Combobox(context, loginUser);
                    com.AwardResultCombobox();
                    return;
                }
                //来源方式下拉框信息
                if (context.Request["action"] == "ddlSrcTypeLoad")
                {
                    Combobox com = new Combobox(context, loginUser);
                    com.SrcTypeCombobox();
                    return;
                }

                //加载信息
                if (context.Request["action"] == "load")
                {
                    LotteryOrderBLL bll     = new LotteryOrderBLL(context, loginUser);
                    string          orderId = context.Request["orderId"];//订单号
                    bll.Load(orderId);
                    return;
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }
Beispiel #10
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginUser loginUser = new LoginUser(context, "AddCase");
                if (!loginUser.Pass)//权限验证
                {
                    return;
                }

                CaseBLL bll = new CaseBLL(context, loginUser);
                if (context.Request["action"] == "carGridLoad")
                {
                    //加载DataGrid
                    int    page        = int.Parse(context.Request["page"]);
                    int    rows        = int.Parse(context.Request["rows"]);
                    string stationName = context.Request["stationName"];
                    string carNo       = context.Request["carNo"];
                    string fromDate    = context.Request["fromDate"];
                    string toDate      = context.Request["toDate"];
                    string axialType   = context.Request["axialType"];
                    bll.LoadCarGrid(page, rows, stationName, carNo, fromDate, toDate, axialType);
                }
                else if (context.Request["action"] == "stationListLoad")
                {
                    Combobox com = new Combobox(context, loginUser);
                    com.StationCombobox();
                }
                else if (context.Request["action"] == "load")
                {
                    var carNo       = context.Request["carNo"];
                    var stationName = context.Request["stationName"];
                    //加载信息
                    bll.Load(carNo, stationName);
                }
                else if (context.Request["action"] == "add")
                {
                    //增加
                    TBCase tbCase = new TBCase();
                    tbCase.CaseId                                     = context.Request["CaseId"];//
                    tbCase.CaseReason                                 = context.Request["CaseReason"];
                    tbCase.CaseFrom                                   = context.Request["CaseFrom"];
                    tbCase.CasePersonName                             = context.Request["CasePersonName"];
                    tbCase.CasePersonSex                              = context.Request["CasePersonSex"];                              //
                    tbCase.CasePersonAge                              = context.Request["CasePersonAge"];                              //
                    tbCase.CasePersonAddress                          = context.Request["CasePersonAddress"];                          //
                    tbCase.CasePersonRepresentative                   = context.Request["CasePersonRepresentative"];                   //
                    tbCase.CasePersonCompanyName                      = context.Request["CasePersonCompanyName"];                      //
                    tbCase.CasePersonCompanyLegalPerson               = context.Request["CasePersonCompanyLegalPerson"];               //
                    tbCase.CasePersonCompanyLegalRepresentative       = context.Request["CasePersonCompanyLegalRepresentative"];       //
                    tbCase.CasePersonCompanyLegalAgent                = context.Request["CasePersonCompanyLegalAgent"];                //
                    tbCase.CaseOpenDate                               = context.Request["CaseOpenDate"];                               //
                    tbCase.CaseCloseDate                              = context.Request["CaseCloseDate"];                              //
                    tbCase.CaseFillingDate                            = context.Request["CaseFillingDate"];                            //
                    tbCase.CaseExpirationDate                         = context.Request["CaseExpirationDate"];                         //
                    tbCase.CaseExecutive                              = context.Request["CaseExecutive"];                              //
                    tbCase.StationName                                = context.Request["StationName"];                                //
                    tbCase.CaseProcessPersonOne                       = context.Request["CaseProcessPersonOne"];                       //
                    tbCase.CaseProcessPersonOneEnforcementNumberOne   = context.Request["CaseProcessPersonOneEnforcementNumberOne"];   //
                    tbCase.CaseProcessPersonTwo                       = context.Request["CaseProcessPersonTwo"];                       //
                    tbCase.CaseProcessPersonOneEnforcementNumberTwo   = context.Request["CaseProcessPersonOneEnforcementNumberTwo"];   //
                    tbCase.CaseProcessPersonThree                     = context.Request["CaseProcessPersonThree"];                     //
                    tbCase.CaseProcessPersonOneEnforcementNumberThree = context.Request["CaseProcessPersonOneEnforcementNumberThree"]; //
                    tbCase.CaseCarNo                                  = context.Request["CaseCarNo"];
                    tbCase.CaseResult                                 = context.Request["CaseResult"];                                 //
                    //tbCase.CaseTypeName = context.Request["caseType"];//

                    tbCase.CaseTypeName   = context.Request["caseType"];
                    tbCase.CaseStateName  = "立案";                    //
                    tbCase.CreateDate     = DateTime.Now.ToString(); //
                    tbCase.CreateUserName = loginUser.UserName;      //
                    bll.Add(tbCase);
                }
                else if (context.Request["action"] == "edit")
                {
                    //修改
                    TBEnforcementName tbEnforcementName = new TBEnforcementName();
                    tbEnforcementName.EnforcementNameId = context.Request["EnforcementNameId"];
                    tbEnforcementName.EnforcementName   = context.Request["EnforcementName"];
                    tbEnforcementName.EnforcementTypeId = context.Request["EnforcementTypeId"];
                    tbEnforcementName.FillingTime       = context.Request["FillingTime"];
                    tbEnforcementName.FillingPerson     = context.Request["FillingPerson"];
                    tbEnforcementName.IsEmpty           = context.Request["IsEmpty"];
                    tbEnforcementName.F1 = context.Request["F1"];

                    // bll.Edit(tbEnforcementName);
                }

                else if (context.Request["action"] == "delete")
                {
                    //删除
                    string EnforcementNameId = context.Request["EnforcementNameId"];
                    bll.Delete(EnforcementNameId);
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }
Beispiel #11
0
        public CreateCharTradeGump(PlayerMobile character) : base(0, 0)
        {
            _character = character;

            foreach (var skill in _character.Skills)
            {
                _character.UpdateSkill(skill.Index, 0, 0, Data.Lock.Locked, 0);
            }

            AddChildren(new ResizePic(2600)
            {
                X = 100, Y = 80, Width = 470, Height = 372
            });

            // center menu with fancy top
            // public GumpPic(AControl parent, int x, int y, int gumpID, int hue)
            AddChildren(new GumpPic(291, 42, 0x0589, 0));
            AddChildren(new GumpPic(214, 58, 0x058B, 0));
            AddChildren(new GumpPic(300, 51, 0x15A9, 0));

            // title text
            //TextLabelAscii(AControl parent, int x, int y, int font, int hue, string text, int width = 400)
            AddChildren(new Label(IO.Resources.Cliloc.GetString(3000326), false, 0x0386, font: 2)
            {
                X = 148, Y = 132
            });

            // strength, dexterity, intelligence
            AddChildren(new Label(IO.Resources.Cliloc.GetString(3000111), false, 1, font: 1)
            {
                X = 158, Y = 170
            });
            AddChildren(new Label(IO.Resources.Cliloc.GetString(3000112), false, 1, font: 1)
            {
                X = 158, Y = 250
            });
            AddChildren(new Label(IO.Resources.Cliloc.GetString(3000113), false, 1, font: 1)
            {
                X = 158, Y = 330
            });

            // sliders for attributes
            _attributeSliders = new HSliderBar[3];
            var values = FileManager.ClientVersion >= ClientVersions.CV_70160 ? 15 : 10;

            AddChildren(_attributeSliders[0] = new HSliderBar(164, 196, 93, 10, 60, 60, HSliderBarStyle.MetalWidgetRecessedBar, true));
            AddChildren(_attributeSliders[1] = new HSliderBar(164, 276, 93, 10, 60, values, HSliderBarStyle.MetalWidgetRecessedBar, true));
            AddChildren(_attributeSliders[2] = new HSliderBar(164, 356, 93, 10, 60, values, HSliderBarStyle.MetalWidgetRecessedBar, true));

            var skillCount   = 3;
            var initialValue = 50;

            if (FileManager.ClientVersion >= ClientVersions.CV_70160)
            {
                skillCount   = 4;
                initialValue = 30;
            }

            string[] skillList = IO.Resources.Skills.SkillNames;
            int      y         = 172;

            _skillSliders = new HSliderBar[skillCount];
            _skills       = new Combobox[skillCount];

            for (var i = 0; i < skillCount; i++)
            {
                if (FileManager.ClientVersion < ClientVersions.CV_70160 && i == 2)
                {
                    initialValue = 0;
                }

                AddChildren(_skills[i]       = new Combobox(344, y, 182, skillList, -1, 200, false, "Click here"));
                AddChildren(_skillSliders[i] = new HSliderBar(344, y + 32, 93, 0, 50, initialValue, HSliderBarStyle.MetalWidgetRecessedBar, true));

                y += 70;
            }

            AddChildren(new Button((int)Buttons.Prev, 0x15A1, 0x15A3, over: 0x15A2)
            {
                X = 586, Y = 445, ButtonAction = ButtonAction.Activate
            });
            AddChildren(new Button((int)Buttons.Next, 0x15A4, 0x15A6, over: 0x15A5)
            {
                X = 610, Y = 445, ButtonAction = ButtonAction.Activate
            });

            for (int i = 0; i < _attributeSliders.Length; i++)
            {
                for (int j = 0; j < _attributeSliders.Length; j++)
                {
                    if (i != j)
                    {
                        _attributeSliders[i].AddParisSlider(_attributeSliders[j]);
                    }
                }
            }

            for (int i = 0; i < _skillSliders.Length; i++)
            {
                for (int j = 0; j < _skillSliders.Length; j++)
                {
                    if (i != j)
                    {
                        _skillSliders[i].AddParisSlider(_skillSliders[j]);
                    }
                }
            }
        }
Beispiel #12
0
 public PopulationAndProductionWindow(IScreen screen, IWindowFinder windowFinder, IInputDevice inputDevice, IOCRReader ocr, ISettingsStore settings)
     : base("Population and Production", screen, windowFinder, inputDevice, settings)
 {
     ResearchTable = new Datagrid(this, inputDevice, ocr, 406, 613, new [] { 406, 687, 754, 776 })
     {
         LineHeight            = 16,
         TopOfCharactersOffset = 3,
         Settings = PrintSettings.NewResearchTable
     };
     AvailableScientistsTable = new Datagrid(this, inputDevice, ocr, 406, 613, new[] { 790, 909, 1056, 1184 })
     {
         LineHeight            = 16,
         TopOfCharactersOffset = 3,
         Settings = PrintSettings.AvailableScientistTable
     };
     ConstructionOptions = new Datagrid(this, inputDevice, ocr, 245, 669, new [] { 398, 599 })
     {
         LineHeight            = 16,
         TopOfCharactersOffset = 3
     };
     AllocatedLabs = new Textbox(this, inputDevice, ocr, left: 885, right: 929, top: 357, bottom: 371)
     {
         CharacterOffset = 3,
         CharacterHeight = 9,
         Colors          = new[] { new byte[] { 0, 0, 0 } }
     };
     AvailableLabs = new Textbox(this, inputDevice, ocr, left: 1037, right: 1073, top: 357, bottom: 371)
     {
         CharacterOffset = 3,
         CharacterHeight = 9,
         Colors          = new[] { new byte[] { 109, 109, 109 } }
     };
     NumberOfIndustrialProject = new Textbox(this, inputDevice, ocr, left: 725, right: 769, top: 696, bottom: 710)
     {
         CharacterOffset = 3,
         CharacterHeight = 9,
         Colors          = new[] { new byte[] { 0, 0, 0 } }
     };
     CreateIndustrialProject = new Button(this, inputDevice, left: 635, right: 707, top: 730, bottom: 754);
     InstallationType        = new Combobox(this, inputDevice, ocr, left: 501, right: 801, top: 180, bottom: 196)
     {
         CharacterOffset = 4,
         CharacterHeight = 9,
         Colors          = new[] { new byte[] { 0, 0, 0 } }
     };
     ContractAmount = new Textbox(this, inputDevice, ocr, left: 501, right: 553, top: 220, bottom: 234)
     {
         CharacterOffset = 3,
         CharacterHeight = 9,
         Colors          = new[] { new byte[] { 0, 0, 0 } }
     };
     CivilianContractSupply = new RadioButton(this, inputDevice, left: 696, right: 707, top: 220, bottom: 231);
     CivilianContractDemand = new RadioButton(this, inputDevice, left: 784, right: 795, top: 221, bottom: 232);
     AddCivilianContract    = new Button(this, inputDevice, left: 411, right: 491, top: 514, bottom: 538);
     Populations            = new TreeList(this, inputDevice, ocr, left: 21, right: 361, top: 100, bottom: 807);
     Populations.Refresh   += (sender, args) =>
     {
         MakeActive();
         Empire.SelectOption(1);
     };
     PurchaseMineralOutput = new RadioButton(this, inputDevice, left: 536, right: 547, top: 804, bottom: 815);
     MassDriverDestination = new Combobox(this, inputDevice, ocr, left: 1005, right: 1184, top: 156, bottom: 172)
     {
         CharacterOffset = 4,
         CharacterHeight = 9,
         Colors          = new[] { new byte[] { 0, 0, 0 } }
     };
     Empire = new Combobox(this, inputDevice, ocr, left: 19, right: 363, top: 46, bottom: 66)
     {
         CharacterOffset = 6,
         CharacterHeight = 11,
         Colors          = new[] { new byte[] { 0, 0, 0 } }
     };
     CurrentResearchProject = new Datagrid(this, inputDevice, ocr, 193, 289, new[] { 399, 632, 799, 859, 929, 999, 1132, 1158 })
     {
         LineHeight            = 16,
         TopOfCharactersOffset = 3
     };
     RemoveRL               = new Button(this, inputDevice, left: 683, right: 763, top: 299, bottom: 323);
     AddRL                  = new Button(this, inputDevice, left: 587, right: 667, top: 299, bottom: 323);
     NumberOfLabs           = new Label(this, inputDevice, ocr, left: 515, right: 541, top: 140, bottom: 148);
     MatchingScientistsOnly = new RadioButton(this, inputDevice, left: 740, right: 750, top: 362, bottom: 372);
 }
Beispiel #13
0
 public DaftarPublikasiController(DBINTEGRASI_MASTER_BAYUPPKU2Context context, Combobox combobox, PublikasiRepo repo)
 {
     _context  = context;
     _combobox = combobox;
     _repo     = repo;
 }
Beispiel #14
0
        protected override void CreateScene()
        {
            mLog = LogManager.Singleton.createLog("DemoCEGUI.log", false, true);
            mLog.LogMessage("My new Log. Hells yeah!");

            base.mSceneManager.AmbientLight = Color.FromArgb(125, 125, 125, 125);
            base.mSceneManager.SetSkyDome(true, "Examples/CloudySky", 5, 8);

            mGuiRenderer = new OgreCEGUIRenderer(base.mRenderWindow,
                                                 (byte)RenderQueueGroupID.RENDER_QUEUE_OVERLAY, false, 3000, mSceneManager);
            mGuiRenderer.Initialise();
            mGuiSystem = new GuiSystem(mGuiRenderer);
            //mGuiSystem = GuiSystem.CreateGuiSystemSpecial(mGuiRenderer);

            Logger.Instance.setLoggingLevel(LoggingLevel.Informative);

            SchemeManager.Instance.LoadScheme("TaharezLookSkin.scheme");
            mGuiSystem.SetDefaultMouseCursor("TaharezLook", "MouseArrow");
            mGuiSystem.DefaultFontName = "BlueHighway-12";

            mBackgroundWindow   = WindowManager.Instance.CreateWindow("DefaultWindow", "BackgroundWindow");
            mGuiSystem.GUISheet = mBackgroundWindow;

            mEditorWindow = WindowManager.Instance.CreateWindow("TaharezLook/FrameWindow", "TestWindow");
            mBackgroundWindow.AddChildWindow(mEditorWindow);
            mEditorWindow.SetSize(0.9f, 0.9f);
            mEditorWindow.SetPosition(0.05f, 0.05f);
            mEditorWindow.Text = "CeguiDotNet Demo";
            mEditorWindow.SubscribeEvents();

            mQuitButton      = WindowManager.Instance.CreatePushButton("TaharezLook/Button", "QuitButton");
            mQuitButton.Text = "Quit";
            mQuitButton.SetPosition(0.1f, 0.15f);
            mQuitButton.SetSize(0.8f, 0.15f);
            mQuitButton.SubscribeEvents();
            mQuitButton.Clicked += new WindowEventDelegate(QuitClicked);
            mEditorWindow.AddChildWindow(mQuitButton);

            mEditbox      = WindowManager.Instance.CreateEditbox("TaharezLook/Editbox", "Editbox");
            mEditbox.Text = "Editbox";
            mEditbox.SetPosition(0.1f, 0.32f);
            mEditbox.SetSize(0.8f, 0.15f);
            mEditbox.setReadOnly(false);
            mEditbox.SubscribeEvents();
            mEditbox.KeyDown += new CeguiDotNet.KeyEventDelegate(this.UsernameCharacterKey);
            mEditorWindow.AddChildWindow(mEditbox);

            mCombobox = WindowManager.Instance.CreateCombobox("TaharezLook/Combobox", "Combobox");
            mCombobox.SetPosition(0.1f, 0.49f);
            mCombobox.SetSize(0.8f, 0.25f);
            mCombobox.setReadOnly(false);
            mCombobox.SubscribeEvents();
            mCombobox.ListSelectionChanged += new WindowEventDelegate(this.combobox_SelectionChanged);
            mCombobox.TextAccepted         += new WindowEventDelegate(this.combobox_TextAccepted);
            mEditorWindow.AddChildWindow(mCombobox);

            mCboItem1 = new ListboxTextItem("Item 1", 0, IntPtr.Zero, false, true);
            mCboItem1.setAutoDeleted(false);
            mCombobox.addItem(mCboItem1);
            mCboItem2 = new ListboxTextItem("Item 2", 1, IntPtr.Zero, false, true);
            mCboItem2.setAutoDeleted(false);
            mCombobox.addItem(mCboItem2);
            mCboItem3 = new ListboxTextItem("Item 3", 2, IntPtr.Zero, false, true);
            mCboItem3.setAutoDeleted(false);
            mCombobox.addItem(mCboItem3);
            mCboItem4 = new ListboxTextItem("Item 4", 3, IntPtr.Zero, false, true);
            mCboItem4.setAutoDeleted(false);
            mCombobox.addItem(mCboItem4);

            mEditorWindow.Show();
        }
        private void HandleGenreChange()
        {
            RaceType race = _characterInfo.Race;

            CurrentOption[Layer.Beard] = 0;
            CurrentOption[Layer.Hair]  = 1;

            if (_paperDoll != null)
            {
                Remove(_paperDoll);
            }

            if (_hairCombobox != null)
            {
                Remove(_hairCombobox);
                Remove(_hairLabel);
            }

            if (_facialCombobox != null)
            {
                Remove(_facialCombobox);
                Remove(_facialLabel);
            }

            foreach (CustomColorPicker customPicker in Children.OfType <CustomColorPicker>().ToList())
            {
                Remove(customPicker);
            }

            // Hair
            CharacterCreationValues.ComboContent content = CharacterCreationValues.GetHairComboContent(_characterInfo.IsFemale, race);

            Add
            (
                _hairLabel = new Label(ClilocLoader.Instance.GetString(race == RaceType.GARGOYLE ? 1112309 : 3000121), false, 0, font: 9)
            {
                X = 98, Y = 142
            },
                1
            );

            Add
            (
                _hairCombobox = new Combobox
                                (
                    97,
                    155,
                    120,
                    content.Labels,
                    CurrentOption[Layer.Hair]
                                ),
                1
            );

            _hairCombobox.OnOptionSelected += Hair_OnOptionSelected;

            // Facial Hair
            if (!_characterInfo.IsFemale && race != RaceType.ELF)
            {
                content = CharacterCreationValues.GetFacialHairComboContent(race);

                Add
                (
                    _facialLabel = new Label(ClilocLoader.Instance.GetString(race == RaceType.GARGOYLE ? 1112511 : 3000122), false, 0, font: 9)
                {
                    X = 98, Y = 186
                },
                    1
                );

                Add
                (
                    _facialCombobox = new Combobox
                                      (
                        97,
                        199,
                        120,
                        content.Labels,
                        CurrentOption[Layer.Beard]
                                      ),
                    1
                );

                _facialCombobox.OnOptionSelected += Facial_OnOptionSelected;
            }
            else
            {
                _facialCombobox = null;
                _facialLabel    = null;
            }

            // Skin
            ushort[] pallet = CharacterCreationValues.GetSkinPallet(race);

            AddCustomColorPicker
            (
                489,
                141,
                pallet,
                Layer.Invalid,
                3000183,
                8,
                pallet.Length >> 3
            );

            // Shirt Color
            AddCustomColorPicker
            (
                489,
                183,
                null,
                Layer.Shirt,
                3000440,
                10,
                20
            );

            // Pants Color
            if (race != RaceType.GARGOYLE)
            {
                AddCustomColorPicker
                (
                    489,
                    225,
                    null,
                    Layer.Pants,
                    3000441,
                    10,
                    20
                );
            }

            // Hair
            pallet = CharacterCreationValues.GetHairPallet(race);

            AddCustomColorPicker
            (
                489,
                267,
                pallet,
                Layer.Hair,
                race == RaceType.GARGOYLE ? 1112322 : 3000184,
                8,
                pallet.Length >> 3
            );

            if (!_characterInfo.IsFemale && race != RaceType.ELF)
            {
                // Facial
                pallet = CharacterCreationValues.GetHairPallet(race);

                AddCustomColorPicker
                (
                    489,
                    309,
                    pallet,
                    Layer.Beard,
                    race == RaceType.GARGOYLE ? 1112512 : 3000446,
                    8,
                    pallet.Length >> 3
                );
            }

            CreateCharacter(_characterInfo.IsFemale, race);

            UpdateEquipments();

            Add
            (
                _paperDoll = new PaperDollInteractable(262, 135, _character, null)
            {
                AcceptMouseInput = false
            },
                1
            );

            _paperDoll.Update();
        }
Beispiel #16
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginUser        loginUser = new LoginUser(context, "AgentRecharge");
                AgentPreRechgBLL bll       = new AgentPreRechgBLL(context, loginUser);
                if (!loginUser.Pass)//权限验证
                {
                    return;
                }

                //加载DataGrid
                if (context.Request["action"] == "gridLoad")
                {
                    int    page        = int.Parse(context.Request["page"]);
                    int    rows        = int.Parse(context.Request["rows"]);
                    string agentId     = context.Request["agentId"];
                    string auditStatus = context.Request["auditStatus"];
                    string startDate   = context.Request["startDate"];
                    string endDate     = context.Request["endDate"];
                    bll.LoadGrid(page, rows, agentId, auditStatus, startDate, endDate);
                    return;
                }
                if (context.Request["action"] == "load")
                {
                    //加载信息
                    bll.Load(long.Parse(context.Request["flowId"]));
                }
                if (context.Request["action"] == "handleModeListLoad")
                {
                    Combobox com = new Combobox(context, loginUser);
                    com.HandleModeCombobox();
                }

                //审核
                if (context.Request["action"] == "audit")
                {
                    AgentRechargeBLL agentRechargeBLL = new AgentRechargeBLL(context, loginUser);
                    long             flowId           = long.Parse(context.Request["flowId"]);
                    string           remark           = context.Request["remark"];
                    TTAgentPreRechg  ttAgentPreRechg  = bll.Get(flowId);//预审
                    ttAgentPreRechg.auditStatus = context.Request["auditStatus"];
                    if (ttAgentPreRechg.auditStatus == "1")
                    {
                        TTAgentRecharge ttAgentRecharge = new TTAgentRecharge();       //充值明细
                        ttAgentRecharge.agentId       = ttAgentPreRechg.agentId;       //代理商编号
                        ttAgentRecharge.fee           = ttAgentPreRechg.fee;           //发生金额
                        ttAgentRecharge.operatorId    = loginUser.UserId;              //操作人编号
                        ttAgentRecharge.operatorName  = loginUser.UserName;            //操作人名称
                        ttAgentRecharge.handleMode    = ttAgentPreRechg.handleMode;    //充值方式
                        ttAgentRecharge.bankAccountId = ttAgentPreRechg.bankAccountId; //银行账号
                        ttAgentRecharge.bankFlowId    = ttAgentPreRechg.bankFlowId;    //银行流水号
                        if (remark.Trim() == "")
                        {
                            ttAgentRecharge.description = ttAgentPreRechg.description;//说明
                        }
                        else
                        {
                            ttAgentRecharge.description = remark;
                        }
                        agentRechargeBLL.Add(ttAgentRecharge, ttAgentPreRechg, ttAgentPreRechg.fee);
                    }
                    else
                    {
                        bll.Edit(ttAgentPreRechg);
                    }
                    return;
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }
 public Control MakeControl()
 {
     Control input = null;
     if (this.Type == "Text")
     {
         input = new Edit();
         input.ID = Control.GetUniqueID("input");
     }
     else if (this.Type == "Dropdown")
     {
         Combobox c = new Combobox();
         foreach (var value in this.PossibleValues())
         {
             ListItem li = new ListItem();
             li.Header = value.Name;
             li.Value = value.Value;
             c.Controls.Add(li);
         }
         input = c;
         input.ID = Control.GetUniqueID("input");
     }
     else if (this.Type == "Item Selector")
     {
         ASR.Controls.ItemSelector iSelect = new ASR.Controls.ItemSelector();
         input = iSelect;
         input.ID = Control.GetUniqueID("input");
         iSelect.Click = string.Concat("itemselector", ":", input.ID);
         if (this.Parameters["root"] != null) iSelect.Root = this.Parameters["root"];
         if (this.Parameters["folder"] != null) iSelect.Folder = this.Parameters["folder"];
         if (this.Parameters["displayresult"] != null) iSelect.DisplayValueType = (ASR.Controls.ItemInfo)Enum.Parse(typeof(ASR.Controls.ItemInfo), this.Parameters["displayresult"].ToString());
         if (this.Parameters["valueresult"] != null) iSelect.ValueType = (ASR.Controls.ItemInfo)Enum.Parse(typeof(ASR.Controls.ItemInfo), this.Parameters["valueresult"].ToString());
         if (this.Parameters["filter"] != null) iSelect.Filter = this.Parameters["filter"];
     }
     else if (this.Type == "User Selector")
     {
         ASR.Controls.UserSelector uSelect = new ASR.Controls.UserSelector();
         input = uSelect;
         input.ID = Control.GetUniqueID("input");
         uSelect.Click = string.Concat("itemselector", ":", input.ID);
         if (this.Parameters["filter"] != null) uSelect.Filter = this.Parameters["filter"];
     }
     else if (this.Type == "Date picker")
     {
         var dtPicker = new ASR.Controls.DateTimePicker();
         dtPicker.Style.Add("float", "left");
         dtPicker.ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("input");
         dtPicker.Click = "datepicker" + ":" + dtPicker.ID;
         if (this.Parameters["Format"] != null) dtPicker.Format = this.Parameters["Format"];
         input = dtPicker;
     }
     //input.ID = Control.GetUniqueID("input");
     input.Value = this.Value;
     return input;
 }
Beispiel #18
0
 public DaftarAnggotaController(DBINTEGRASI_MASTER_BAYUPPKU2Context context, DaftarAnggotaRepo repo, Combobox combobox)
 {
     _repo     = repo;
     _combobox = combobox;
     _context  = context;
 }
        public CreateCharTradeGump(PlayerMobile character, ProfessionInfo profession) : base(0, 0)
        {
            _character = character;

            foreach (var skill in _character.Skills)
            {
                _character.UpdateSkill(skill.Index, 0, 0, Lock.Locked, 0);
            }

            Add(new ResizePic(2600)
            {
                X = 100, Y = 80, Width = 470, Height = 372
            });

            // center menu with fancy top
            // public GumpPic(AControl parent, int x, int y, int gumpID, int hue)
            Add(new GumpPic(291, 42, 0x0589, 0));
            Add(new GumpPic(214, 58, 0x058B, 0));
            Add(new GumpPic(300, 51, 0x15A9, 0));

            // title text
            //TextLabelAscii(AControl parent, int x, int y, int font, int hue, string text, int width = 400)
            Add(new Label(FileManager.Cliloc.GetString(3000326), false, 0x0386, font: 2)
            {
                X = 148, Y = 132
            });

            // strength, dexterity, intelligence
            Add(new Label(FileManager.Cliloc.GetString(3000111), false, 1, font: 1)
            {
                X = 158, Y = 170
            });

            Add(new Label(FileManager.Cliloc.GetString(3000112), false, 1, font: 1)
            {
                X = 158, Y = 250
            });

            Add(new Label(FileManager.Cliloc.GetString(3000113), false, 1, font: 1)
            {
                X = 158, Y = 330
            });

            // sliders for attributes
            _attributeSliders        = new HSliderBar[3];
            Add(_attributeSliders[0] = new HSliderBar(164, 196, 93, 10, 60, ProfessionInfo._VoidStats[0], HSliderBarStyle.MetalWidgetRecessedBar, true));
            Add(_attributeSliders[1] = new HSliderBar(164, 276, 93, 10, 60, ProfessionInfo._VoidStats[1], HSliderBarStyle.MetalWidgetRecessedBar, true));
            Add(_attributeSliders[2] = new HSliderBar(164, 356, 93, 10, 60, ProfessionInfo._VoidStats[2], HSliderBarStyle.MetalWidgetRecessedBar, true));

            string[] skillList = FileManager.Skills.SkillNames;
            int      y         = 172;

            _skillSliders = new HSliderBar[CharCreationGump._skillsCount];
            _skills       = new Combobox[CharCreationGump._skillsCount];

            for (var i = 0; i < CharCreationGump._skillsCount; i++)
            {
                Add(_skills[i]       = new Combobox(344, y, 182, skillList, -1, 200, false, "Click here"));
                Add(_skillSliders[i] = new HSliderBar(344, y + 32, 93, 0, 50, ProfessionInfo._VoidSkills[i, 1], HSliderBarStyle.MetalWidgetRecessedBar, true));
                y += 70;
            }

            Add(new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2)
            {
                X = 586, Y = 445, ButtonAction = ButtonAction.Activate
            });

            Add(new Button((int)Buttons.Next, 0x15A4, 0x15A6, 0x15A5)
            {
                X = 610, Y = 445, ButtonAction = ButtonAction.Activate
            });

            for (int i = 0; i < _attributeSliders.Length; i++)
            {
                for (int j = 0; j < _attributeSliders.Length; j++)
                {
                    if (i != j)
                    {
                        _attributeSliders[i].AddParisSlider(_attributeSliders[j]);
                    }
                }
            }

            for (int i = 0; i < _skillSliders.Length; i++)
            {
                for (int j = 0; j < _skillSliders.Length; j++)
                {
                    if (i != j)
                    {
                        _skillSliders[i].AddParisSlider(_skillSliders[j]);
                    }
                }
            }
        }
Beispiel #20
0
 public void ProcessRequest(HttpContext context)
 {
     try
     {
         LoginUser loginUser = new LoginUser(context, "Client");
         ClientBLL bll       = new ClientBLL(context, loginUser);
         if (!loginUser.Pass)//权限验证
         {
             return;
         }
         if (context.Request["action"] == "agentListLoad")
         {
             Combobox com = new Combobox(context, loginUser);
             com.AgentCombobox();
         }
         //用户查找分类
         if (context.Request["action"] == "clientQueryListLoad")
         {
             Combobox com = new Combobox(context, loginUser);
             com.ClientQueryCombobox();
         }
         if (context.Request["action"] == "siteListLoad")
         {
             string   agentId = context.Request["agentId"];
             Combobox com     = new Combobox(context, loginUser);
             com.SiteByAgentCombobox(agentId);
         }
         //加载DataGrid
         if (context.Request["action"] == "gridLoad")
         {
             int    page            = int.Parse(context.Request["page"]);
             int    rows            = int.Parse(context.Request["rows"]);
             string agentId         = context.Request["agentId"];
             string siteId          = context.Request["siteId"];
             string clientQuery     = context.Request["clientQuery"];
             string clientQueryText = context.Request["clientQueryText"];
             string status          = context.Request["status"];
             string startDate       = context.Request["startDate"];
             string endDate         = context.Request["endDate"];
             bll.LoadGrid(page, rows, agentId, siteId, clientQuery, clientQueryText, status, startDate, endDate);
             return;
         }
         //获取账户余额积分总计
         if (context.Request["action"] == "totalBalanceAndPoints")
         {
             string agentId         = context.Request["agentId"];
             string siteId          = context.Request["siteId"];
             string clientQuery     = context.Request["clientQuery"];
             string clientQueryText = context.Request["clientQueryText"];
             string status          = context.Request["status"];
             string startDate       = context.Request["startDate"];
             string endDate         = context.Request["endDate"];
             var    totalBalance    = bll.GetTotalBalanceOrPoints(1, agentId, siteId, clientQuery, clientQueryText, status, startDate, endDate);
             var    totalPoints     = bll.GetTotalBalanceOrPoints(2, agentId, siteId, clientQuery, clientQueryText, status, startDate, endDate);
             context.Response.Write("{\"totalBalance\":" + totalBalance + ",\"totalPoints\":" + totalPoints + "}");
         }
         //加载信息
         if (context.Request["action"] == "load")
         {
             long clientId = long.Parse(context.Request["clientId"]);//客户编号
             bll.Load(clientId);
             return;
         }
     }
     catch (Exception e)
     {
         Message.error(context, e.Message);
     }
 }
Beispiel #21
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginUser loginUser = new LoginUser(context, "SiteAudit");
                if (!loginUser.Pass)//权限验证
                {
                    return;
                }

                SiteBLL bll = new SiteBLL(context, loginUser);
                if (context.Request["action"] == "gridLoad")
                {
                    //加载DataGrid
                    int    page        = int.Parse(context.Request["page"]);
                    int    rows        = int.Parse(context.Request["rows"]);
                    string siteId      = context.Request["siteId"];
                    string siteName    = context.Request["siteName"];
                    string auditStatus = context.Request["auditStatus"];
                    bll.LoadGrid(page, rows, siteId, siteName, auditStatus);
                }
                else if (context.Request["action"] == "agentListLoad")
                {
                    //加载代理商列表
                    Combobox com = new Combobox(context, loginUser);
                    com.AgentCombobox();
                }
                else if (context.Request["action"] == "auditListLoad")
                {
                    //加载审核状态列表
                    Combobox com = new Combobox(context, loginUser);
                    com.AuditCombobox();
                }
                else if (context.Request["action"] == "load")
                {
                    //加载信息
                    bll.Load(context.Request["siteId"]);
                }
                else if (context.Request["action"] == "audit")
                {
                    //审核
                    TBSite tbSite = new TBSite();
                    tbSite.siteId      = context.Request["siteId"];
                    tbSite.auditStatus = context.Request["auditStatus"];
                    if (tbSite.auditStatus == ((int)AuditStauts.AuditSucces).ToString())
                    {
                        tbSite.status = "1";
                    }
                    else
                    {
                        tbSite.status = "0";
                    }
                    tbSite.remark = context.Request["remark"];
                    bll.Audit(tbSite);
                }
                else if (context.Request["action"] == "delete")
                {
                    //删除
                    string siteId = context.Request["siteId"];
                    bll.Delete(siteId);
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }
 private void InitializeComponent()
 {
     this.checkBox1 = new CheckBox();
      this.checkBox2 = new CheckBox();
      this.checkBox3 = new CheckBox();
      this.label1 = new Label();
      this.comboBox1 = ComboBox();
      this.comboBox2 = ComboBox();
      this.comboBox3 = ComboBox();
      this.label2 = new Label();
      //
      // checkBox1
      //
      this.checkBox1.Location = new
     System.Drawing.Point(40, 88);
      this.checkBox1.TabIndex = 0;
      this.checkBox1.Text = "Stereo";
      this.checkBox1.CheckedChanged += new
      System.EventHandler(this.checkBox1_CheckedChanged);
      //
      // checkBox2
      //
      this.checkBox2.Location = new
     System.Drawing.Point(40, 136);
      this.checkBox2.TabIndex = 1;
      this.checkBox2.Text = "Power";
      this.checkBox2.CheckedChanged += new
      System.EventHandler(this.checkBox2_CheckedChanged);
      //
      // checkBox3
      //
      this.checkBox3.Location = new
     System.Drawing.Point(40, 184);
      this.checkBox3.Size = new
     System.Drawing.Size(104, 32);
      this.checkBox3.TabIndex = 2;
      this.checkBox3.text = "Roadside Asistance";
      this.checkBox3.CheckedChanged += new
      System.EventHandler(this.checkBox3_CheckedChanged);
      //
      // label1
      //
      this.label1.Location = new
     System.Drawing.Point(32, 32);
      this.label1.Size = new System.Drawing.Size(216, 23);
      this.label1.TabIndex = 3;
      this.label.Text =
      "Select the new car options you want";
      //
      // comboBox1
      //
      this.comboBox1.DropDownWidth = 168;
      this.comboBox1.Items.AddRange(new object[] {
      "AM/FM radio",
      "Satellite radio",
      "10 CD player"});
      this.comboBox1.Location = new
     System.Drawing.Point(152, 88);
      this.comboBox1.Size =
     new System.Drawing.Size(168, 21);
      this.comboBox1.TabIndex = 4;
      this.comboBox1.Text = "Stereo options";
      this.comboBox1.Visible = false;
      this.comboBox1.SelectedIndexChanged += new
     System.EventHandler(this.comboBox1_SelectedIndexChanged);
      //
      // comboBox2
      //
      this.comboBox2.DropDownWidth = 168;
      this.comboBox2.Items.AddRange(new object[] {
       "Power brakes",
       "Power brakes and steering",
      "Power brakes, steering, windows, antenna"});
      this.comboBox2.Location = new
     System.Drawing.Point(152, 136);
      this.comboBox2.Name = "comboBox2";
      this.comboBox2.Size = new
       System.Drawing.Size(168, 21);
      this.comboBox2.TabIndex = 5;
      this.comboBox2.Text = "Power options";
      this.comboBox2.Visible = false;
      this.comboBox2.SelectedIndexChanged +=
       new System.EventHandler(this.comboBox2_SelectedIndexChanged);
      //
      // comboBox3
      //
      this.comboBox3.DropDownWidth = 168;
      this.comboBox3.Items.AddRange(new object[] {
     "In-state"
     "Tri-state area"
     "Nationwide"})
      this.comboBox3.Location =
     new System.Drawing.Point(152, 176);
      this.comboBox3.Size = new
     System.Drawing.Size(168, 21);
      this.comboBox3.TabIndex = 6;
      this.comboBox3.Text = "Roadside assistance options";
      this.comboBox3.Visible = false;
      this.comboBox3.SelectedIndexChanged += new
       System.EventHandler(this.comboBox3_SelectedIndexChanged);
      //
      // label2
      //
      this.label2.Location =
     new System.Drawing.Point(56, 232);
      this.label2.Size = new System.Drawing.Size(184, 40);
      this.label2.TabIndex = 7;
      this.label2.Text = "Option package =";
      //
      // Form1
      //
      this.AutoScaleBaseSize = new
     System.Drawing.Size(5, 13);
      this.ClientSize = new System.Drawing.Size(342, 323);
      this.Controls.AddRange
      (new System.Windows.Forms.Control[] {
     this.label2,
     this.comboBox3,
     this.comboBox2,
     this.comboBox1,
     this.label1,
     this.checkBox3,
     this.checkBox2,
     this.checkBox1});
      this.Text = "New Car Options";
 }
Beispiel #23
0
        public SplitScreen(BaseScreenComponent manager)
            : base(manager)
        {
            Background = new BorderBrush(Color.Gray);                       //Hintergrundfarbe festlegen

            Button backButton = Button.TextButton(manager, "Back");             //Neuen TextButton erzeugen
            backButton.HorizontalAlignment = HorizontalAlignment.Left;          //Links
            backButton.VerticalAlignment = VerticalAlignment.Top;               //Oben
            backButton.LeftMouseClick += (s, e) => { manager.NavigateBack(); }; //KlickEvent festlegen
            Controls.Add(backButton);                                           //Button zum Screen hinzufügen

            //ScrollContainer
            ScrollContainer scrollContainer = new ScrollContainer(manager)  //Neuen ScrollContainer erzeugen
            {
                VerticalAlignment = VerticalAlignment.Stretch,              // 100% Höhe
                HorizontalAlignment = HorizontalAlignment.Stretch           //100% Breite
            };
            Controls.Add(scrollContainer);                                  //ScrollContainer zum Root(Screen) hinzufügen

            //Stackpanel - SubControls werden Horizontal oder Vertikal gestackt
            StackPanel panel = new StackPanel(manager);                 //Neues Stackpanel erzeugen
            panel.VerticalAlignment = VerticalAlignment.Stretch;        //100% Höhe
            scrollContainer.Content = panel;                            //Ein Scroll Container kann nur ein Control beherbergen

            //Label
            Label label = new Label(manager) { Text = "Control Showcase" }; //Neues Label erzeugen
            panel.Controls.Add(label);                                      //Label zu Panel hinzufügen

            Button tB = Button.TextButton(manager, "TEST");
            tB.Background = new TextureBrush(LoadTexture2DFromFile("./test_texture_round.png", manager.GraphicsDevice), TextureBrushMode.Stretch);
            panel.Controls.Add(tB);

            //Button
            Button button = Button.TextButton(manager, "Dummy Button"); //Neuen TextButton erzeugen
            panel.Controls.Add(button);                                 //Button zu Panel hinzufügen

            //Progressbar
            ProgressBar pr = new ProgressBar(manager)                   //Neue ProgressBar erzeugen
            {
                Value = 99,                                             //Aktueller Wert
                Height = 20,                                            //Höhe
                Width = 200                                             //Breite
            };
            panel.Controls.Add(pr);                                     //ProgressBar zu Panel hinzufügen

            //ListBox
            Listbox<string> list = new Listbox<string>(manager);        //Neue ListBox erstellen
            list.TemplateGenerator = (item) =>                          //Template Generator festlegen
            {
                return new Label(manager) { Text = item };              //Control (Label) erstellen
            };
            panel.Controls.Add(list);                                   //Liste zu Panel hinzufügen

            list.Items.Add("Hallo");                                    //Items zur Liste hinzufügen
            list.Items.Add("Welt");                                     //...

            //Combobox
            Combobox<string> combobox = new Combobox<string>(manager)   //Neue Combobox erstellen
            {
                Height = 20,                                            //Höhe 20
                Width = 100                                             //Breite 100
            };
            combobox.TemplateGenerator = (item) =>                      //Template Generator festlegen
            {
                return new Label(manager) { Text = item };              //Control (Label) erstellen
            };
            panel.Controls.Add(combobox);                               //Combobox zu Panel  hinzufügen

            combobox.Items.Add("Combobox");                             //Items zu Combobox hinzufügen
            combobox.Items.Add("Item");
            combobox.Items.Add("Hallo");

            Button clearCombobox = Button.TextButton(manager, "Clear Combobox");
            clearCombobox.LeftMouseClick += (s, e) => {
                combobox.Items.Clear();
                list.Items.Clear();
            };
            panel.Controls.Add(clearCombobox);

            //Slider Value Label
            Label labelSliderHorizontal = new Label(manager);

            //Horizontaler Slider
            Slider sliderHorizontal = new Slider(manager)
            {
                Width = 150,
                Height = 20,
            };
            sliderHorizontal.ValueChanged += (value) => { labelSliderHorizontal.Text = "Value: " + value; }; //Event on Value Changed
            panel.Controls.Add(sliderHorizontal);
            labelSliderHorizontal.Text = "Value: " + sliderHorizontal.Value;                                 //Set Text initially
            panel.Controls.Add(labelSliderHorizontal);

            //Slider Value Label
            Label labelSliderVertical = new Label(manager);

            //Vertikaler Slider
            Slider sliderVertical = new Slider(manager)
            {
                Range = 100,
                Height = 200,
                Width = 20,
                Orientation = Orientation.Vertical
            };
            sliderVertical.ValueChanged += (value) => { labelSliderVertical.Text = "Value: " + value; };
            panel.Controls.Add(sliderVertical);
            labelSliderVertical.Text = "Value: " + sliderVertical.Value;
            panel.Controls.Add(labelSliderVertical);

            Checkbox checkbox = new Checkbox(manager);
            panel.Controls.Add(checkbox);

            //Textbox
            textbox = new Textbox(manager)                      //Neue TextBox erzeugen
            {
                Background = new BorderBrush(Color.LightGray),          //Festlegen eines Backgrounds für ein Control
                HorizontalAlignment = HorizontalAlignment.Stretch,          //100% Breite
                Text = "TEXTBOX!",                                      //Voreingestellter text
                MinWidth = 100                                          //Eine Textbox kann ihre Größe automatisch anpassen
            };

            Button clearTextbox = Button.TextButton(manager, "Clear Textbox");
            clearTextbox.LeftMouseClick += (s, e) =>
            {
                textbox.SelectionStart = 0;
                textbox.Text = "";
            };

            Button disableControls = Button.TextButton(manager, "Toggle Controls disabled");
            disableControls.LeftMouseClick += (s, e) =>
            {
                foreach (var c in panel.Controls)
                {
                    c.Enabled = !c.Enabled;
                }
            };
            panel.Controls.Add(clearTextbox);
            panel.Controls.Add(textbox);                                //Textbox zu Panel hinzufügen
            panel.Controls.Add(disableControls);
        }
Beispiel #24
0
    public void Init(GameObject go)
    {
        container = go;
        Transform content = container.transform.Find("content");

        modelnText = content.Find("modelnameText").GetComponent <Text>();

        leftweapon = content.Find("leftweapon/combobox/Combobox").GetComponent <Combobox>();
        leftweapon.ListView.Sort       = false;
        leftweapon.ListView.DataSource = DataManager.GetWeaponList();
        leftweapon.OnSelect.AddListener(OnLeftWeaponSelected);

        rightweapon = content.Find("rightweapon/combobox/Combobox").GetComponent <Combobox>();
        rightweapon.ListView.Sort       = false;
        rightweapon.ListView.DataSource = DataManager.GetWeaponList();
        rightweapon.OnSelect.AddListener(OnRightWeaponSelected);

        walkSpeedSet = content.Find("walkSpeedSet/RangeSliderFloat").GetComponent <RangeSliderFloat>();
        walkSpeedSet.SetLimit(DataManager.WalkSpeedMin, DataManager.WalkSpeedMax);
        walkSpeedSet.Step = DataManager.Step;
        walkSpeedValue    = content.Find("walkSpeedSet/value").GetComponent <Text>();
        walkSpeedSet.OnValuesChange.AddListener(OnWalkSpeedSliderChangeHandler);

        runSpeedSet = content.Find("runSpeedSet/RangeSliderFloat").GetComponent <RangeSliderFloat>();
        runSpeedSet.SetLimit(DataManager.RunSpeedMin, DataManager.RunSpeedMax);
        runSpeedSet.Step = DataManager.Step;
        runSpeedValue    = content.Find("runSpeedSet/value").GetComponent <Text>();
        runSpeedSet.OnValuesChange.AddListener(OnRunSpeedSliderChangeHandler);

        actionNameSet = content.Find("actionNameSet/combobox/Combobox").GetComponent <Combobox>();
        actionNameSet.ListView.Sort       = false;
        actionNameSet.ListView.DataSource = DataManager.GetActionList();
        actionNameSet.OnSelect.AddListener(OnActionnSelected);

        actionLengthText      = content.Find("actionNameSet/actionLengthText").GetComponent <Text>();
        actionLengthText.text = "0";



        actionSpeedSet = content.Find("actionSpeedSet/RangeSliderFloat").GetComponent <RangeSliderFloat>();
        actionSpeedSet.SetLimit(DataManager.ActionSpeedMin, DataManager.ActionSpeedMax);
        actionSpeedSet.Step = DataManager.Step;
        actionSpeedtext     = content.Find("actionSpeedSet/Text").GetComponent <Text>();
        actionSpeedSet.OnValuesChange.AddListener(OnActionSpeedSliderChangeHandler);

        actionIsLoop      = content.Find("actionIsLoop").GetComponent <Toggle>();
        actionIsLoop.isOn = false;
        actionIsLoop.onValueChanged.AddListener(OnActionIsLoopHandler);

        actionIsLang      = content.Find("actionIsLang").GetComponent <Toggle>();
        actionIsLang.isOn = false;
        actionIsLang.onValueChanged.AddListener(OnActionIsLangHandler);



        actionSoundSet = content.Find("actionSoundSet/combobox/Combobox").GetComponent <Combobox>();
        actionSoundSet.ListView.Sort       = false;
        actionSoundSet.ListView.DataSource = DataManager.GetSoundList();
        actionSoundSet.OnSelect.AddListener(OnActionSoundSelected);

        //todo 动作音效延迟播放时间 最小值为0f 最大值为当前动作的总时间 暂时先按照配置
        actionSoundPlayPointSet = content.Find("actionSoundPlayPointSet/RangeSliderFloat").GetComponent <RangeSliderFloat>();

        actionSoundPlayPointSet.SetLimit(DataManager.ActionSoundDelayMin, DataManager.ActionSoundDelayMax);
        actionSoundPlayPointSet.Step = DataManager.ActionSoundStep;
        actionSoundPlayPointText     = content.Find("actionSoundPlayPointSet/Text").GetComponent <Text>();
        actionSoundPlayPointSet.OnValuesChange.AddListener(OnActionSoundPointSliderChangeHandler);

        selfMoveDelayTimeSet = content.Find("selfMoveDelayTimeSet/RangeSliderFloat").GetComponent <RangeSliderFloat>();
        selfMoveDelayTimeSet.SetLimit(0f, 10f);
        selfMoveDelayTimeSet.Step = DataManager.Step;
        selfMoveDelayText         = content.Find("selfMoveDelayTimeSet/Text").GetComponent <Text>();
        selfMoveDelayTimeSet.OnValuesChange.AddListener(OnSelfMoveDelaySliderChangeHandler);

        selfMoveDistanceSet = content.Find("selfMoveDistanceSet/RangeSliderFloat").GetComponent <RangeSliderFloat>();
        selfMoveDistanceSet.SetLimit(DataManager.SelfMoveDistanceMin, DataManager.SelfMoveDistanceMax);
        selfMoveDistanceSet.Step = DataManager.Step;
        selfMoveDistanceText     = content.Find("selfMoveDistanceSet/Text").GetComponent <Text>();
        selfMoveDistanceSet.OnValuesChange.AddListener(OnSelfMoveDistanceSliderChangeHandler);

        selfMoveTimeSet = content.Find("selfMoveTimeSet/RangeSliderFloat").GetComponent <RangeSliderFloat>();
        selfMoveTimeSet.SetLimit(DataManager.SelfMoveTimeMin, DataManager.SelfMoveTimeMax);
        selfMoveTimeSet.Step = DataManager.Step;
        selfMoveTimeText     = content.Find("selfMoveTimeSet/Text").GetComponent <Text>();
        selfMoveTimeSet.OnValuesChange.AddListener(OnSelfMoveTimeSliderChangeHandler);

        attackRadioSet = content.Find("attackRadioSet/RangeSliderFloat").GetComponent <RangeSliderFloat>();
        attackRadioSet.SetLimit(DataManager.AttackRadioMin, DataManager.AttackRadioMax);
        attackRadioSet.Step = DataManager.Step;
        attackRadioText     = content.Find("attackRadioSet/Text").GetComponent <Text>();
        attackRadioSet.OnValuesChange.AddListener(OnAttackRadioSliderChangeHandler);

        attackAngleSet = content.Find("attackAngleSet/RangeSliderFloat").GetComponent <RangeSliderFloat>();
        attackAngleSet.SetLimit(DataManager.AttackAngleMin, DataManager.AttackAngleMax);
        attackAngleSet.Step = DataManager.Step;
        attackAngleText     = content.Find("attackAngleSet/Text").GetComponent <Text>();
        attackAngleSet.OnValuesChange.AddListener(OnAttackAngleSliderChangeHandler);

        isHitMoveSet      = content.Find("isHitMoveSet/Toggle").GetComponent <Toggle>();
        hitMoveText       = content.Find("isHitMoveSet/Text").GetComponent <Text>();
        isHitMoveSet.isOn = false;
        hitMoveText.text  = "0";
        isHitMoveSet.onValueChanged.AddListener(OnHitMoveSelectHandler);
        hitMoveDistanceSet = content.Find("isHitMoveSet/moveDistanceText/RangeSliderFloat").GetComponent <RangeSliderFloat>();
        hitMoveDistanceSet.SetLimit(DataManager.HitMoveDistanceMin, DataManager.HitMoveDistanceMax);
        hitMoveDistanceSet.Step = DataManager.Step;
        hitMoveDistanceSet.OnValuesChange.AddListener(OnHitMoveDistanceSliderChangeHandler);

        hitMoveDistanceText = content.Find("isHitMoveSet/moveDistanceText/Text").GetComponent <Text>();
        hitMoveTimeSet      = content.Find("isHitMoveSet/moveTimeText/RangeSliderFloat").GetComponent <RangeSliderFloat>();
        hitMoveTimeSet.SetLimit(DataManager.HitMoveTimeMin, DataManager.HitMoveTimeMax);
        hitMoveTimeSet.Step = DataManager.Step;
        hitMoveTimeSet.OnValuesChange.AddListener(OnHitMoveTimeSliderChangeHandler);
        hitMoveTimeText = content.Find("isHitMoveSet/moveTimeText/Text").GetComponent <Text>();

        isHitFlySet      = content.Find("isHitFlySet/Toggle").GetComponent <Toggle>();
        hitFlyText       = content.Find("isHitFlySet/Text").GetComponent <Text>();
        isHitFlySet.isOn = false;
        hitFlyText.text  = "0";
        isHitFlySet.onValueChanged.AddListener(OnHitFlySelectHandler);

        hitFlyDistanceSet = content.Find("isHitFlySet/moveDistanceText/RangeSliderFloat").GetComponent <RangeSliderFloat>();
        hitFlyDistanceSet.SetLimit(DataManager.HitFlyDistanceMin, DataManager.HitFlyDistanceMax);
        hitFlyDistanceSet.Step = DataManager.Step;
        hitFlyDistanceText     = content.Find("isHitFlySet/moveDistanceText/Text").GetComponent <Text>();
        hitFlyDistanceSet.OnValuesChange.AddListener(OnHitFlyDistanceSliderChangeHandler);
        hitFlyTimeSet = content.Find("isHitFlySet/moveTimeText/RangeSliderFloat").GetComponent <RangeSliderFloat>();
        hitFlyTimeSet.SetLimit(DataManager.HitFlyTimeMin, DataManager.HitFlyTimeMax);
        hitFlyTimeSet.Step = DataManager.Step;
        hitFlyTimeText     = content.Find("isHitFlySet/moveTimeText/Text").GetComponent <Text>();
        hitFlyTimeSet.OnValuesChange.AddListener(OnHitFlyTimeSliderChangeHandler);

        shakeScreenSet = content.Find("shakeScreenSet/combobox/Combobox").GetComponent <Combobox>();
        shakeScreenSet.ListView.DataSource = DataManager.GetShakeCameraList();
        shakeScreenSet.OnSelect.AddListener(OnShakeCameraHandler);

        shakeScreenToggle      = content.Find("shakeScreenToggle").GetComponent <Toggle>();
        shakeScreenToggle.isOn = false;
        shakeScreenToggle.onValueChanged.AddListener(OnShakeCameraSelectHandler);



        actionEffectsSet = content.Find("actionEffectsSet/ListView").GetComponent <ListView>();
        actionEffectsSet.OnSelect.AddListener(OnActionEffectSelectedHandler);
        addActionEffectBtn = content.Find("actionEffectsSet/addBtn").GetComponent <Button>();
        addActionEffectBtn.onClick.AddListener(OnAddActionEffectHandler);


        hitEffectsSet = content.Find("hitEffectsSet/ListView").GetComponent <ListView>();
        hitEffectsSet.OnSelect.AddListener(OnHitEffectSelectedHandler);
        hitActionEffectBtn = content.Find("hitEffectsSet/addBtn").GetComponent <Button>();
        hitActionEffectBtn.onClick.AddListener(OnAddHitEffectHandler);


        previewBtn = content.Find("previewBtn").GetComponent <Button>();
        previewBtn.onClick.AddListener(OnPreviewBtnClickHandler);
        saveBtn = content.Find("saveBtn").GetComponent <Button>();
        saveBtn.onClick.AddListener(OnSaveBtnClickHandler);
    }
        public Control MakeControl()
        {
            Control input = null;

            if (this.Type == "Text")
            {
                input = new Edit();
                if (this.Parameters.AllKeys.Contains("width"))
                {
                    input.Width = new System.Web.UI.WebControls.Unit(this.Parameters["width"]);
                }
                input.ID = Control.GetUniqueID("input");
            }
            else if (this.Type == "Dropdown")
            {
                Combobox c = new Combobox();
                foreach (var value in this.PossibleValues())
                {
                    ListItem li = new ListItem();
                    li.Header = value.Name;
                    li.Value  = value.Value;
                    c.Controls.Add(li);
                }
                input    = c;
                input.ID = Control.GetUniqueID("input");
            }
            else if (this.Type == "Item Selector")
            {
                ASR.Controls.ItemSelector iSelect = new ASR.Controls.ItemSelector();
                input         = iSelect;
                input.ID      = Control.GetUniqueID("input");
                iSelect.Click = string.Concat("itemselector", ":", input.ID);
                if (this.Parameters["root"] != null)
                {
                    iSelect.Root = this.Parameters["root"];
                }
                if (this.Parameters["folder"] != null)
                {
                    iSelect.Folder = this.Parameters["folder"];
                }
                if (this.Parameters["displayresult"] != null)
                {
                    iSelect.DisplayValueType = (ASR.Controls.ItemInfo)Enum.Parse(typeof(ASR.Controls.ItemInfo), this.Parameters["displayresult"].ToString());
                }
                if (this.Parameters["valueresult"] != null)
                {
                    iSelect.ValueType = (ASR.Controls.ItemInfo)Enum.Parse(typeof(ASR.Controls.ItemInfo), this.Parameters["valueresult"].ToString());
                }
                if (this.Parameters["filter"] != null)
                {
                    iSelect.Filter = this.Parameters["filter"];
                }
            }
            else if (this.Type == "User Selector")
            {
                ASR.Controls.UserSelector uSelect = new ASR.Controls.UserSelector();
                input         = uSelect;
                input.ID      = Control.GetUniqueID("input");
                uSelect.Click = string.Concat("itemselector", ":", input.ID);
                if (this.Parameters["filter"] != null)
                {
                    uSelect.Filter = this.Parameters["filter"];
                }
            }
            else if (this.Type == "Date picker")
            {
                DateTimePicker dtPicker = new ASR.Controls.DateTimePicker();
                dtPicker.Style.Add("float", "left");
                dtPicker.ID       = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("input");
                dtPicker.ShowTime = false;
                dtPicker.Click    = "datepicker" + ":" + dtPicker.ID;
                dtPicker.Style.Add(System.Web.UI.HtmlTextWriterStyle.Display, "inline");
                dtPicker.Style.Add(System.Web.UI.HtmlTextWriterStyle.VerticalAlign, "middle");
                input = dtPicker;
            }
            //input.ID = Control.GetUniqueID("input");
            //input.Value = this.Value;
            input.Value = this.DefaultValue;
            return(input);
        }
        private System.Web.UI.Control GetVariableEditor(Hashtable variable)
        {
            object value = variable["Value"];
            string name = (string) variable["Name"];
            string editor = variable["Editor"] as string;
            Type type = value.GetType();

            if (type == typeof (DateTime) ||
                (!string.IsNullOrEmpty(editor) &&
                 (editor.IndexOf("date", StringComparison.OrdinalIgnoreCase) > -1 ||
                  editor.IndexOf("time", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var dateTimePicker = new DateTimePicker
                {
                    ID = Control.GetUniqueID("variable_" + name + "_"),
                    ShowTime = (variable["ShowTime"] != null && (bool) variable["ShowTime"]) ||
                               (!string.IsNullOrEmpty(editor) &&
                                editor.IndexOf("time", StringComparison.OrdinalIgnoreCase) > -1),
                };
                dateTimePicker.Value = value is DateTime ? DateUtil.ToIsoDate((DateTime)value) : (string)value;
                return dateTimePicker;
            }

            if (type == typeof (Item) ||
                (!string.IsNullOrEmpty(editor) && (editor.IndexOf("item", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var item = (Item) value;
                var dataContext = new DataContext
                {
                    DefaultItem = item.Paths.Path,
                    ID = Control.GetUniqueID("dataContext"),
                    DataViewName = "Master",
                    Root = variable["Root"] as string ?? "/sitecore",
                    Parameters = "databasename=" + item.Database.Name,
                    Database = item.Database.Name,
                    Selected = new[] {new DataUri(item.ID, item.Language, item.Version)},
                    Folder = item.ID.ToString(),
                    Language = item.Language,
                    Version = item.Version
                };
                DataContextPanel.Controls.Add(dataContext);

                var treePicker = new TreePicker
                {
                    ID = Control.GetUniqueID("variable_" + name + "_"),
                    Value = item.ID.ToString(),
                    DataContext = dataContext.ID
                };
                treePicker.Class += " treePicker";
                return treePicker;
            }

            if (type == typeof(bool) ||
                (!string.IsNullOrEmpty(editor) && (editor.IndexOf("bool", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var checkBox = new Checkbox
                {
                    ID = Control.GetUniqueID("variable_" + name + "_"),
                    Header = (string) variable["Title"],
                    HeaderStyle = "margin-top:20px; display:inline-block;",
                    Checked = (bool) value
                };
                checkBox.Class = "varCheckbox";
                return checkBox;
            }

            if (!string.IsNullOrEmpty(editor))
            {
                bool showRoles = editor.IndexOf("role", StringComparison.OrdinalIgnoreCase) > -1;
                bool showUsers = editor.IndexOf("user", StringComparison.OrdinalIgnoreCase) > -1;
                bool multiple = editor.IndexOf("multiple", StringComparison.OrdinalIgnoreCase) > -1;
                if (showRoles || showUsers)
                {
                    UserPicker picker = new UserPicker();
                    picker.Style.Add("float", "left");
                    picker.ID = Control.GetUniqueID("variable_" + name + "_");
                    picker.Class += " scContentControl textEdit clr" + value.GetType().Name;
                    picker.Value = value.ToString();
                    picker.ExcludeRoles = !showRoles;
                    picker.ExcludeUsers = !showUsers;
                    picker.DomainName = variable["Domain"] as string ?? variable["DomainName"] as string;
                    picker.Multiple = multiple;
                    picker.Click = "UserPickerClick(" + picker.ID + ")";
                    return picker;
                }
            }

            Control edit;
            if (variable["lines"] != null && ((int)variable["lines"] > 1))
            {
                edit = new Memo();
                edit.Attributes.Add("rows", variable["lines"].ToString());
            }
            else if (variable["Options"] != null)
            {
                edit = new Combobox();
                string[] options = ((string) variable["Options"]).Split('|');
                int i = 0;
                while (i < options.Length)
                {
                    var item = new ListItem()
                    {
                        Header = options[i++],
                        Value = options[i++],
                    };
                    edit.Controls.Add(item);
                }
            }
            else
            {
                edit = new Edit();
            }
            if (!string.IsNullOrEmpty((string)variable["Tooltip"]))
            {
                edit.ToolTip = (string)variable["Tooltip"];
            }
            edit.Style.Add("float", "left");
            edit.ID = Control.GetUniqueID("variable_" + name + "_");
            edit.Class += " scContentControl textEdit clr"+value.GetType().Name;
            edit.Value = value.ToString();

            return edit;
        }
Beispiel #27
0
 public JsonResult TipoItemConta()
 {
     return(Json(Combobox.Listar(typeof(TipoConta))));
 }
Beispiel #28
0
        private void BuildGeneral()
        {
            const int  PAGE      = 1;
            ScrollArea rightArea = new ScrollArea(190, 60, 390, 380, true);

            // FPS
            ScrollAreaItem fpsItem = new ScrollAreaItem();
            Label          text    = new Label("- FPS:", true, 1);

            fpsItem.Add(text);
            _sliderFPS = new HSliderBar(80, 5, 250, 15, 250, Engine.Profile.Current.MaxFPS, HSliderBarStyle.MetalWidgetRecessedBar, true, 1);
            fpsItem.Add(_sliderFPS);
            rightArea.Add(fpsItem);

            fpsItem = new ScrollAreaItem();
            text    = new Label("- Login FPS:", true, 1);
            fpsItem.Add(text);
            _sliderFPSLogin = new HSliderBar(80, 5, 250, 15, 250, Engine.GlobalSettings.MaxLoginFPS, HSliderBarStyle.MetalWidgetRecessedBar, true, 1);
            fpsItem.Add(_sliderFPSLogin);
            rightArea.Add(fpsItem);

            // Highlight
            _highlightObjects = CreateCheckBox(rightArea, "Highlight game objects", Engine.Profile.Current.HighlightGameObjects, 0, 10);

            //// smooth movements
            //_smoothMovements = new Checkbox(0x00D2, 0x00D3, "Smooth movements", 1)
            //{
            //    IsChecked = Engine.Profile.Current.SmoothMovements
            //};
            //rightArea.AddChildren(_smoothMovements);

            _enablePathfind = CreateCheckBox(rightArea, "Enable pathfinding", Engine.Profile.Current.EnablePathfind, 0, 0);
            _alwaysRun      = CreateCheckBox(rightArea, "Always run", Engine.Profile.Current.AlwaysRun, 0, 0);
            _preloadMaps    = CreateCheckBox(rightArea, "Preload maps (it increases the RAM usage)", Engine.GlobalSettings.PreloadMaps, 0, 0);
            _enableTopbar   = CreateCheckBox(rightArea, "Disable the Menu Bar", Engine.Profile.Current.TopbarGumpIsDisabled, 0, 0);

            // show % hp mobile
            ScrollAreaItem hpAreaItem = new ScrollAreaItem();

            text = new Label("- Mobiles HP", true, 1)
            {
                Y = 10
            };
            hpAreaItem.Add(text);

            _showHpMobile = new Checkbox(0x00D2, 0x00D3, "Show HP", 1)
            {
                X = 25, Y = 30, IsChecked = Engine.Profile.Current.ShowMobilesHP
            };
            hpAreaItem.Add(_showHpMobile);
            int mode = Engine.Profile.Current.MobileHPType;

            if (mode < 0 || mode > 2)
            {
                mode = 0;
            }

            _hpComboBox = new Combobox(200, 30, 150, new[]
            {
                "Percentage", "Line", "Both"
            }, mode);
            hpAreaItem.Add(_hpComboBox);
            rightArea.Add(hpAreaItem);

            // highlight character by flags

            ScrollAreaItem highlightByFlagsItem = new ScrollAreaItem();

            text = new Label("- Mobiles status", true, 1)
            {
                Y = 10
            };
            highlightByFlagsItem.Add(text);

            _highlightByState = new Checkbox(0x00D2, 0x00D3, "Highlight by state\n(poisoned, yellow hits, paralyzed)", 1)
            {
                X = 25, Y = 30, IsChecked = Engine.Profile.Current.HighlightMobilesByFlags
            };
            highlightByFlagsItem.Add(_highlightByState);
            rightArea.Add(highlightByFlagsItem);


            _drawRoofs      = CreateCheckBox(rightArea, "Draw roofs", Engine.Profile.Current.DrawRoofs, 0, 20);
            _treeToStumps   = CreateCheckBox(rightArea, "Tree to stumps", Engine.Profile.Current.TreeToStumps, 0, 0);
            _hideVegetation = CreateCheckBox(rightArea, "Hide vegetation", Engine.Profile.Current.HideVegetation, 0, 0);

            hpAreaItem = new ScrollAreaItem();
            text       = new Label("- Fields: ", true, 1)
            {
                Y = 10,
            };
            hpAreaItem.Add(text);


            _normalFields = new RadioButton(0, 0x00D0, 0x00D1, "Normal fields", 1)
            {
                X         = 25,
                Y         = 30,
                IsChecked = Engine.Profile.Current.FieldsType == 0,
            };
            hpAreaItem.Add(_normalFields);
            _staticFields = new RadioButton(0, 0x00D0, 0x00D1, "Static fields", 1)
            {
                X         = 25,
                Y         = 30 + _normalFields.Height,
                IsChecked = Engine.Profile.Current.FieldsType == 1
            };
            hpAreaItem.Add(_staticFields);
            _fieldsToTile = new RadioButton(0, 0x00D0, 0x00D1, "Tile fields", 1)
            {
                X         = 25,
                Y         = 30 + _normalFields.Height * 2,
                IsChecked = Engine.Profile.Current.FieldsType == 2
            };
            hpAreaItem.Add(_fieldsToTile);

            rightArea.Add(hpAreaItem);


            _noColorOutOfRangeObjects = CreateCheckBox(rightArea, "No color for object out of range", Engine.Profile.Current.NoColorObjectsOutOfRange, 0, 0);


            hpAreaItem = new ScrollAreaItem();
            text       = new Label("- Circle of Transparency:", true, 1)
            {
                Y = 10
            };
            hpAreaItem.Add(text);

            _circleOfTranspRadius = new HSliderBar(160, 15, 100, Constants.MIN_CIRCLE_OF_TRANSPARENCY_RADIUS, Constants.MAX_CIRCLE_OF_TRANSPARENCY_RADIUS, Engine.Profile.Current.CircleOfTransparencyRadius, HSliderBarStyle.MetalWidgetRecessedBar, true, 1);
            hpAreaItem.Add(_circleOfTranspRadius);

            _useCircleOfTransparency = new Checkbox(0x00D2, 0x00D3, "Enable circle of transparency", 1)
            {
                X         = 25,
                Y         = 30,
                IsChecked = Engine.Profile.Current.UseCircleOfTransparency
            };
            hpAreaItem.Add(_useCircleOfTransparency);

            rightArea.Add(hpAreaItem);
            Add(rightArea, PAGE);
        }
Beispiel #29
0
        private Control GetVariableEditor(IDictionary variable)
        {
            var value  = variable["Value"];
            var name   = (string)variable["Name"];
            var editor = variable["Editor"] as string;
            var type   = value.GetType();

            if (type == typeof(DateTime) ||
                (!string.IsNullOrEmpty(editor) &&
                 (editor.IndexOf("date", StringComparison.OrdinalIgnoreCase) > -1 ||
                  editor.IndexOf("time", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var dateTimePicker = new DateTimePicker
                {
                    ID       = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                    ShowTime = (variable["ShowTime"] != null && (bool)variable["ShowTime"]) ||
                               (!string.IsNullOrEmpty(editor) &&
                                editor.IndexOf("time", StringComparison.OrdinalIgnoreCase) > -1)
                };
                if (value is DateTime)
                {
                    var date = (DateTime)value;
                    if (date != DateTime.MinValue && date != DateTime.MaxValue)
                    {
                        dateTimePicker.Value = date.Kind != DateTimeKind.Utc
                            ? DateUtil.ToIsoDate(TypeResolver.Resolve <IDateConverter>().ToServerTime(date))
                            : DateUtil.ToIsoDate(date);
                    }
                }
                else
                {
                    dateTimePicker.Value = value as string ?? string.Empty;
                }
                return(dateTimePicker);
            }

            if (!string.IsNullOrEmpty(editor) && editor.IndexOf("rule", StringComparison.OrdinalIgnoreCase) > -1)
            {
                var editorId = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_");
                Sitecore.Context.ClientPage.ServerProperties[editorId] = value;

                var rulesBorder = new Border
                {
                    Class = "rulesWrapper",
                    ID    = editorId
                };

                var rulesEditButton = new Button
                {
                    Header = Texts.PowerShellMultiValuePrompt_GetVariableEditor_Edit_rule,
                    Class  = "scButton edit-button rules-edit-button",
                    Click  = "EditConditionClick(\\\"" + editorId + "\\\")"
                };

                rulesBorder.Controls.Add(rulesEditButton);
                var rulesRender = new Literal
                {
                    ID   = editorId + "_renderer",
                    Text = GetRuleConditionsHtml(
                        string.IsNullOrEmpty(value as string) ? "<ruleset />" : value as string)
                };
                rulesRender.Class = rulesRender.Class + " varRule";
                rulesBorder.Controls.Add(rulesRender);
                return(rulesBorder);
            }

            if (!string.IsNullOrEmpty(editor) &&
                (editor.IndexOf("treelist", StringComparison.OrdinalIgnoreCase) > -1 ||
                 (editor.IndexOf("multilist", StringComparison.OrdinalIgnoreCase) > -1) ||
                 (editor.IndexOf("droplist", StringComparison.OrdinalIgnoreCase) > -1) ||
                 (editor.IndexOf("droptree", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                Item item     = null;
                var  strValue = string.Empty;
                if (value is Item)
                {
                    item     = (Item)value;
                    strValue = item.ID.ToString();
                }
                else if (value is IEnumerable <object> )
                {
                    var items = (value as IEnumerable <object>).Cast <Item>().ToList();
                    item     = items.FirstOrDefault();
                    strValue = string.Join("|", items.Select(i => i.ID.ToString()).ToArray());
                }

                var dbName = item == null ? Sitecore.Context.ContentDatabase.Name : item.Database.Name;
                if (editor.IndexOf("multilist", StringComparison.OrdinalIgnoreCase) > -1)
                {
                    var multiList = new MultilistExtended
                    {
                        ID       = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                        Value    = strValue,
                        Database = dbName,
                        ItemID   = ItemIDs.RootID.ToString(),
                        Source   = variable["Source"] as string ?? "/sitecore",
                    };
                    multiList.SetLanguage(Sitecore.Context.Language.Name);

                    multiList.Class += "  treePicker";
                    return(multiList);
                }

                if (editor.IndexOf("droplist", StringComparison.OrdinalIgnoreCase) > -1)
                {
                    if (Sitecore.Context.ContentDatabase?.Name != dbName)
                    {
                        // this control will crash if if content database is different than the items fed to it.
                        return(new Literal
                        {
                            Text = "<span style='color: red'>" +
                                   Translate.Text(
                                Texts
                                .PowerShellMultiValuePrompt_GetVariableEditor_DropList_control_cannot_render_items_from_the_database___0___because_it_its_not_the_same_as___1___which_is_the_current_content_database__,
                                dbName, Sitecore.Context.ContentDatabase?.Name) + "</span>",
                            Class = "varHint"
                        });
                    }
                    var lookup = new LookupEx
                    {
                        ID           = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                        Database     = dbName,
                        ItemID       = item?.ID.ToString() ?? ItemIDs.RootID.ToString(),
                        Source       = variable["Source"] as string ?? "/sitecore",
                        ItemLanguage = Sitecore.Context.Language.Name,
                        Value        = item?.ID.ToString() ?? ItemIDs.RootID.ToString()
                    };
                    lookup.Class += " textEdit";
                    return(lookup);
                }

                if (editor.IndexOf("droptree", StringComparison.OrdinalIgnoreCase) > -1)
                {
                    var tree = new Tree
                    {
                        ID           = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                        Database     = dbName,
                        ItemID       = item?.ID.ToString() ?? ItemIDs.Null.ToString(),
                        Source       = variable["Source"] as string ?? "",
                        ItemLanguage = Sitecore.Context.Language.Name,
                        Value        = item?.ID.ToString() ?? ""
                    };
                    tree.Class += " textEdit";
                    return(tree);
                }
                var treeList = new TreeList
                {
                    ID    = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                    Value = strValue,
                    AllowMultipleSelection = true,
                    DatabaseName           = dbName,
                    Database         = dbName,
                    Source           = variable["Source"] as string ?? "/sitecore",
                    DisplayFieldName = variable["DisplayFieldName"] as string ?? "__DisplayName"
                };
                treeList.Class += " treePicker";
                return(treeList);
            }
            if (type == typeof(Item) ||
                (!string.IsNullOrEmpty(editor) && (editor.IndexOf("item", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var item       = value as Item;
                var source     = variable["Source"] as string;
                var root       = variable["Root"] as string;
                var sourceRoot = string.IsNullOrEmpty(source)
                    ? "/sitecore"
                    : StringUtil.ExtractParameter("DataSource", source);
                var dataContext = item != null
                    ? new DataContext
                {
                    DefaultItem  = item.Paths.Path,
                    ID           = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("dataContext"),
                    Parameters   = string.IsNullOrEmpty(source) ? "databasename=" + item.Database.Name : source,
                    DataViewName = "Master",
                    Root         = string.IsNullOrEmpty(root) ? sourceRoot : root,
                    Database     = item.Database.Name,
                    Selected     = new[] { new DataUri(item.ID, item.Language, item.Version) },
                    Folder       = item.ID.ToString(),
                    Language     = item.Language,
                    Version      = item.Version
                }
                    : new DataContext
                {
                    ID           = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("dataContext"),
                    Parameters   = string.IsNullOrEmpty(source) ? "databasename=master" : source,
                    DataViewName = "Master",
                    Root         = string.IsNullOrEmpty(root) ? sourceRoot : root
                };

                DataContextPanel.Controls.Add(dataContext);

                var treePicker = new TreePicker
                {
                    ID    = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                    Value = item != null?item.ID.ToString() : string.Empty,
                                DataContext = dataContext.ID,
                                AllowNone   =
                                    !string.IsNullOrEmpty(editor) &&
                                    (editor.IndexOf("allownone", StringComparison.OrdinalIgnoreCase) > -1)
                };
                treePicker.Class += " treePicker";
                return(treePicker);
            }

            if (type == typeof(bool) ||
                (!string.IsNullOrEmpty(editor) && (editor.IndexOf("bool", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var checkboxBorder = new Border
                {
                    Class = "checkBoxWrapper",
                    ID    = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_")
                };
                var checkBox = new Checkbox
                {
                    ID          = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                    Header      = (string)variable["Title"],
                    HeaderStyle = "display:inline-block;",
                    Checked     = (bool)value,
                    Class       = "varCheckbox"
                };
                checkboxBorder.Controls.Add(checkBox);
                return(checkboxBorder);
            }

            if (!string.IsNullOrEmpty(editor))
            {
                var showRoles = editor.IndexOf("role", StringComparison.OrdinalIgnoreCase) > -1;
                var showUsers = editor.IndexOf("user", StringComparison.OrdinalIgnoreCase) > -1;
                var multiple  = editor.IndexOf("multiple", StringComparison.OrdinalIgnoreCase) > -1;
                if (showRoles || showUsers)
                {
                    var picker = new UserPicker();
                    picker.Style.Add("float", "left");
                    picker.ID     = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_");
                    picker.Class += " scContentControl textEdit clr" + value.GetType().Name;
                    picker.Value  = value is IEnumerable <object>
                                    ?string.Join("|", ((IEnumerable <object>)value).Select(x => x.ToString()).ToArray())
                                        : value.ToString();

                    picker.ExcludeRoles = !showRoles;
                    picker.ExcludeUsers = !showUsers;
                    picker.DomainName   = variable["Domain"] as string ?? variable["DomainName"] as string;
                    picker.Multiple     = multiple;
                    picker.Click        = "UserPickerClick(" + picker.ID + ")";
                    return(picker);
                }
            }

            Sitecore.Web.UI.HtmlControls.Control edit;
            if (!string.IsNullOrEmpty(editor) && editor.IndexOf("info", StringComparison.OrdinalIgnoreCase) > -1)
            {
                return(new Literal {
                    Text = value.ToString(), Class = "varHint"
                });
            }

            if (variable["lines"] != null && ((int)variable["lines"] > 1))
            {
                edit = new Memo();
                edit.Attributes.Add("rows", variable["lines"].ToString());
                var placeholder = variable["Placeholder"];
                if (placeholder is string)
                {
                    edit.Attributes.Add("Placeholder", placeholder.ToString());
                }
            }
            else if (variable["Options"] != null)
            {
                var psOptions = variable["Options"].BaseObject();
                var options   = new OrderedDictionary();
                if (psOptions is OrderedDictionary)
                {
                    options = psOptions as OrderedDictionary;
                }
                else if (psOptions is string)
                {
                    var strOptions = ((string)variable["Options"]).Split('|');
                    var i          = 0;
                    while (i < strOptions.Length)
                    {
                        options.Add(strOptions[i++], strOptions[i++]);
                    }
                }
                else if (psOptions is Hashtable)
                {
                    var hashOptions = variable["Options"] as Hashtable;
                    foreach (var key in hashOptions.Keys)
                    {
                        options.Add(key, hashOptions[key]);
                    }
                }
                else
                {
                    throw new Exception("Checklist options format unrecognized.");
                }

                if (!string.IsNullOrEmpty(editor))
                {
                    if (editor.IndexOf("radio", StringComparison.OrdinalIgnoreCase) > -1)
                    {
                        var radioList = new Groupbox
                        {
                            ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                            // Header = (string) variable["Title"],
                            Class = "scRadioGroup"
                        };

                        foreach (var option in options.Keys)
                        {
                            var optionName  = option.ToString();
                            var optionValue = options[optionName].ToString();
                            var item        = new Radiobutton
                            {
                                Header  = optionName,
                                Value   = optionValue,
                                ID      = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID(radioList.ID),
                                Name    = radioList.ID,
                                Checked = optionValue == value.ToString()
                            };
                            radioList.Controls.Add(item);
                            radioList.Controls.Add(new Literal("<br/>"));
                        }

                        return(radioList);
                    }

                    if (editor.IndexOf("check", StringComparison.OrdinalIgnoreCase) > -1)
                    {
                        var checkBorder = new Border
                        {
                            Class = "checkListWrapper",
                            ID    = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_")
                        };
                        var editorId = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_");
                        var link     =
                            new Literal(
                                @"<div class='checkListActions'>" +
                                @"<a href='#' class='scContentButton' onclick=""javascript:return scForm.postEvent(this,event,'checklist:checkall(id=" +
                                editorId + @")')"">" + Translate.Text("Select all") + "</a> &nbsp;|&nbsp; " +
                                @"<a href='#' class='scContentButton' onclick=""javascript:return scForm.postEvent(this,event,'checklist:uncheckall(id=" +
                                editorId + @")')"">" + Translate.Text("Unselect all") + "</a> &nbsp;|&nbsp;" +
                                @"<a href='#' class='scContentButton' onclick=""javascript:return scForm.postEvent(this,event,'checklist:invert(id=" +
                                editorId + @")')"">" + Translate.Text("Invert selection") + "</a>" +
                                @"</div>");
                        checkBorder.Controls.Add(link);
                        var checkList = new PSCheckList
                        {
                            ID          = editorId,
                            HeaderStyle = "margin-top:20px; display:inline-block;",
                            ItemID      = ItemIDs.RootID.ToString()
                        };
                        checkList.SetItemLanguage(Sitecore.Context.Language.Name);
                        string[] values;
                        if (value is string)
                        {
                            values = value.ToString().Split('|');
                        }
                        else if (value is IEnumerable)
                        {
                            values =
                                (value as IEnumerable).Cast <object>()
                                .Select(s => s == null ? "" : s.ToString())
                                .ToArray();
                        }
                        else
                        {
                            values = new[] { value.ToString() };
                        }
                        foreach (var item in from object option in options.Keys
                                 select option.ToString()
                                 into optionName
                                 let optionValue = options[optionName].ToString()
                                                   select new ChecklistItem
                        {
                            ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID(checkList.ID),
                            Header = optionName,
                            Value = optionValue,
                            Checked = values.Contains(optionValue, StringComparer.OrdinalIgnoreCase)
                        })
                        {
                            checkList.Controls.Add(item);
                        }

                        checkList.TrackModified = false;
                        checkList.Disabled      = false;
                        checkBorder.Controls.Add(checkList);
                        return(checkBorder);
                    }
                }

                edit = new Combobox();
                var placeholder = variable["Placeholder"];
                if (placeholder is string)
                {
                    var option = new ListItem
                    {
                        Header   = placeholder.ToString(),
                        Value    = "",
                        Selected = true
                    };
                    edit.Controls.Add(option);
                }

                foreach (var option in options.Keys)
                {
                    var optionName  = option.ToString();
                    var optionValue = options[optionName].ToString();
                    var item        = new ListItem
                    {
                        Header = optionName,
                        Value  = optionValue
                    };
                    edit.Controls.Add(item);
                }
            }
            else
            {
                var placeholder = variable["Placeholder"];
                if (!string.IsNullOrEmpty(editor) && editor.IndexOf("pass", StringComparison.OrdinalIgnoreCase) > -1)
                {
                    edit = new PasswordExtended();
                    if (placeholder is string)
                    {
                        ((PasswordExtended)edit).PlaceholderText = placeholder.ToString();
                    }
                }
                else
                {
                    edit = new EditExtended();
                    if (placeholder is string)
                    {
                        ((EditExtended)edit).PlaceholderText = placeholder.ToString();
                    }
                }
            }
            var tip = variable["Tooltip"] as string;

            if (!string.IsNullOrEmpty(tip))
            {
                edit.ToolTip = tip.RemoveHtmlTags();
            }
            edit.Style.Add("float", "left");
            edit.ID     = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_");
            edit.Class += " scContentControl textEdit clr" + value.GetType().Name;
            edit.Value  = value.ToString();

            return(edit);
        }
Beispiel #30
0
        private void BuildVideo()
        {
            const int PAGE = 3;

            ScrollArea rightArea = new ScrollArea(190, 60, 390, 380, true);

            _debugControls      = CreateCheckBox(rightArea, "Debugging mode", Engine.GlobalSettings.Debug, 0, 0);
            _zoom               = CreateCheckBox(rightArea, "Enable in game zoom scaling", Engine.Profile.Current.EnableScaleZoom, 0, 0);
            _savezoom           = CreateCheckBox(rightArea, "Save scale after close game", Engine.Profile.Current.SaveScaleAfterClose, 0, 0);
            _gameWindowFullsize = CreateCheckBox(rightArea, "Always use fullsize game window", Engine.Profile.Current.GameWindowFullSize, 0, 0);


            ScrollAreaItem item = new ScrollAreaItem();
            Label          text = new Label("- Status gump type:", true, 0, 0, 1)
            {
                Y = 30
            };

            item.Add(text);

            _shardType = new Combobox(text.Width + 20, text.Y, 100, new[] { "Modern", "Old", "Outlands" })
            {
                SelectedIndex = Engine.GlobalSettings.ShardType
            };
            item.Add(_shardType);
            rightArea.Add(item);


            item = new ScrollAreaItem();

            _gameWindowWidth = CreateInputField(item, new TextBox(1, 5, 80, 80, false)
            {
                Text   = Engine.Profile.Current.GameWindowSize.X.ToString(),
                X      = 10,
                Y      = 105,
                Width  = 50,
                Height = 30
            }, "Game Play Window Size: ");

            _gameWindowHeight = CreateInputField(item, new TextBox(1, 5, 80, 80, false)
            {
                Text   = Engine.Profile.Current.GameWindowSize.Y.ToString(),
                X      = 80,
                Y      = 105,
                Width  = 50,
                Height = 30
            });

            _gameWindowLock = new Checkbox(0x00D2, 0x00D3, "Lock game window moving/resizing", 1)
            {
                X         = 140,
                Y         = 100,
                IsChecked = Engine.Profile.Current.GameWindowLock
            };

            item.Add(_gameWindowLock);

            _gameWindowPositionX = CreateInputField(item, new TextBox(1, 5, 80, 80, false)
            {
                Text   = Engine.Profile.Current.GameWindowPosition.X.ToString(),
                X      = 10,
                Y      = 160,
                Width  = 50,
                Height = 30
            }, "Game Play Window Position: ");

            _gameWindowPositionY = CreateInputField(item, new TextBox(1, 5, 80, 80, false)
            {
                Text   = Engine.Profile.Current.GameWindowPosition.Y.ToString(),
                X      = 80,
                Y      = 160,
                Width  = 50,
                Height = 30
            });



            rightArea.Add(item);

            Add(rightArea, PAGE);
        }
        private Control GetVariableEditor(IDictionary variable)
        {
            var value = variable["Value"];
            var name = (string) variable["Name"];
            var editor = variable["Editor"] as string;
            var type = value.GetType();

            if (type == typeof (DateTime) ||
                (!string.IsNullOrEmpty(editor) &&
                 (editor.IndexOf("date", StringComparison.OrdinalIgnoreCase) > -1 ||
                  editor.IndexOf("time", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var dateTimePicker = new DateTimePicker
                {
                    ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                    ShowTime = (variable["ShowTime"] != null && (bool) variable["ShowTime"]) ||
                               (!string.IsNullOrEmpty(editor) &&
                                editor.IndexOf("time", StringComparison.OrdinalIgnoreCase) > -1)
                };
                if (value is DateTime)
                {
                    var date = (DateTime) value;
                    if (date != DateTime.MinValue && date != DateTime.MaxValue)
                    {
                        dateTimePicker.Value = (date.Kind != DateTimeKind.Utc)
                            ? DateUtil.ToIsoDate(TypeResolver.Resolve<IDateConverter>("IDateConverter").ToServerTime(date))
                            : DateUtil.ToIsoDate(date);
                    }
                }
                else
                {
                    dateTimePicker.Value = value as string ?? string.Empty;
                }
                return dateTimePicker;
            }

            if (!string.IsNullOrEmpty(editor) && editor.IndexOf("rule", StringComparison.OrdinalIgnoreCase) > -1)
            {
                string editorId = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name+"_");
                Sitecore.Context.ClientPage.ServerProperties[editorId] = value;

                var rulesBorder = new Border
                {
                    Class = "rulesWrapper",
                    ID = editorId
                };

                Button rulesEditButton = new Button
                {
                    Header = "Edit rule",
                    Class = "scButton edit-button rules-edit-button",
                    Click = "EditConditionClick(\\\"" + editorId + "\\\")"
                };

                rulesBorder.Controls.Add(rulesEditButton);
                var rulesRender = new Literal
                {
                    ID = editorId + "_renderer",
                    Text = GetRuleConditionsHtml(
                        string.IsNullOrEmpty(value as string) ? "<ruleset />" : value as string)
                };
                rulesRender.Class = rulesRender.Class + " varRule";
                rulesBorder.Controls.Add(rulesRender);
                return rulesBorder;
            }

            if (!string.IsNullOrEmpty(editor) &&
                (editor.IndexOf("treelist", StringComparison.OrdinalIgnoreCase) > -1 ||
                 (editor.IndexOf("multilist", StringComparison.OrdinalIgnoreCase) > -1) ||
                 (editor.IndexOf("droplist", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                Item item = null;
                var strValue = string.Empty;
                if (value is Item)
                {
                    item = (Item) value;
                    strValue = item.ID.ToString();
                }
                else if (value is IEnumerable<object>)
                {
                    List<Item> items = (value as IEnumerable<object>).Cast<Item>().ToList();
                    item = items.FirstOrDefault();
                    strValue = string.Join("|", items.Select(i => i.ID.ToString()).ToArray());
                }

                var dbName = item == null ? Sitecore.Context.ContentDatabase.Name : item.Database.Name;
                if (editor.IndexOf("multilist", StringComparison.OrdinalIgnoreCase) > -1)
                {
                    var multiList = new MultilistExtended
                    {
                        ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                        Value = strValue,
                        Database = dbName,
                        ItemID = "{11111111-1111-1111-1111-111111111111}",
                        Source = variable["Source"] as string ?? "/sitecore",
                    };
                    multiList.SetLanguage(Sitecore.Context.Language.Name);

                    multiList.Class += "  treePicker";
                    return multiList;
                }

                if (editor.IndexOf("droplist", StringComparison.OrdinalIgnoreCase) > -1)
                {
                    var lookup = new LookupEx
                    {
                        ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                        Database = dbName,
                        ItemID = (item != null ? item.ID.ToString() : "{11111111-1111-1111-1111-111111111111}"),
                        Source = variable["Source"] as string ?? "/sitecore",
                        ItemLanguage = Sitecore.Context.Language.Name,
                        Value = (item != null ? item.ID.ToString() : "{11111111-1111-1111-1111-111111111111}")
                    };
                    lookup.Class += " textEdit";
                    return lookup;
                }
                var treeList = new TreeList
                {
                    ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                    Value = strValue,
                    AllowMultipleSelection = true,
                    DatabaseName = dbName,
                    Database = dbName,
                    Source = variable["Source"] as string ?? "/sitecore",
                    DisplayFieldName = variable["DisplayFieldName"] as string ?? "__DisplayName"
                };
                treeList.Class += " treePicker";
                return treeList;
            }
            if (type == typeof (Item) ||
                (!string.IsNullOrEmpty(editor) && (editor.IndexOf("item", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var item = value as Item;
                var source = variable["Source"] as string;
                var root = variable["Root"] as string;
                var sourceRoot = string.IsNullOrEmpty(source)
                    ? "/sitecore"
                    : StringUtil.ExtractParameter("DataSource", source);
                var dataContext = item != null
                    ? new DataContext
                    {
                        DefaultItem = item.Paths.Path,
                        ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("dataContext"),
                        Parameters = string.IsNullOrEmpty(source) ? "databasename=" + item.Database.Name : source,
                        DataViewName = "Master",
                        Root = string.IsNullOrEmpty(root) ? sourceRoot : root,
                        Database = item.Database.Name,
                        Selected = new[] {new DataUri(item.ID, item.Language, item.Version)},
                        Folder = item.ID.ToString(),
                        Language = item.Language,
                        Version = item.Version
                    }
                    : new DataContext
                    {
                        ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("dataContext"),
                        Parameters = string.IsNullOrEmpty(source) ? "databasename=master" : source,
                        DataViewName = "Master",
                        Root = string.IsNullOrEmpty(root) ? sourceRoot : root
                    };

                DataContextPanel.Controls.Add(dataContext);

                var treePicker = new TreePicker
                {
                    ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                    Value = item != null ? item.ID.ToString() : string.Empty,
                    DataContext = dataContext.ID,
                    AllowNone = !string.IsNullOrEmpty(editor) && (editor.IndexOf("allownone", StringComparison.OrdinalIgnoreCase) > -1)
                };
                treePicker.Class += " treePicker";
                return treePicker;
            }

            if (type == typeof (bool) ||
                (!string.IsNullOrEmpty(editor) && (editor.IndexOf("bool", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var checkboxBorder = new Border
                {
                    Class = "checkBoxWrapper",
                    ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_")
                };
                var checkBox = new Checkbox
                {
                    ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                    Header = (string) variable["Title"],
                    HeaderStyle = "display:inline-block;",
                    Checked = (bool) value,
                    Class = "varCheckbox"
                };
                checkboxBorder.Controls.Add(checkBox);
                return checkboxBorder;
            }

            if (!string.IsNullOrEmpty(editor))
            {
                var showRoles = editor.IndexOf("role", StringComparison.OrdinalIgnoreCase) > -1;
                var showUsers = editor.IndexOf("user", StringComparison.OrdinalIgnoreCase) > -1;
                var multiple = editor.IndexOf("multiple", StringComparison.OrdinalIgnoreCase) > -1;
                if (showRoles || showUsers)
                {
                    var picker = new UserPicker();
                    picker.Style.Add("float", "left");
                    picker.ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_");
                    picker.Class += " scContentControl textEdit clr" + value.GetType().Name;
                    picker.Value = (value is IEnumerable<object>) ? String.Join("|", ((IEnumerable<object>)value).Select(x => x.ToString()).ToArray()) : value.ToString();
                    picker.ExcludeRoles = !showRoles;
                    picker.ExcludeUsers = !showUsers;
                    picker.DomainName = variable["Domain"] as string ?? variable["DomainName"] as string;
                    picker.Multiple = multiple;
                    picker.Click = "UserPickerClick(" + picker.ID + ")";
                    return picker;
                }
            }

            Sitecore.Web.UI.HtmlControls.Control edit;
            if (!string.IsNullOrEmpty(editor) && editor.IndexOf("info", StringComparison.OrdinalIgnoreCase) > -1)
            {
                return new Literal {Text = value.ToString(), Class = "varHint"};
            }

            if (variable["lines"] != null && ((int) variable["lines"] > 1))
            {
                edit = new Memo();
                edit.Attributes.Add("rows", variable["lines"].ToString());
            }
            else if (variable["Options"] != null)
            {
                var psOptions = variable["Options"].BaseObject();
                var options = new OrderedDictionary();
                if (psOptions is OrderedDictionary)
                {
                    options = psOptions as OrderedDictionary;
                }
                else if (psOptions is string)
                {
                    var strOptions = ((string) variable["Options"]).Split('|');
                    var i = 0;
                    while (i < strOptions.Length)
                    {
                        options.Add(strOptions[i++], strOptions[i++]);
                    }
                }
                else if (psOptions is Hashtable)
                {
                    var hashOptions = variable["Options"] as Hashtable;
                    foreach (var key in hashOptions.Keys)
                    {
                        options.Add(key, hashOptions[key]);
                    }
                }
                else
                {
                    throw new Exception("Checklist options format unrecognized.");
                }

                if (!string.IsNullOrEmpty(editor))
                {
                    if (editor.IndexOf("radio", StringComparison.OrdinalIgnoreCase) > -1)
                    {
                        var radioList = new Groupbox
                        {
                            ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                            // Header = (string) variable["Title"],
                            Class = "scRadioGroup"
                        };

                        foreach (var option in options.Keys)
                        {
                            var optionName = option.ToString();
                            var optionValue = options[optionName].ToString();
                            var item = new Radiobutton
                            {
                                Header = optionName,
                                Value = optionValue,
                                ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID(radioList.ID),
                                Name = radioList.ID,
                                Checked = optionValue == value.ToString()
                            };
                            radioList.Controls.Add(item);
                            radioList.Controls.Add(new Literal("<br/>"));
                        }

                        return radioList;
                    }

                    if (editor.IndexOf("check", StringComparison.OrdinalIgnoreCase) > -1)
                    {
                        var checkList = new PSCheckList
                        {
                            ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_"),
                            HeaderStyle = "margin-top:20px; display:inline-block;",
                            ItemID = "{11111111-1111-1111-1111-111111111111}"
                        };
                        checkList.SetItemLanguage(Sitecore.Context.Language.Name);
                        string[] values;
                        if (value is string)
                        {
                            values = value.ToString().Split('|');
                        }
                        else if (value is IEnumerable)
                        {
                            values = ((value as IEnumerable).Cast<object>().Select(s => s == null ? "" : s.ToString())).ToArray();
                        }
                        else
                        {
                            values = new[] {value.ToString()};
                        }
                        foreach (var item in from object option in options.Keys
                            select option.ToString()
                            into optionName
                            let optionValue = options[optionName].ToString()
                            select new ChecklistItem
                            {
                                ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID(checkList.ID),
                                Header = optionName,
                                Value = optionValue,
                                Checked = values.Contains(optionValue, StringComparer.OrdinalIgnoreCase)
                            })
                        {
                            checkList.Controls.Add(item);
                        }

                        checkList.TrackModified = false;
                        checkList.Disabled = false;
                        return checkList;
                    }
                }

                edit = new Combobox();
                var placeholder = variable["Placeholder"];
                if (placeholder is string)
                {
                    var option = new ListItem
                    {
                        Header = placeholder.ToString(),
                        Value = "",
                        Selected = true
                    };
                    edit.Controls.Add(option);
                }

                foreach (var option in options.Keys)
                {
                    var optionName = option.ToString();
                    var optionValue = options[optionName].ToString();
                    var item = new ListItem
                    {
                        Header = optionName,
                        Value = optionValue
                    };
                    edit.Controls.Add(item);
                }
            }
            else
            {
                var placeholder = variable["Placeholder"];
                if (!string.IsNullOrEmpty(editor) && editor.IndexOf("pass", StringComparison.OrdinalIgnoreCase) > -1)
                {
                    edit = new PasswordExtended();
                    if (placeholder is string)
                    {
                        ((PasswordExtended)edit).PlaceholderText = placeholder.ToString();
                    }
                }
                else
                {
                    edit = new EditExtended();
                    if (placeholder is string)
                    {
                        ((EditExtended)edit).PlaceholderText = placeholder.ToString();
                    }
                }
            }
            var tip = (variable["Tooltip"] as string);
            if (!String.IsNullOrEmpty(tip))
            {
                edit.ToolTip = tip.RemoveHtmlTags();
            }
            edit.Style.Add("float", "left");
            edit.ID = Sitecore.Web.UI.HtmlControls.Control.GetUniqueID("variable_" + name + "_");
            edit.Class += " scContentControl textEdit clr" + value.GetType().Name;
            edit.Value = value.ToString();

            return edit;
        }
Beispiel #32
0
 public DaftarPrestasiController(DBINTEGRASI_MASTER_BAYUPPKU2Context context, DaftarPrestasiRepo repo, Combobox combobox)
 {
     _repo     = repo;
     _context  = context;
     _combobox = combobox;
 }
Beispiel #33
0
        private void BuildGeneral()
        {
            const int  PAGE      = 1;
            ScrollArea rightArea = new ScrollArea(190, 60, 390, 380, true);

            // FPS
            ScrollAreaItem fpsItem = new ScrollAreaItem();
            Label          text    = new Label("- FPS:", true, 1);

            fpsItem.AddChildren(text);
            HSliderBar sliderFPS = new HSliderBar(40, 5, 250, 15, 250, _settings.MaxFPS, HSliderBarStyle.MetalWidgetRecessedBar, true, 1);

            fpsItem.AddChildren(sliderFPS);
            rightArea.AddChildren(fpsItem);

            // Highlight
            Checkbox highlightObjects = new Checkbox(0x00D2, 0x00D3, "Highlight game objects", 1)
            {
                Y = 10, IsChecked = _settings.HighlightGameObjects
            };

            rightArea.AddChildren(highlightObjects);

            // smooth movements
            Checkbox smoothMovement = new Checkbox(0x00D2, 0x00D3, "Smooth movements", 1)
            {
                IsChecked = _settings.SmoothMovement
            };

            rightArea.AddChildren(smoothMovement);

            Checkbox enablePathfind = new Checkbox(0x00D2, 0x00D3, "Enable pathfinding", 1)
            {
                IsChecked = _settings.EnablePathfind
            };

            rightArea.AddChildren(enablePathfind);

            Checkbox alwaysRun = new Checkbox(0x00D2, 0x00D3, "Always run", 1)
            {
                IsChecked = _settings.EnablePathfind
            };

            rightArea.AddChildren(alwaysRun);

            // preload maps
            Checkbox preloadMaps = new Checkbox(0x00D2, 0x00D3, "Preload maps (it increases the RAM usage)", 1)
            {
                IsChecked = _settings.PreloadMaps
            };

            rightArea.AddChildren(preloadMaps);

            // show % hp mobile
            ScrollAreaItem hpAreaItem = new ScrollAreaItem();

            text = new Label("- Mobiles HP", true, 1)
            {
                Y = 10
            };
            hpAreaItem.AddChildren(text);

            Checkbox showHPMobile = new Checkbox(0x00D2, 0x00D3, "Show HP", 1)
            {
                X = 25, Y = 30, IsChecked = _settings.ShowMobilesHP
            };

            hpAreaItem.AddChildren(showHPMobile);
            int mode = _settings.ShowMobilesHPMode;

            if (mode < 0 || mode > 2)
            {
                mode = 0;
            }

            Combobox hpComboBox = new Combobox(200, 30, 150, new[]
            {
                "Percentage", "Line", "Both"
            }, mode);

            hpAreaItem.AddChildren(hpComboBox);
            rightArea.AddChildren(hpAreaItem);

            // highlight character by flags
            ScrollAreaItem highlightByFlagsItem = new ScrollAreaItem();

            text = new Label("- Mobiles status", true, 1)
            {
                Y = 10
            };
            highlightByFlagsItem.AddChildren(text);

            Checkbox highlightEnabled = new Checkbox(0x00D2, 0x00D3, "Highlight by state\n(poisoned, yellow hits, paralyzed)", 1)
            {
                X = 25, Y = 30, IsChecked = _settings.HighlightMobilesByFlags
            };

            highlightByFlagsItem.AddChildren(highlightEnabled);
            rightArea.AddChildren(highlightByFlagsItem);
            AddChildren(rightArea, PAGE);
        }
Beispiel #34
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginUser loginUser = new LoginUser(context, "ClientPoint");
                if (!loginUser.Pass)//权限验证
                {
                    return;
                }

                //加载DataGrid
                if (context.Request["action"] == "gridLoad")
                {
                    ClientPointBLL bll             = new ClientPointBLL(context, loginUser);
                    int            page            = int.Parse(context.Request["page"]);
                    int            rows            = int.Parse(context.Request["rows"]);
                    string         agentId         = context.Request["agentId"];
                    string         siteId          = context.Request["siteId"];
                    string         clientQuery     = context.Request["clientQuery"];
                    string         clientQueryText = context.Request["clientQueryText"];
                    string         startDate       = context.Request["startDate"];
                    string         endDate         = context.Request["endDate"];
                    string         sroState        = context.Request["sroState"];
                    bll.LoadGridCopy(page, rows, agentId, siteId, clientQuery, clientQueryText, startDate, endDate, sroState);
                    return;
                }
                //用户查找分类
                if (context.Request["action"] == "clientQueryListLoad")
                {
                    Combobox com = new Combobox(context, loginUser);
                    com.ClientQueryCombobox();
                }
                if (context.Request["action"] == "agentListLoad")
                {
                    Combobox com = new Combobox(context, loginUser);
                    com.AgentCombobox();
                }
                if (context.Request["action"] == "sroStateLoad")
                {
                    Combobox com = new Combobox(context, loginUser);
                    com.ScoreStaCombobox();
                }
                if (context.Request["action"] == "siteListLoad")
                {
                    Combobox com     = new Combobox(context, loginUser);
                    string   agentId = context.Request["agentId"];
                    com.SiteByAgentCombobox(agentId);
                }
                //加载信息
                if (context.Request["action"] == "load")
                {
                    ClientPointBLL bll    = new ClientPointBLL(context, loginUser);
                    long           flowId = long.Parse(context.Request["flowId"]);//编号
                    bll.Load(flowId);
                    return;
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }
    // Use this for initialization
    void Start()
    {
        landInfoListView = GameObject.Find ("LandListView").GetComponent<ListView> ();
        //landInfoListView = GameObject.Find ("ListView").GetComponent<ListView> ();
        CropInfoListView = GameObject.Find ("CropListView").GetComponent<ListView> ();
        dataReaderScript = GameObject.Find ("ScriptContainer").GetComponent<DataReader> ();
        textShowingOnCropInfoTab = GameObject.FindGameObjectWithTag ("CropInfoTabText").GetComponent<Text> ();
        textOnBuyLandBtn = GameObject.FindGameObjectWithTag ("TextOnBuyLandBtn").GetComponent<Text> ();
        //maxLevelDictionary stores the max level of each kind of crop
        maxLevelDictionary=new Dictionary<string, int>();
        //the current farmland information list
        currentFarmLandList = new List<FarmLandUnitOnTheList> ();
        maxLandQuantity = dataReaderScript.farmLandList.Count;//start from 1
        avilableLandComboBox = GameObject.Find ("Combobox").GetComponent<Combobox> ();
        comboBoxStringList = new List<string> ();
        farmLandInfoStringList = new List<string> ();
        sellBtn = GameObject.Find ("SellCropBtn").GetComponent<Button> ();

        textShowingOnCropInfoTab.text="Welcome to the Fantacsy Farmer Simulator!";

        loadInitialLandToListView ();
            //loadAllLandListToListView ();
        loadCropListToListView ();
        loadInitialComboBox ();

        sellBtn.gameObject.SetActive (false);
    }
Beispiel #36
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginUser loginUser = new LoginUser(context, "AgentOam");
                if (!loginUser.Pass)//权限验证
                {
                    return;
                }

                AgentBLL bll = new AgentBLL(context, loginUser);
                if (context.Request["action"] == "gridLoad")
                {
                    //加载DataGrid
                    int    page      = int.Parse(context.Request["page"]);
                    int    rows      = int.Parse(context.Request["rows"]);
                    string agentId   = context.Request["agentId"];
                    string agentName = context.Request["agentName"];
                    bll.LoadGrid(page, rows, agentName, agentId, "", ((int)AuditStauts.AuditSucces).ToString());
                }
                else if (context.Request["action"] == "areaListLoad")
                {
                    //加载区域列表
                    Combobox com = new Combobox(context, loginUser);
                    com.AreaCombobox();
                }
                else if (context.Request["action"] == "auditListLoad")
                {
                    //加载审核状态列表
                    Combobox com = new Combobox(context, loginUser);
                    com.AuditCombobox();
                }
                else if (context.Request["action"] == "load")
                {
                    //加载信息
                    bll.Load(context.Request["agentId"]);
                }
                else if (context.Request["action"] == "edit")
                {
                    //修改
                    TBAgent agent = new TBAgent();
                    agent.agentId     = context.Request["agentId"];
                    agent.agentName   = context.Request["agentName"];
                    agent.rebate      = double.Parse(context.Request["rebate"]);
                    agent.contact     = context.Request["contact"];
                    agent.telephone   = context.Request["telephone"];
                    agent.areaId      = context.Request["areaId"];
                    agent.address     = context.Request["address"];
                    agent.IDNumber    = context.Request["IDNumber"];
                    agent.bankCardId  = context.Request["bankCardId"];
                    agent.bankName    = context.Request["bankName"];
                    agent.status      = context.Request["status"];
                    agent.auditStatus = ((int)AuditStauts.AuditSucces).ToString();
                    agent.fixedLine   = context.Request["fixedLine"];
                    agent.remark      = context.Request["remark"];
                    agent.warnValue   = double.Parse(context.Request["warnValue"]);
                    bll.Edit(agent);
                }
                //密码重置
                if (context.Request["action"] == "pwdReset")
                {
                    string staffId = context.Request["agentId"];//员工编号
                    bll.PawReset(staffId, "0");
                    return;
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }