예제 #1
0
 public FacilitiesGroupService()
 {
     if (Page == null)
     {
         Page = new UiPage <FacilitiesGroupVM>("مجمع", "المجمعات", "FacilitiesGroupConfig");
         Page.Field("Name", "اسم المجمع", x => x?.Name, true);
         //AddFilter(vm.Country_Id, x => x.IndustrialCity.City.CountryID == vm.Country_Id);
         //AddFilter(vm.City_Id, x => x.IndustrialCity.City_Id == vm.City_Id);
         //AddFilter(vm.IndustrialCity_Id, x => x.IndustrialCity_Id == vm.IndustrialCity_Id);
         //AddFilter(vm.Name, x => x.Name == vm.Name);
         //AddFilter(vm.Lang, x => x.Lang == vm.Lang);
     }
     if (FormPage == null)
     {
         FormPage = new UiPage <FacilitiesGroupVM>(Page);
         FormPage.LookupParantSelect("Country_Id", "الدولة", x => x.IndustrialCity_Id, LookupType.IndustrialCity, 1, true);
         FormPage.LookupParantSelect("City_Id", "المدينة", x => x.IndustrialCity_Id, LookupType.IndustrialCity, 0, true, null, "Country_Id");
         FormPage.LookupSelect("IndustrialCity_Id", "المدينة الصناعية", x => x?.IndustrialCity_Id, LookupType.IndustrialCity, null, true, null, "City_Id");
         FormPage.Number("Lang", "الاحداثي س", x => x?.Lang, false);
         FormPage.Number("Late", "الاحداثي ص", x => x?.Late, false);
         FormPage.Number("ZoomLevel", "الزوم", x => x?.ZoomLevel, false);
         FormPage.Hidden("Id", x => x?.Id);
     }
     if (ListPage == null)
     {
         ListPage = new UiPage <FacilitiesGroupVM>(Page);
         ListPage.Number("Lang", "الاحداثي س", x => x?.Lang);
         ListPage.Number("Late", "الاحداثي ص", x => x?.Late);
         ListPage.Number("ZoomLevel", "الزوم", x => x?.ZoomLevel);
         ListPage.RowButtons.Add(new FormButton <FacilitiesGroupVM>("تعديل", "/FacilitiesGroupConfig/Set").AddParameter("id", x => x?.Id));
         ListPage.RowButtons.Add(new FormButton <FacilitiesGroupVM>("حذف", "/FacilitiesGroupConfig/Delete").AddParameter("id", x => x?.Id));
     }
 }
예제 #2
0
        public void SetSelectedPageAndNotify(object param)
        {
            string pageTitle = param as string;

            if (string.IsNullOrEmpty(pageTitle))
            {
                // TODO: Log an error.
                return;
            }

            UiPage page;

            if (pageTitle == FirstPageTitle)
            {
                page = UiPage.First;
            }
            else if (pageTitle == SecondPageTitle)
            {
                page = UiPage.Second;
            }
            else if (pageTitle == homePageTitle)
            {
                page = UiPage.Main;
            }
            else
            {
                // TODO: Log an error.
                return;
            }
            SelectedPage = page;
        }
        public void TestAnalyseParameters_初始状态()
        {
            UiPage page = new UiPage();

            Assert.IsNotNull(page.Parameters);
            Assert.AreEqual(false, page.IsHasParamters);
            Assert.AreEqual(0, page.Parameters.Count);
        }
        public void TestAnalyseParameters_一个参数的情况()
        {
            UiPage page = new UiPage();
            Dictionary <string, string> parameters = page.AnalyseParameters("p1=v1");

            Assert.IsNotNull(parameters);
            Assert.AreEqual(1, parameters.Count);
            Assert.AreEqual(true, parameters.ContainsKey("p1"));
            Assert.AreEqual("v1", parameters["p1"]);
        }
예제 #5
0
        public UiView ChangePasswordForm(long?id)
        {
            var ChangePassPage = new UiPage <UserAccountVM>()
            {
                Action = "Auth/ChangePasswordSave"
            };

            ChangePassPage.Hidden("Id", x => id);
            ChangePassPage.Password("Password", "كلمة المرور", x => x?.Password, true);
            ChangePassPage.Password("Password2", "تاكيد كلمة المرور", x => x?.Password2, true);
            return(new ViewBuilder <UserAccountVM>(ChangePassPage, null).Form());
        }
예제 #6
0
 public EmployeeService()
 {
     if (Page == null)
     {
         Page = new UiPage <EmployeeVM>("موظف", "الموظفين", "Employee");
         Page.Panels.AddRange(new string[] { "بيانات التواصل", "بيانات كلمة المرور", "الصلاحيات" });
         Page.Field("UserAccountVM[FullName]", "الاسم بالكامل", x => x?.UserAccount?.FullName, true, null, 12);
         Page.Field("UserAccountVM[UserName]", "اسم المستخدم", x => x?.UserAccount?.UserName, true);
         Page.Field("ADUsername", "الدليل النشط", x => x?.ADUsername, true);
         Page.Number("UserAccountVM[SSID]", "رقم الهوية", x => x?.UserAccount?.SSID, true);
         Include(x => x.UserAccount, x => x.UserAccount.IndustrialCities);
     }
     if (FormPage == null)
     {
         FormPage = new UiPage <EmployeeVM>(Page);
         FormPage.Field("UserAccountVM[FullName]", "الاسم بالكامل", x => x?.UserAccountVM?.FullName, true, null, 12);
         FormPage.Field("UserAccountVM[UserName]", "اسم المستخدم", x => x?.UserAccountVM?.UserName, true);
         FormPage.Field("ADUsername", "الدليل النشط", x => x?.ADUsername, true);
         FormPage.Number("UserAccountVM[SSID]", "رقم الهوية", x => x?.UserAccountVM?.SSID, true);
         FormPage.Hidden("Id", x => x?.Id);
         FormPage.Hidden("UserAccountVM[Id]", x => x?.UserAccountVM?.Id);
         FormPage.Email("UserAccountVM[Email]", "الايميل", x => x?.UserAccountVM?.Email, true, 0);
         FormPage.LookupSelect("Job_Id", "الوظيفة", x => x?.Job_Id, LookupType.Job, null, false, 0);
         FormPage.LookupSelect("UserAccountVM[CountryCode]", "كود الدولة", x => x?.UserAccountVM?.CountryCode, LookupType.CountryCode, null, true, 0);
         FormPage.Number("UserAccountVM[PhoneNumber]", "رقم الجوال", x => x?.UserAccountVM?.PhoneNumber, true, 0);
         FormPage.LookupSelect("UserAccountVM[IsEnabled]", "الحساب نشط", x => x?.UserAccountVM?.IsEnabled, LookupType.TrueFalse, null, true, 0);
         FormPage.Password("UserAccountVM[Password]", "كلمة المرور", x => "", true, 1, 6, x => x?.UserAccountVM?.UserName == null);
         FormPage.Password("UserAccountVM[Password2]", "تاكيد كلمة المرور", x => "", true, 1, 6, x => x?.UserAccountVM?.UserName == null);
         FormPage.LookupMulipleSelect("UserAccountVM[IndustrialCitiesIds]", "المدن الصناعية المصرح بها", x => x?.UserAccountVM?.IndustrialCities?.GetIds(), LookupType.IndustrialCity, null, true, 2, null, 12);
     }
     if (EditForm == null)
     {
         EditForm = new UiPage <EmployeeVM>(FormPage);
         EditForm.Remove("Password");
         EditForm.Remove("Password2");
     }
     if (ListPage == null)
     {
         ListPage = new UiPage <EmployeeVM>(Page)
         {
             RowButtonsGroup = true
         };
         ListPage.RowButtons.Add(new FormButton <EmployeeVM>("الملف الشخصي", "/Employee/Details").AddParameter("id", x => x?.Id));
         ListPage.RowButtons.Add(new FormButton <EmployeeVM>("تغير كلمة السر", "/Auth/ChangePassword", x => x?.UserAccount?.IsEnabled == 1).AddParameter("id", x => x?.UserAccount_Id));
         ListPage.RowButtons.Add(new FormButton <EmployeeVM>("تعديل", "/Employee/Set", x => x?.UserAccount?.IsEnabled == 1).AddParameter("id", x => x?.Id));
         ListPage.RowButtons.Add(new FormButton <EmployeeVM>("تنشيط", "/Auth/Activate", x => x?.UserAccount?.IsEnabled == 2).AddParameter("id", x => x?.UserAccount_Id));
         ListPage.RowButtons.Add(new FormButton <EmployeeVM>("حظر", "/Auth/DeActivate", x => x?.UserAccount?.IsEnabled == 1).AddParameter("id", x => x?.UserAccount_Id));
     }
     if (DetailsPage == null)
     {
         DetailsPage = new UiPage <EmployeeVM>(EditForm);
     }
 }
        public void TestAnalyseUrl_初始状态()
        {
            UiPage page = new UiPage();

            Assert.IsTrue(string.IsNullOrEmpty(page.OrginUrl));
            Assert.IsTrue(string.IsNullOrEmpty(page.OrginAppRelativeDirectory));
            Assert.IsTrue(string.IsNullOrEmpty(page.DomainName));
            Assert.IsTrue(string.IsNullOrEmpty(page.VirtualName));
            Assert.IsTrue(string.IsNullOrEmpty(page.RelativeDirectory));
            Assert.IsTrue(string.IsNullOrEmpty(page.FileName));
            Assert.IsFalse(page.IsHasParamters);
            Assert.IsTrue(string.IsNullOrEmpty(page.ParameterString));
        }
        public void TestAnalyseUrl_网站根目录的情况()
        {
            UiPage page = new UiPage();

            page.AnalyseUrl("http://localhost:808/TestStyles.aspx?a=a1", "~/");

            Assert.AreEqual("http://localhost:808/TestStyles.aspx?a=a1", page.OrginUrl);
            Assert.AreEqual("~/", page.OrginAppRelativeDirectory);
            Assert.AreEqual("localhost:808", page.DomainName);
            Assert.IsTrue(string.IsNullOrEmpty(page.VirtualName));
            Assert.AreEqual("/", page.RelativeDirectory);
            Assert.AreEqual("TestStyles.aspx", page.FileName);
            Assert.AreEqual("a=a1", page.ParameterString);
        }
예제 #9
0
 public UserAccountService()
 {
     if (Page == null)
     {
         Page = new UiPage <UserAccountVM>("حساب فرعي", "الحسابات التابعة للمستثمر", "Auth");
         Page.Panels.AddRange(new string[] { "بيانات التواصل", "بيانات كلمة المرور", "الصلاحيات", "بيانات المستثمر", "بيانات الموظف" });
         Page.Field("FullName", "الاسم بالكامل", x => x?.FullName, true, null, 12);
         Page.Field("UserName", "اسم المستخدم", x => x?.UserName, true);
         Page.Number("SSID", "رقم الهوية", x => x?.SSID, true);
         Include(x => x.Client, x => x.IndustrialCities, x => x.Employee);
     }
     if (FormPage == null)
     {
         FormPage = new UiPage <UserAccountVM>(Page);
         FormPage.Hidden("Id", x => x?.Id);
         FormPage.Email("Email", "الايميل", x => x?.Email, true, 0);
         FormPage.LookupSelect("CountryCode", "كود الدولة", x => x?.CountryCode, LookupType.CountryCode, null, true, 0);
         FormPage.Number("PhoneNumber", "رقم الجوال", x => x?.PhoneNumber, true, 0);
         FormPage.LookupSelect("IsEnabled", "الحساب نشط", x => x?.IsEnabled, LookupType.TrueFalse, null, true, 0);
         FormPage.Password("Password", "كلمة المرور", x => "", true, 1, 6, x => x?.UserName == null);
         FormPage.Password("Password2", "تاكيد كلمة المرور", x => "", true, 1, 6, x => x?.UserName == null);
         FormPage.LookupMulipleSelect("IndustrialCitiesIds", "المدن الصناعية المصرح بها", x => x?.IndustrialCities?.GetIds(), LookupType.IndustrialCity, null, true, 2, null, 12);
     }
     if (EditForm == null)
     {
         EditForm = new UiPage <UserAccountVM>(FormPage);
         EditForm.Remove("Password");
         EditForm.Remove("Password2");
     }
     if (ListPage == null)
     {
         ListPage = new UiPage <UserAccountVM>(Page)
         {
             RowButtonsGroup = true
         };
         ListPage.RowButtons.Add(new FormButton <UserAccountVM>("الملف الشخصي", "/Auth/Details").AddParameter("id", x => x?.Id));
         ListPage.RowButtons.Add(new FormButton <UserAccountVM>("تغير كلمة السر", "/Auth/ChangePassword", x => x.IsEnabled == 1).AddParameter("id", x => x?.Id));
         ListPage.RowButtons.Add(new FormButton <UserAccountVM>("تعديل", "/Auth/Set", x => x.IsEnabled == 1).AddParameter("id", x => x?.Id));
         ListPage.RowButtons.Add(new FormButton <UserAccountVM>("تنشيط", "/Auth/Activate", x => x.IsEnabled == 2).AddParameter("id", x => x?.Id));
         ListPage.RowButtons.Add(new FormButton <UserAccountVM>("حظر", "/Auth/DeActivate", x => x.IsEnabled == 1).AddParameter("id", x => x?.Id));
     }
     if (DetailsPage == null)
     {
         DetailsPage = new UiPage <UserAccountVM>(EditForm);
         DetailsPage.Field("clinetName", "اسم المستثمر", x => x?.Client?.FullName, false, 3);
         DetailsPage.Field("organization", "اسم المؤسسة/الشركة", x => x?.Client?.Organization, false, 3);
         DetailsPage.Field("clientSSID", "رقم هوية المستثمر", x => x?.Client?.SSID, false, 3);
     }
 }
        public void TestAnalyseUrl_根目录的情况()
        {
            UiPage page = new UiPage();

            page.AnalyseUrl("http://localhost:808/TaobaoShopHelper/TestStyles.aspx?a=a1", "~/");

            Assert.AreEqual("http://localhost:808/TaobaoShopHelper/TestStyles.aspx?a=a1", page.OrginUrl);
            Assert.AreEqual("~/", page.OrginAppRelativeDirectory);
            Assert.AreEqual("localhost:808", page.DomainName);
            Assert.AreEqual("TaobaoShopHelper", page.VirtualName);
            Assert.AreEqual("/", page.RelativeDirectory);
            Assert.AreEqual("TestStyles.aspx", page.FileName);
            Assert.AreEqual(true, page.IsHasParamters);
            Assert.AreEqual("a=a1", page.ParameterString);
        }
        public void TestAnalyseUrl_没有参数的情况()
        {
            UiPage page = new UiPage();

            page.AnalyseUrl("http://localhost:808/TaobaoShopHelper/TestPages/TestStyles.aspx", "~/TestPages/");

            Assert.AreEqual("http://localhost:808/TaobaoShopHelper/TestPages/TestStyles.aspx", page.OrginUrl);
            Assert.AreEqual("~/TestPages/", page.OrginAppRelativeDirectory);
            Assert.AreEqual("localhost:808", page.DomainName);
            Assert.AreEqual("TaobaoShopHelper", page.VirtualName);
            Assert.AreEqual("/TestPages/", page.RelativeDirectory);
            Assert.AreEqual("TestStyles.aspx", page.FileName);
            Assert.AreEqual(false, page.IsHasParamters);
            Assert.IsTrue(string.IsNullOrEmpty(page.ParameterString));
        }
예제 #12
0
        public FacilityService()
        {
            if (Page == null)
            {
                Page        = new UiPage <FacilityVM>("منشأة", "المنشأت", "Facility");
                Page.Panels = new List <string>(new string[] { "بيانات المنشأة", "بيانات النشاط السابق", "بيانات النشاط", "بيانات موقع المنشأة", "بيانات الاحداثيات والعنوان" });
                Include(x => x.FacilitiesGroup, x => x.IndustrialCity, x => x.Client, x => x.SubActivities);
            }
            if (FormPage == null)
            {
                FormPage = new UiPage <FacilityVM>(Page);
                FormPage.Hidden("Id", x => x?.Id);
                FormPage.Field("Name", "أسم المنشأة", x => x?.Name, true);
                FormPage.Number("Space", "المساحة", x => x?.Space, true);
                FormPage.Email("Email", "البريد الالكتروني", x => x?.Email, true);

                FormPage.LookupSelect("InternalOldActivity", "المنشاة لديها نشاط سابق داخل المدينة الصناعية", x => x?.InternalOldActivity, LookupType.TrueFalse, null, true, 1);
                FormPage.LookupSelect("ExternalOldActivity", "المنشاة لديها نشاط سابق خارج المدينة الصناعية", x => x?.ExternalOldActivity, LookupType.TrueFalse, null, true, 1);

                FormPage.LookupParantSelect("MainActivity_Id", "النشاط الرئيسي", x => x?.SubActivities?.GetIds(), LookupType.SubActivity, 0, true, 2);
                FormPage.LookupMulipleSelect("SubActivities2", "النشاط الفرعي", x => x?.SubActivities?.GetIds(), LookupType.SubActivity, null, true, 2, "MainActivity_Id");

                FormPage.LookupParantSelect("Country_Id", "الدولة", x => x?.IndustrialCity_Id, LookupType.IndustrialCity, 1, true, 3);
                FormPage.LookupParantSelect("City_Id", "المدينة", x => x?.IndustrialCity_Id, LookupType.IndustrialCity, 0, true, 3, "Country_Id");
                FormPage.LookupSelect("IndustrialCity_Id", "المدينة الصناعية", x => x?.IndustrialCity_Id, LookupType.IndustrialCity, null, true, 3, "City_Id");
                FormPage.LookupSelect("FacilitiesGroup_Id", "المجمع", x => x?.FacilitiesGroup_Id, LookupType.FacilitiesGroup, null, false, 3, "IndustrialCity_Id");
                FormPage.Field("OtherFacilitiesGroup", "مجمع او عقار اخر", x => x?.OtherFacilitiesGroup, false, 3);
                FormPage.Field("FacilitiesGroupOwner", "مالك العقار", x => x?.FacilitiesGroupOwner, false, 3);

                FormPage.Field("Address", "العنوان", x => x?.Address, false, 4);
                FormPage.Number("Lang", "الاحداثي س", x => x?.Lang, false, 4);
                FormPage.Number("Late", "الاحداثي ص", x => x?.Late, false, 4);
            }
            if (DetailsPage == null)
            {
                DetailsPage = new UiPage <FacilityVM>(FormPage);
            }
            if (ListPage == null)
            {
                ListPage = new UiPage <FacilityVM>(Page);
                ListPage.RowButtonsGroup = true;
                ListPage.Field("Name", "أسم المنشأة", x => x?.Name, true);
                ListPage.LookupSelect("IndustrialCity_Id", "المدينة الصناعية", x => x?.IndustrialCity_Id, LookupType.IndustrialCity, null, true, 3, "City_Id");
                ListPage.RowButtons.Add(new FormButton <FacilityVM>("عرض", "/Facility/Details").AddParameter("id", x => x?.Id));
                ListPage.RowButtons.Add(new FormButton <FacilityVM>("تعديل", "/Facility/Set").AddParameter("id", x => x?.Id));
                ListPage.RowButtons.Add(new FormButton <FacilityVM>("حذف", "/Facility/Delete").AddParameter("id", x => x?.Id));
            }
        }
예제 #13
0
파일: JobService.cs 프로젝트: eramax/MODON
 public JobService()
 {
     if (Page == null)
     {
         Page = new UiPage <JobVM>("وظيفة", "الوظائف", "JobConfig");
         Page.Field("Name", "الوظيفة", x => x?.Name, true);
         Page.Hidden("Id", x => x?.Id);
         Page.RowButtons.Add(new FormButton <JobVM>("تعديل", "/JobConfig/Set").AddParameter("id", x => x?.Id));
         Page.RowButtons.Add(new FormButton <JobVM>("حذف", "/JobConfig/Delete").AddParameter("id", x => x?.Id));
     }
     if (FormPage == null)
     {
         FormPage = Page;
     }
     if (ListPage == null)
     {
         ListPage = Page;
     }
 }
예제 #14
0
 public MainActivityService()
 {
     if (Page == null)
     {
         Page = new UiPage <MainActivityVM>("نشاط رئيسي", "الانشطة الرئيسية", "MainActivityConfig");
         Page.Field("Name", "اسم النشاط", x => x?.Name, true);
         Page.Hidden("Id", x => x?.Id);
         Page.RowButtons.Add(new FormButton <MainActivityVM>("تعديل", "/MainActivityConfig/Set").AddParameter("id", x => x?.Id));
         Page.RowButtons.Add(new FormButton <MainActivityVM>("حذف", "/MainActivityConfig/Delete").AddParameter("id", x => x?.Id));
     }
     if (FormPage == null)
     {
         FormPage = Page;
     }
     if (ListPage == null)
     {
         ListPage = Page;
     }
 }
예제 #15
0
        public MainMenuPage(UiHelper helper)
        {
            _restartPage = new RestartPage(helper, this);

            var labelHeader = new HeaderText("Главное меню");
            var label2      = new TextView("-------------------");
            var label       = new TextView("Тут написано что-то умное!");
            var list        = new ListView(
                new string[]
            {
                "Управлние стримом",
                "Что-нибудь еще"
            }
                );
            var button = new SimpleButton("\u2B07", async(reaction) =>
            {
                list.Index++;
                await UpdateView();
            });
            var button2 = new SimpleButton("\u2B06", async(reaction) =>
            {
                list.Index--;
                await UpdateView();
            });
            var button3 = new SimpleButton("\uD83C\uDD97", async(reaction) =>
            {
                if (list._index == 0)
                {
                    await helper.ClosePage(this);
                    await helper.DisplayPage(_restartPage, Root.Channel);
                }
            });

            AddElement(label);
            AddElement(label2);
            AddElement(list);
            AddElement(button2);
            AddElement(button);
            AddElement(button3);
            AddElement(labelHeader);
        }
예제 #16
0
 public SubActivityService()
 {
     if (Page == null)
     {
         Page = new UiPage <SubActivityVM>("نشاط فرعي", "الانشطة الفرعية", "SubActivityConfig");
         Page.Field("Name", "النشاط الفرعي", x => x?.Name, true);
         Page.LookupSelect("MainActivity_Id", "النشاط الرئيسي", x => x?.MainActivity_Id, LookupType.MainActivity, null, true);
         Include(x => x.MainActivity);
     }
     if (FormPage == null)
     {
         FormPage = new UiPage <SubActivityVM>(Page);
         FormPage.Hidden("Id", x => x?.Id);
     }
     if (ListPage == null)
     {
         ListPage = new UiPage <SubActivityVM>(Page);
         ListPage.RowButtons.Add(new FormButton <SubActivityVM>("تعديل", "/SubActivityConfig/Set").AddParameter("id", x => x?.Id));
         ListPage.RowButtons.Add(new FormButton <SubActivityVM>("حذف", "/SubActivityConfig/Delete").AddParameter("id", x => x?.Id));
     }
 }
예제 #17
0
 public CountryService()
 {
     if (Page == null)
     {
         Page = new UiPage <CountryVM>("دولة", "الدول", "CountryConfig");
         Page.Field("Name", "الدولة", x => x?.Name, true);
         Page.Number("Lang", "الاحداثي س", x => x?.Lang, false);
         Page.Number("Late", "الاحداثي ص", x => x?.Late, false);
         Page.Number("ZoomLevel", "الزوم", x => x?.ZoomLevel, false);
         Page.Hidden("Id", x => x?.Id);
         Page.RowButtons.Add(new FormButton <CountryVM>("تعديل", "/CountryConfig/Set").AddParameter("id", x => x?.Id));
         Page.RowButtons.Add(new FormButton <CountryVM>("حذف", "/CountryConfig/Delete").AddParameter("id", x => x?.Id));
     }
     if (FormPage == null)
     {
         FormPage = Page;
     }
     if (ListPage == null)
     {
         ListPage = Page;
     }
 }
예제 #18
0
 public RoleService()
 {
     if (Page == null)
     {
         Page = new UiPage <RoleVM>("مجموعة مستخدمين", "مجموعات المستخدمين", "RoleConfig");
         Page.Field("DisplayName", "اسم العرض", x => x?.DisplayName, true);
         Page.Field("Name", "الصلاحية", x => x?.Name, true);
         Page.RowButtons.Add(new FormButton <RoleVM>("تعديل", "/RoleConfig/Set").AddParameter("id", x => x?.Id));
         Page.RowButtons.Add(new FormButton <RoleVM>("حذف", "/RoleConfig/Delete").AddParameter("id", x => x?.Id));
         Include(x => x.Permissions);
     }
     if (FormPage == null)
     {
         FormPage = new UiPage <RoleVM>(Page);
         FormPage.Hidden("Id", x => x?.Id);
         FormPage.LookupMulipleSelect("PermissionsIds", "الصلاحيات", x => x?.Permissions?.GetIds(), LookupType.Permission, null, false);
     }
     if (ListPage == null)
     {
         ListPage = Page;
     }
 }
예제 #19
0
 public WorkerService()
 {
     if (Page == null)
     {
         Page        = new UiPage <WorkerVM>("العمالة ", "إدارة العمالة", "Worker");
         Page.Panels = new List <string>(new string[] { "المرفقات", });
         Page.Field("Name", "اسم العامل", x => x?.Name, true, null, 12);
         Page.Field("IDCardNumber", "رقم الهوية", x => x?.IDCardNumber, true);
         Page.LookupSelect("NationalityId", "الجنسية", x => x?.NationalityId, LookupType.Nationality, null, true);
         Page.LookupSelect("RelegionId", "الديانة", x => x?.RelegionId, LookupType.Relegion, null, true);
     }
     if (ListPage == null)
     {
         ListPage = new UiPage <WorkerVM>(Page);
         ListPage.RowButtonsGroup = true;
         ListPage.RowButtons.Add(new FormButton <WorkerVM>("عرض", "/Worker/Details").AddParameter("id", x => x?.Id));
         ListPage.RowButtons.Add(new FormButton <WorkerVM>("تعديل", "/Worker/Set").AddParameter("id", x => x?.Id));
         ListPage.RowButtons.Add(new FormButton <WorkerVM>("حذف", "/Worker/Delete").AddParameter("id", x => x?.Id));
     }
     if (FormPage == null)
     {
         FormPage = new UiPage <WorkerVM>(Page);
         FormPage.HijriDate("IDCardStartDate", "تاريخ اصدار الاقامة", x => x?.IDCardStartDate, true);
         FormPage.HijriDate("IDCardExpireDate", "تاريخ انتهاء الاقامة", x => x?.IDCardExpireDate, true);
         FormPage.Date("BirthDate", "تاريخ الميلاد", x => x?.BirthDate, true);
         FormPage.Number("PhoneNumber", "رقم الهاتف / الجوال", x => x?.PhoneNumber, true);
         FormPage.Field("JobName", "المهنة", x => x?.JobName, true);
         FormPage.LookupMulipleSelect("IndustrialCityId", "المدن الصناعية التى يعمل بها", x => x?.IndustrialCities, LookupType.IndustrialCity, null, true);
         FormPage.Field("EmployeerName", "اسم صاحب العمل / الكفيل", x => x?.EmployeerName, true);
         FormPage.FileInput("IDPictureFile", "إرفاق صورة هوية العامل", x => x?.IDPictureFile, true, 0);
         FormPage.FileInput("WorkerPictureFile", "إرفاق صورة شخصية العامل", x => x?.WorkerPictureFile, true, 0);
         FormPage.Hidden("Id", x => x?.Id);
     }
     if (DetailsPage == null)
     {
         DetailsPage = new UiPage <WorkerVM>(FormPage);
     }
 }
예제 #20
0
 public CityService()
 {
     if (Page == null)
     {
         Page = new UiPage <CityVM>("مدينة", "المدن", "CityConfig");
         Page.Field("Name", "المدينة", x => x?.Name, true);
         Page.LookupSelect("CountryID", "الدولة", x => x?.CountryID, LookupType.Country, null, true);
         Page.Number("Lang", "الاحداثي س", x => x?.Lang, false);
         Page.Number("Late", "الاحداثي ص", x => x?.Late, false);
         Page.Number("ZoomLevel", "الزوم", x => x?.ZoomLevel, false);
     }
     if (FormPage == null)
     {
         FormPage = new UiPage <CityVM>(Page);
         FormPage.Hidden("Id", x => x?.Id);
     }
     if (ListPage == null)
     {
         ListPage = new UiPage <CityVM>(Page);
         ListPage.RowButtons.Add(new FormButton <CityVM>("تعديل", "/CityConfig/Set").AddParameter("id", x => x?.Id));
         ListPage.RowButtons.Add(new FormButton <CityVM>("حذف", "/CityConfig/Delete").AddParameter("id", x => x?.Id));
     }
 }
예제 #21
0
        public FacilityOrderService()
        {
            if (Page == null)
            {
                Page        = new UiPage <AddFacilityOrderVM>("طلب موافقة مبدائية لانشاء منشأة ", "طلبات الموافقة المبدائية", "FacilityOrder");
                Page.Panels = new List <string>(new string[] { "بيانات المنشأة", "بيانات النشاط السابق", "بيانات النشاط", "بيانات موقع المنشأة", "بيانات الاحداثيات والعنوان", "قائمة المبيعات", "قائمة المرفقات المطلوبة" });
                Page.Field("Name", "أسم المنشأة", x => x?.Facility?.Name, true, null, 12);
                Page.LookupSelect("IndustrialCity_Id", "المدينة الصناعية", x => x?.Facility?.IndustrialCity_Id, LookupType.IndustrialCity, null, true, 3, "City_Id");
                Include(x => x.Facility, x => x.Facility.Client, x => x.Facility.SubActivities);
                //AddFilter(vm.Address, x => x.Facility.Address == vm.Address);
                //AddFilter(vm.Name, x => x.Facility.Name == vm.Name);
                //AddFilter(vm.Lang, x => x.Facility.Lang == vm.Lang);
                //AddFilter(vm.Country_Id, x => x.Facility.IndustrialCity.City.CountryID == vm.Country_Id);
                //AddFilter(vm.City_Id, x => x.Facility.IndustrialCity.City_Id == vm.City_Id);
                //AddFilter(vm.IndustrialCity_Id, x => x.Facility.IndustrialCity_Id == vm.IndustrialCity_Id);
                //AddFilter(vm.FacilitiesGroup_Id, x => x.Facility.FacilitiesGroup_Id == vm.FacilitiesGroup_Id);
            }
            if (FormPage == null)
            {
                FormPage = new UiPage <AddFacilityOrderVM>(Page);
                FormPage.Hidden("Id", x => x?.Id);
                FormPage.Hidden("Facility_Id", x => x?.Facility_Id);

                FormPage.Number("Space", "المساحة", x => x?.Facility?.Space, true);
                FormPage.Email("Email", "البريد الالكتروني", x => x?.Facility?.Email, true);

                FormPage.LookupSelect("InternalOldActivity", "المنشاة لديها نشاط سابق داخل المدينة الصناعية", x => x?.Facility?.InternalOldActivity, LookupType.TrueFalse, null, true, 1);
                FormPage.LookupSelect("ExternalOldActivity", "المنشاة لديها نشاط سابق خارج المدينة الصناعية", x => x?.Facility?.ExternalOldActivity, LookupType.TrueFalse, null, true, 1);

                FormPage.LookupParantSelect("MainActivity_Id", "النشاط الرئيسي", x => x?.Facility?.SubActivities?.GetIds(), LookupType.SubActivity, 0, true, 2);
                FormPage.LookupMulipleSelect("SubActivities2", "النشاط الفرعي", x => x?.Facility?.SubActivities?.GetIds(), LookupType.SubActivity, null, true, 2, "MainActivity_Id");

                FormPage.LookupParantSelect("Country_Id", "الدولة", x => x?.Facility?.IndustrialCity_Id, LookupType.IndustrialCity, 1, true, 3);
                FormPage.LookupParantSelect("City_Id", "المدينة", x => x?.Facility?.IndustrialCity_Id, LookupType.IndustrialCity, 0, true, 3, "Country_Id");
                FormPage.LookupSelect("FacilitiesGroup_Id", "المجمع", x => x?.Facility?.FacilitiesGroup_Id, LookupType.FacilitiesGroup, null, false, 3, "IndustrialCity_Id");
                FormPage.Field("OtherFacilitiesGroup", "مجمع او عقار اخر", x => x?.Facility?.OtherFacilitiesGroup, false, 3);
                FormPage.Field("FacilitiesGroupOwner", "مالك العقار", x => x?.Facility?.FacilitiesGroupOwner, false, 3);

                FormPage.Field("Address", "العنوان", x => x?.Facility?.Address, false, 4, 12);
                FormPage.Number("Lang", "الاحداثي س", x => x?.Facility?.Lang, false, 4);
                FormPage.Number("Late", "الاحداثي ص", x => x?.Facility?.Late, false, 4);

                FormPage.RepeaterInput("Sales", "", x => null, true, 5);

                FormPage.FileInput("CommcommercialID", "السجل التجاري", x => x?.CommcommercialID, true, 6);
                FormPage.FileInput("FacilitySpaceDesign", "مخطط كروكي لتصميم المنشأة", x => x?.FacilitySpaceDesign, true, 6);
                FormPage.MultipleFile("OtherFiles", "مرفقات اخري يمكنك اختيار اكثر من ملف", x => x?.OtherFiles, true, 6);
            }
            if (DetailsPage == null)
            {
                DetailsPage = new UiPage <AddFacilityOrderVM>(FormPage);
            }
            if (ListPage == null)
            {
                ListPage = new UiPage <AddFacilityOrderVM>(Page);
                ListPage.RowButtonsGroup = true;
                ListPage.RowButtons.Add(new FormButton <AddFacilityOrderVM>("عرض", "/FacilityOrder/Details").AddParameter("id", x => x?.Id));
                ListPage.RowButtons.Add(new FormButton <AddFacilityOrderVM>("تعديل", "/FacilityOrder/Set").AddParameter("id", x => x?.Id));
                ListPage.RowButtons.Add(new FormButton <AddFacilityOrderVM>("حذف", "/FacilityOrder/Delete").AddParameter("id", x => x?.Id));
            }
        }
예제 #22
0
        public YesNoDialog(string title, string text, Func <Task> yesAction, Func <Task> noAction, UiHelper helper, UiPage parent)
        {
            var labelHeader = new HeaderText(title);
            var label       = new TextView(text);

            var yesButton = new SimpleButton("\u2705", async(reaction) =>
            {
                await yesAction();
                await helper.SwitchPage(this, parent);
            });
            var noButton = new SimpleButton("\u274E", async(reaction) =>
            {
                await noAction();
                await helper.SwitchPage(this, parent);
            });

            AddElement(labelHeader);
            AddElement(label);

            AddElement(yesButton);
            AddElement(noButton);
        }
예제 #23
0
        public RestartPage(UiHelper helper, UiPage parentPage)
        {
            _parentPage = parentPage;

            var label       = new TextView("Перезапуск");
            var label2      = new TextView("-------------------");
            var labelHeader = new HeaderText("Управление стримом");
            var list        = new ListView(
                new string[]
            {
                "Частичный перезапуск",
                "Полный перезапуск",
                "Назад"
            }
                );
            var button = new SimpleButton("\u2B07", async(reaction) =>
            {
                list.Index++;
                await UpdateView();
            });
            var button2 = new SimpleButton("\u2B06", async(reaction) =>
            {
                list.Index--;
                await UpdateView();
            });
            var button3 = new SimpleButton("\uD83C\uDD97", async(reaction) =>
            {
                //await Root.Channel.SendMessageAsync(list.Value);
                if (list.Index == 2)
                {
                    await helper.ClosePage(this);
                    await helper.DisplayPage(_parentPage, Root.Channel);
                }

                if (list.Index == 1)
                {
                    await helper.SwitchPage(this, new YesNoDialog(
                                                "Перезапуск",
                                                "Вы точно хотите сделать полный перезапуск?",
                                                async() =>
                    {
                        ConsoleUtil.ExecuteProcess("./../hard_restart.sh");
                        await Root.Channel.SendMessageAsync("Полный перезапуск by " + reaction.User.Value.Username);
                    },
                                                async() =>
                    {
                        //await Root.Channel.SendMessageAsync("NO");
                    },
                                                helper,
                                                this
                                                ));
                }

                if (list.Index == 0)
                {
                    await helper.SwitchPage(this, new YesNoDialog(
                                                "Перезапуск",
                                                "Вы точно хотите сделать частичный перезапуск?",
                                                async() =>
                    {
                        ConsoleUtil.ExecuteProcess("./../soft_restart.sh");
                        await Root.Channel.SendMessageAsync("Частичный перезапуск by " + reaction.User.Value.Username);
                    },
                                                async() =>
                    {
                        //await Root.Channel.SendMessageAsync("NO");
                    },
                                                helper,
                                                this
                                                ));
                }
            });

            AddElement(label);
            AddElement(label2);
            AddElement(list);
            AddElement(button2);
            AddElement(button);
            AddElement(button3);
            AddElement(labelHeader);
        }