コード例 #1
0
        protected override void Awake()
        {
            base.Awake();

            LoadingIndicator.instance = this;

            if (this.introOutro && this.introOutro.Animation)
            {
                UICache.OptimizeAnimPairOnetime(this.introOutro);
            }
        }
コード例 #2
0
        /// <summary>
        /// 获取岗位
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void client_GetAllPostViewCompleted(object sender, GetAllPostViewCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        List <V_POST>    vpostList = e.Result.ToList();
                        List <T_HR_POST> entlist   = new List <T_HR_POST>();
                        foreach (var ent in vpostList)
                        {
                            T_HR_POST pt = new T_HR_POST();
                            pt.POSTID       = ent.POSTID;
                            pt.FATHERPOSTID = ent.FATHERPOSTID;
                            pt.CHECKSTATE   = ent.CHECKSTATE;
                            pt.EDITSTATE    = ent.EDITSTATE;

                            pt.T_HR_POSTDICTIONARY = new T_HR_POSTDICTIONARY();
                            // pt.T_HR_POSTDICTIONARY.POSTDICTIONARYID = ent.POSTDICTIONARYID;
                            pt.T_HR_POSTDICTIONARY.POSTNAME = ent.POSTNAME;

                            // pt.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
                            pt.T_HR_DEPARTMENT = allDepartments.Where(s => s.DEPARTMENTID == ent.DEPARTMENTID).FirstOrDefault();

                            //pt.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
                            //pt.T_HR_DEPARTMENT.DEPARTMENTID = ent.DEPARTMENTID;

                            //pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY = new T_HR_DEPARTMENTDICTIONARY();
                            //pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID = Guid.NewGuid().ToString();
                            // pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME = ent.DEPARTMENTNAME;

                            // pt.T_HR_DEPARTMENT.T_HR_COMPANY = new T_HR_COMPANY();
                            // pt.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID = ent.COMPANYID;
                            //  pt.T_HR_DEPARTMENT.T_HR_COMPANY.CNAME = ent.CNAME;

                            entlist.Add(pt);
                        }
                        UICache.CreateCache("ORGTREESYSPostInfo", entlist);
                    }
                    //  BindPosition();
                }
                else
                {
                    loadbar.Stop();
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                                                   Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                }
            }
            catch (Exception ex)
            {
            }
        }
コード例 #3
0
        protected override void OnEditorSetting()
        {
            if (!this.introOutro)
            {
                this.introOutro = new UICache(this.gameObject);
            }

            if (!this.objectAnim)
            {
                this.objectAnim = this.FindComponent <Animation>("Area/Content");
            }
        }
コード例 #4
0
        public ActionResult UpdateAboutUs()
        {
            UICache aboutUs = _context.UICaches.Find(Page.Home, PageComponent.Home_AboutUs, DataType.Html);

            if (aboutUs != null)
            {
                return(View(new HomeUIFooteViewModels {
                    FooterHtml = aboutUs.DataCache
                }));
            }

            return(View());
        }
コード例 #5
0
        public ActionResult UpdateFooter()
        {
            UICache footerHtml = _context.UICaches.Find(Page.Home, PageComponent.Home_Footer, DataType.Html);

            if (footerHtml != null)
            {
                return(View(new HomeUIFooteViewModels {
                    FooterHtml = footerHtml.DataCache
                }));
            }

            return(View());
        }
コード例 #6
0
        /// <summary>
        /// 获取正常的公司
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        void client_GetALLCompanyViewCompleted(object sender, GetALLCompanyViewCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result == null)
                {
                    return;
                }

                ObservableCollection <V_COMPANY> entTemps = e.Result;
                allCompanys = new List <T_HR_COMPANY>();
                allCompanys.Clear();
                var ents = entTemps.OrderBy(c => c.FATHERID);
                foreach (var ent in ents)
                {
                    T_HR_COMPANY company = new T_HR_COMPANY();
                    company.COMPANYID = ent.COMPANYID;
                    company.CNAME     = ent.CNAME;
                    company.ENAME     = ent.ENAME;
                    if (!string.IsNullOrEmpty(ent.BRIEFNAME))
                    {
                        company.BRIEFNAME = ent.BRIEFNAME;
                    }
                    else
                    {
                        company.BRIEFNAME = ent.CNAME;
                    }

                    company.COMPANRYCODE            = ent.COMPANRYCODE;
                    company.SORTINDEX               = ent.SORTINDEX;
                    company.T_HR_COMPANY2           = new T_HR_COMPANY();
                    company.T_HR_COMPANY2.COMPANYID = ent.FATHERCOMPANYID;
                    company.FATHERID    = ent.FATHERID;
                    company.FATHERTYPE  = ent.FATHERTYPE;
                    company.CHECKSTATE  = ent.CHECKSTATE;
                    company.EDITSTATE   = ent.EDITSTATE;
                    company.COMPANYTYPE = ent.COMPANYTYPE;
                    allCompanys.Add(company);
                }

                UICache.CreateCache("ORGTREESYSCompanyInfo", allCompanys);

                client.GetAllDepartmentViewAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
            }
            else
            {
                loadbar.Stop();
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
        }
コード例 #7
0
        protected override void OnEditorSetting()
        {
            base.OnEditorSetting();

            this.blindBase   = new UICache(this.FindObject("Blind"));
            this.touchLocked = new UICache(this.FindObject("TouchLock"));

            this.contentBase = new UICache(this.FindObjectInChildrenWithOptional("ContentBase;"));
            var contentObj = this.ContentBase.GameObject;

            this.EditorSetOnClickListener(this.btnOk     = new ButtonCache(contentObj.FindObject("BtnOk")));
            this.EditorSetOnClickListener(this.btnCancel = new ButtonCache(contentObj.FindObject("BtnCancel")));
            this.EditorSetOnClickListener(this.btnX      = new ButtonCache(contentObj.FindObject("BtnX")));
        }
コード例 #8
0
        public override void OnDoubleClick(Mobile m)
        {
            if (!this.CheckDoubleClick(m, true, false, 3) || !(m is PlayerMobile))
            {
                return;
            }

            var pm = (PlayerMobile)m;

            UICache ui = Users.FirstOrDefault(uic => uic.User == pm) ?? new UICache(pm);

            Users.AddOrReplace(ui);

            new RuneCodexGump(pm, this).Send();
        }
コード例 #9
0
        void client_GetCompanyViewCompleted(object sender, GetCompanyViewCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result == null)
                {
                    return;
                }

                ObservableCollection <V_COMPANY> entTemps = e.Result;
                allCompanys = new List <T_HR_COMPANY>();
                allCompanys.Clear();
                var ents = entTemps.OrderBy(c => c.FATHERID);
                foreach (var ent in ents)
                {
                    T_HR_COMPANY company = new T_HR_COMPANY();
                    company.COMPANYID = ent.COMPANYID;
                    company.CNAME     = ent.CNAME;
                    company.ENAME     = ent.ENAME;
                    if (!string.IsNullOrEmpty(ent.BRIEFNAME))
                    {
                        company.BRIEFNAME = ent.BRIEFNAME;
                    }
                    else
                    {
                        company.BRIEFNAME = ent.CNAME;
                    }

                    company.COMPANRYCODE            = ent.COMPANRYCODE;
                    company.SORTINDEX               = ent.SORTINDEX;
                    company.T_HR_COMPANY2           = new T_HR_COMPANY();
                    company.T_HR_COMPANY2.COMPANYID = ent.FATHERCOMPANYID;
                    company.FATHERID   = ent.FATHERID;
                    company.FATHERTYPE = ent.FATHERTYPE;
                    company.CHECKSTATE = ent.CHECKSTATE;
                    company.EDITSTATE  = ent.EDITSTATE;
                    allCompanys.Add(company);
                }

                UICache.CreateCache("ORGTREESYSCompanyInfo" + Perm + Entity, allCompanys);

                client.GetDepartmentViewAsync(CurrentUserID, Perm, Entity);
            }
            else
            {
                loadbar.Stop();
            }
        }
コード例 #10
0
        void client_GetPostViewCompleted(object sender, GetPostViewCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        List <V_POST>    vpostList = e.Result.ToList();
                        List <T_HR_POST> entlist   = new List <T_HR_POST>();
                        foreach (var ent in vpostList)
                        {
                            T_HR_POST pt = new T_HR_POST();
                            pt.POSTID       = ent.POSTID;
                            pt.FATHERPOSTID = ent.FATHERPOSTID;
                            pt.CHECKSTATE   = ent.CHECKSTATE;
                            pt.EDITSTATE    = ent.EDITSTATE;

                            pt.T_HR_POSTDICTIONARY = new T_HR_POSTDICTIONARY();
                            // pt.T_HR_POSTDICTIONARY.POSTDICTIONARYID = ent.POSTDICTIONARYID;
                            pt.T_HR_POSTDICTIONARY.POSTNAME = ent.POSTNAME;

                            // pt.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
                            pt.T_HR_DEPARTMENT = allDepartments.Where(s => s.DEPARTMENTID == ent.DEPARTMENTID).FirstOrDefault();

                            //pt.T_HR_DEPARTMENT = new T_HR_DEPARTMENT();
                            //pt.T_HR_DEPARTMENT.DEPARTMENTID = ent.DEPARTMENTID;

                            //pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY = new T_HR_DEPARTMENTDICTIONARY();
                            //pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID = Guid.NewGuid().ToString();
                            // pt.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME = ent.DEPARTMENTNAME;

                            // pt.T_HR_DEPARTMENT.T_HR_COMPANY = new T_HR_COMPANY();
                            // pt.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID = ent.COMPANYID;
                            //  pt.T_HR_DEPARTMENT.T_HR_COMPANY.CNAME = ent.CNAME;

                            entlist.Add(pt);
                        }
                        UICache.CreateCache("ORGTREESYSPostInfo" + Perm + Entity, entlist);
                    }
                    //  BindPosition();
                }
            }
            catch (Exception ex)
            {
            }
            loadbar.Stop();
        }
コード例 #11
0
ファイル: SysUsersManagement.xaml.cs プロジェクト: jjg0519/OA
 void orgClient_GetPostActivedCompleted(object sender, SMT.Saas.Tools.OrganizationWS.GetPostActivedCompletedEventArgs e)
 {
     if (e.Error != null && e.Error.Message != "")
     {
         Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message));
     }
     else
     {
         if (e.Result != null)
         {
             allPositions = e.Result.ToList();
         }
         UICache.CreateCache("SYS_PostInfo", allPositions);
         BindPosition();
     }
 }
コード例 #12
0
        /// <summary>
        /// 获取正常可用的部门
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void client_GetAllDepartmentViewCompleted(object sender, GetAllDepartmentViewCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result == null)
                {
                    return;
                }

                ObservableCollection <V_DEPARTMENT> entTemps = e.Result;
                allDepartments = new List <T_HR_DEPARTMENT>();
                allDepartments.Clear();
                var ents = entTemps.OrderBy(c => c.FATHERID);
                foreach (var ent in ents)
                {
                    T_HR_DEPARTMENT dep = new T_HR_DEPARTMENT();
                    dep.DEPARTMENTID = ent.DEPARTMENTID;
                    dep.FATHERID     = ent.FATHERID;
                    dep.FATHERTYPE   = ent.FATHERTYPE;
                    dep.T_HR_DEPARTMENTDICTIONARY = new T_HR_DEPARTMENTDICTIONARY();
                    dep.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID = ent.DEPARTMENTDICTIONARYID;
                    dep.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME         = ent.DEPARTMENTNAME;
                    //dep.T_HR_COMPANY = new T_HR_COMPANY();
                    //dep.T_HR_COMPANY.COMPANYID = ent.COMPANYID;
                    //dep.T_HR_COMPANY.CNAME = ent.CNAME;
                    dep.T_HR_COMPANY       = new T_HR_COMPANY();
                    dep.T_HR_COMPANY       = allCompanys.Where(s => s.COMPANYID == ent.COMPANYID).FirstOrDefault();
                    dep.DEPARTMENTBOSSHEAD = ent.DEPARTMENTBOSSHEAD;
                    dep.SORTINDEX          = ent.SORTINDEX;
                    dep.CHECKSTATE         = ent.CHECKSTATE;
                    dep.EDITSTATE          = ent.EDITSTATE;
                    allDepartments.Add(dep);
                }

                UICache.CreateCache("ORGTREESYSDepartmentInfo", allDepartments);

                BindCompany();

                client.GetAllPostViewAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
            }
            else
            {
                loadbar.Stop();
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
        }
コード例 #13
0
        public ActionResult UpdateTeamProperty(List <HomeUITeamViewModels> list)
        {
            try
            {
                using (DbContextTransaction transaction = _context.Database.BeginTransaction())
                {
                    StringBuilder sb = new StringBuilder();

                    list.ForEach(x => sb.Append(RenderPartialViewToString("~/Views/Home/_Team_Sidebar_Item.cshtml",
                                                                          SaveImage(x))));

                    UICache teamHtml = _context.UICaches.Find(Page.Property, PageComponent.Home_Team, DataType.Html);
                    if (teamHtml == null)
                    {
                        _context.UICaches.Add(
                            teamHtml = new UICache(Page.Property, PageComponent.Home_Team, DataType.Html));
                    }//create if html type is not existed
                    teamHtml.DataCache = sb.ToString();

                    UICache teamJson = _context.UICaches.Find(Page.Property, PageComponent.Home_Team, DataType.Json);
                    if (teamJson == null)
                    {
                        _context.UICaches.Add(
                            teamJson = new UICache(Page.Property, PageComponent.Home_Team, DataType.Json));
                    }//create if json type is not existed
                    teamJson.DataCache = JsonConvert.SerializeObject(list.Select(x =>
                                                                                 new HomeUITeamViewModels
                    {
                        ImagePath  = x.ImagePath,
                        ImageName  = x.ImageName,
                        IsUploaded = true,

                        Name = x.Name,
                    }).ToList());    //filter to avoid save image data(base64) to database

                    _context.SaveChanges();
                    transaction.Commit();
                }//end of transaction

                return(RedirectToAction(nameof(UpdateTeamProperty)));
            }
            catch (Exception)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError));
            }
        }
コード例 #14
0
ファイル: CompanyTree.xaml.cs プロジェクト: jjg0519/OA
 void client_GetPostAllCompleted(object sender, GetPostAllCompletedEventArgs e)
 {
     if (e.Error != null && e.Error.Message != "")
     {
         ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                                        Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
     }
     else
     {
         if (e.Result != null)
         {
             allPositions = e.Result.ToList();
         }
         UICache.CreateCache("ORGTREESYSPostInfoALL", allPositions);
         BindPosition();
     }
 }
コード例 #15
0
        public void Reset()
        {
            if (mTimer != null)
            {
                mTimer.Destroy();
                mTimer = null;
            }

            if (UICache != null)
            {
                UICache.Reset();
            }

            mTimer = new Utils.Timer((int)(mRealDestroyWinTime * 1000), true, Mathf.Infinity, RealTimerRemove);

            IsBackMainMapShowWin = "";
        }
コード例 #16
0
        public ActionResult UpdateService(HomeUIServiceViewModels service)
        {
            try
            {
                using (DbContextTransaction transaction = _context.Database.BeginTransaction())
                {
                    int           index = 0;
                    StringBuilder sb    = new StringBuilder();

                    sb.Append(RenderPartialViewToString("~/Views/Home/_Service_Section_Container.cshtml", service));
                    sb.Append("<div class='row'>");
                    service.Services.ToList().ForEach(x =>
                    {
                        ViewBag.Active = index++;
                        sb.Append(RenderPartialViewToString("~/Views/Home/_Service_Section_Container_Item.cshtml", x));
                    });
                    sb.Append("</div>");

                    UICache serviceHtml = _context.UICaches.Find(Page.Home, PageComponent.Home_Service, DataType.Html);
                    if (serviceHtml == null)
                    {
                        _context.UICaches.Add(
                            serviceHtml = new UICache(Page.Home, PageComponent.Home_Service, DataType.Html));
                    }//create if html type is not existed
                    serviceHtml.DataCache = sb.ToString();

                    UICache serviceJson = _context.UICaches.Find(Page.Home, PageComponent.Home_Service, DataType.Json);
                    if (serviceJson == null)
                    {
                        _context.UICaches.Add(
                            serviceJson = new UICache(Page.Home, PageComponent.Home_Service, DataType.Json));
                    }//create if json type is not existed
                    serviceJson.DataCache = JsonConvert.SerializeObject(service);

                    _context.SaveChanges();
                    transaction.Commit();
                }//end of transaction

                return(RedirectToAction(nameof(UpdateService)));
            }
            catch (Exception)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError));
            }
        }
コード例 #17
0
        void client_GetDepartmentViewCompleted(object sender, GetDepartmentViewCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result == null)
                {
                    return;
                }

                ObservableCollection <V_DEPARTMENT> entTemps = e.Result;
                allDepartments = new List <T_HR_DEPARTMENT>();
                allDepartments.Clear();
                var ents = entTemps.OrderBy(c => c.FATHERID);
                foreach (var ent in ents)
                {
                    T_HR_DEPARTMENT dep = new T_HR_DEPARTMENT();
                    dep.DEPARTMENTID = ent.DEPARTMENTID;
                    dep.FATHERID     = ent.FATHERID;
                    dep.FATHERTYPE   = ent.FATHERTYPE;
                    dep.T_HR_DEPARTMENTDICTIONARY = new T_HR_DEPARTMENTDICTIONARY();
                    dep.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTDICTIONARYID = ent.DEPARTMENTDICTIONARYID;
                    dep.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME         = ent.DEPARTMENTNAME;
                    //dep.T_HR_COMPANY = new T_HR_COMPANY();
                    //dep.T_HR_COMPANY.COMPANYID = ent.COMPANYID;
                    //dep.T_HR_COMPANY.CNAME = ent.CNAME;
                    dep.T_HR_COMPANY       = new T_HR_COMPANY();
                    dep.T_HR_COMPANY       = allCompanys.Where(s => s.COMPANYID == ent.COMPANYID).FirstOrDefault();
                    dep.DEPARTMENTBOSSHEAD = ent.DEPARTMENTBOSSHEAD;
                    dep.SORTINDEX          = ent.SORTINDEX;
                    dep.CHECKSTATE         = ent.CHECKSTATE;
                    dep.EDITSTATE          = ent.EDITSTATE;
                    allDepartments.Add(dep);
                }

                UICache.CreateCache("ORGTREESYSDepartmentInfo" + Perm + Entity, allDepartments);

                BindCompany();

                client.GetPostViewAsync(CurrentUserID, Perm, Entity);
            }
            else
            {
                loadbar.Stop();
            }
        }
コード例 #18
0
ファイル: BindOrgTree.cs プロジェクト: jjg0519/OA
        //void orgClient_GetDepartmentActivedByCompanyIDCompleted(object sender, SMT.Saas.Tools.OrganizationWS.GetDepartmentActivedByCompanyIDCompletedEventArgs e)
        //{

        //}

        void orgClient_GetPostActivedCompleted(object sender, SMT.Saas.Tools.OrganizationWS.GetPostActivedCompletedEventArgs e)
        {
            if (e.Error != null && e.Error.Message != "")
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
                return;
            }
            else
            {
                if (e.Result != null)
                {
                    allPositions = e.Result.ToList();
                }
                UICache.CreateCache("SYS_PostInfo", allPositions);
                //BindPosition();
            }
        }
コード例 #19
0
ファイル: SysFBAdmins.xaml.cs プロジェクト: jjg0519/OA
 void orgClient_GetPostActivedCompleted(object sender, SMT.Saas.Tools.OrganizationWS.GetPostActivedCompletedEventArgs e)
 {
     if (e.Error != null && e.Error.Message != "")
     {
         loadbar.Stop();//有错误停止转圈
         SMT.SAAS.Main.CurrentContext.AppContext.logAndShow("Views/SysUserManagement--GetDepartmentActived");
         ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"),
                                        Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
         return;
     }
     else
     {
         if (e.Result != null)
         {
             allPositions = e.Result.ToList();
         }
         UICache.CreateCache("SYS_PostInfo", allPositions);
     }
 }
コード例 #20
0
        public ActionResult UpdateOffer(List <HomeUIOfferViewModels> list)
        {
            try
            {
                using (DbContextTransaction transaction = _context.Database.BeginTransaction())
                {
                    int           index = 0;
                    StringBuilder sb    = new StringBuilder();

                    list.ForEach(x =>
                    {
                        ViewBag.Active = index++;
                        sb.Append(RenderPartialViewToString("~/Views/Home/_Offer_Part_Item.cshtml", x));
                    });

                    UICache offerHtml = _context.UICaches.Find(Page.Home, PageComponent.Home_Offer, DataType.Html);
                    if (offerHtml == null)
                    {
                        _context.UICaches.Add(
                            offerHtml = new UICache(Page.Home, PageComponent.Home_Offer, DataType.Html));
                    }//create if html type is not existed
                    offerHtml.DataCache = sb.ToString();

                    UICache offerJson = _context.UICaches.Find(Page.Home, PageComponent.Home_Offer, DataType.Json);
                    if (offerJson == null)
                    {
                        _context.UICaches.Add(
                            offerJson = new UICache(Page.Home, PageComponent.Home_Offer, DataType.Json));
                    }//create if json type is not existed
                    offerJson.DataCache = JsonConvert.SerializeObject(list);

                    _context.SaveChanges();
                    transaction.Commit();
                }//end of transaction

                return(RedirectToAction(nameof(UpdateOffer)));
            }
            catch (Exception)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError));
            }
        }
コード例 #21
0
        protected override void ResetProperties(UICache source_, List <SerializedProperty> properties, ref int index)
        {
            base.ResetProperties(source_, properties, ref index);

            var source = (ButtonCache)source_;

            properties[index++].objectReferenceValue = source.Button;
            var propLabel       = properties[index++];
            var propLabelElems  = propLabel.FindPropertyRelative("elems");
            var countLabelElems = propLabelElems.arraySize = source.Label.GetCount();

            for (int n = 0; n < countLabelElems; ++n)
            {
                var propLabelElem = propLabel.GetArrayElementAtIndex(n);
                propLabelElem.objectReferenceValue = source.Label.Get(n);
            }
            var propLabelAutoVisible = propLabel.FindPropertyRelative("autoVisibleWithValid");

            propLabelAutoVisible.boolValue = source.Label.IsAutoVisibleWithValid();
        }
コード例 #22
0
ファイル: HomeController.cs プロジェクト: hieuctfe/HS_Website
        public ActionResult Index()
        {
            IQueryable <Post>     posts      = _context.Posts.Include(x => x.Comments).Where(x => x.UIOption.IsDisplay);
            IQueryable <Property> properties = _context.Properties.Include(x => x.PropertyStatusCode)
                                               .Include(x => x.PropertyType).Where(x => x.UIOption.IsDisplay);

            List <Property> recentProperties = properties.OrderByDescending(x => x.ActivityLog.CreatedOn)
                                               .Take(9).ToList();
            List <Property> featuredProperties = properties.OrderByDescending(x => x.UIOption.DisplayOrder)
                                                 .Take(4).ToList();
            List <Post> recentPosts = posts.OrderByDescending(x => x.ActivityLog.CreatedOn)
                                      .Take(3).ToList();

            UICache banner     = _context.UICaches.Find(Page.Home, PageComponent.Home_Slider, DataType.Html);
            UICache offer      = _context.UICaches.Find(Page.Home, PageComponent.Home_Offer, DataType.Html);
            UICache service    = _context.UICaches.Find(Page.Home, PageComponent.Home_Service, DataType.Html);
            UICache achivement = _context.UICaches.Find(Page.Home, PageComponent.Home_Achivement, DataType.Html);
            UICache team       = _context.UICaches.Find(Page.Home, PageComponent.Home_Team, DataType.Html);
            UICache client     = _context.UICaches.Find(Page.Home, PageComponent.Home_Client, DataType.Html);

            ViewBag.SortList  = GetSortFields();
            ViewBag.Statuses  = GetPropertyStatusCodes(-1);
            ViewBag.Types     = GetPropertyTypes(-1);
            ViewBag.Cities    = GetCities(null);
            ViewBag.Districts = GetDistricts(null, null);

            return(View(new HomePageViewModels
            {
                BannerHtml = banner == null ? string.Empty : banner.DataCache,
                OfferHtml = offer == null ? string.Empty : offer.DataCache,
                ServiceHtml = service == null ? string.Empty : service.DataCache,
                AchivementHtml = achivement == null ? string.Empty : achivement.DataCache,
                TeamHtml = team == null ?  string.Empty : team.DataCache,
                ClientHtml = client == null ?  string.Empty : client.DataCache,

                RecentProperties = _converter.CreatePropertyViewModels(recentProperties).ToList(),
                FeaturedProperties = _converter.CreatePropertyViewModels(featuredProperties).ToList(),

                RecentPosts = _converter.CreatePostViewModels(recentPosts).ToList(),
            }));
        }
コード例 #23
0
        public ActionResult UpdateBannerBreadCum()
        {
            UICache bannerField = _context.UICaches.Find(Page.Home, PageComponent.Home_Banner, DataType.Field);

            if (bannerField != null)
            {
                ViewBag.BannerPath = !string.IsNullOrEmpty(bannerField.DataCache) ? JsonConvert.SerializeObject(new List <_ImageCropper>()
                {
                    new _ImageCropper
                    {
                        ImageData  = bannerField.DataCache,
                        ImagePath  = bannerField.DataCache,
                        ImageName  = bannerField.DataCache,
                        IsUploaded = true
                    }
                }) : string.Empty;
                return(View());
            }

            return(View());
        }
コード例 #24
0
        void client_GetCompanyByEntityPermCompleted(object sender, GetCompanyByEntityPermCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (e.Result == null)
                {
                    return;
                }

                ObservableCollection <T_HR_COMPANY> entTemps = e.Result;
                allCompanys = new List <T_HR_COMPANY>();
                allCompanys.Clear();
                var ents = entTemps.OrderBy(c => c.FATHERID);
                ents.ForEach(item =>
                {
                    allCompanys.Add(item);
                });

                UICache.CreateCache("SYS_DepartmentInfo", allCompanys);

                client.GetDepartmentByEntityPermAsync(CurrentUserID, Perm, Entity);
            }
        }
コード例 #25
0
 public void Dispose()
 {
     this.ClearUI();
     UICache.Dispose();
     cache = null;
 }
コード例 #26
0
        public ActionResult Index(int?statusId, int?typeId, PropertyPageViewModels data)
        {
            ViewBag.BannerImage = base.BreadCumImage;

            IQueryable <Property> properties = _context.Properties
                                               .Include(x => x.PropertyStatusCode).Include(x => x.PropertyType)
                                               .Where(x => x.UIOption.IsDisplay);

            var pager     = data.PropertyPagination;
            int pageIndex = pager.PageIndex,
                pageSize  = pager.PageSize;

            string sortFieldValue = $"{nameof(Property.Name)}"; //default order field;
            string orderByValue   = "asc";                      //default order by

            if (pager.IsSort)
            {
                sortFieldValue = pager.SortField;

                string[] segmentSort = sortFieldValue.Split('_');

                sortFieldValue = segmentSort[0];
                orderByValue   = segmentSort[1] == "asc" ? "asc" : "desc";
            }//end if check is sort field has value

            if (pager.IsSearch || statusId.HasValue || typeId.HasValue)
            {
                int.TryParse(pager.Bed, out int bedValue);
                int.TryParse(pager.Bath, out int bathValue);

                properties = properties.Where(x =>
                                              (statusId.HasValue ? x.PropertyStatusCodeId == statusId :
                                               string.IsNullOrEmpty(pager.Status) || x.PropertyStatusCodeId.ToString() == pager.Status) &&
                                              (typeId.HasValue ? x.PropertyTypeId == typeId :
                                               (string.IsNullOrEmpty(pager.Type) || x.PropertyTypeId.ToString() == pager.Type)) &&
                                              (string.IsNullOrEmpty(pager.Bed) || x.NumberOfBedRoom >= bedValue) &&
                                              (string.IsNullOrEmpty(pager.Bath) || x.NumberOfBathRoom >= bathValue) &&
                                              (string.IsNullOrEmpty(pager.City) || x.City == pager.City) &&
                                              (string.IsNullOrEmpty(pager.District) || x.District == pager.District));
            }//search property for status, type, bath, bed, city, district and init value for districts

            ViewBag.SortList  = GetSortFields();
            ViewBag.Statuses  = GetPropertyStatusCodes(-1);
            ViewBag.Types     = GetPropertyTypes(-1);
            ViewBag.Cities    = GetCities(pager.City);
            ViewBag.Districts = GetDistricts(pager.City, pager.District);

            string[] segmentArea   = pager.AreaValue.Split(';');
            decimal  fromAreaValue = decimal.Parse(segmentArea[0]);
            decimal  toAreaValue   = decimal.Parse(segmentArea[1]);

            properties = properties.Where(x => fromAreaValue <= x.Area && x.Area <= (toAreaValue == 1000 ? decimal.MaxValue : toAreaValue) &&
                                          (pager.FromPriceValue ?? 0) <= x.Price && x.Price <= (pager.ToPriceValue ?? decimal.MaxValue));
            //search property for price and area value

            int totalPages = (int)Math.Ceiling(properties.Count() / (double)pageSize);

            IQueryable <Post> posts = _context.Posts.Include(x => x.Comments).Where(x => x.UIOption.IsDisplay);

            var recentPost = posts.OrderByDescending(x => x.ActivityLog.CreatedOn).Take(4).ToList();

            ViewBag.RecentPosts = _converter.CreatePostViewModels(recentPost);
            ViewBag.SortField   = $"{sortFieldValue}_{(orderByValue == "asc" ? "asc" : "desc")}";
            ViewBag.PageIndex   = pageIndex;
            ViewBag.PageSize    = pageSize;
            ViewBag.TotalPages  = totalPages;

            UICache team = _context.UICaches.Find(Page.Property, PageComponent.Home_Team, DataType.Html);

            ViewBag.TeamUI = team == null ? string.Empty : team.DataCache;

            return(View(new PropertyPageViewModels
            {
                Properties = _converter.CreatePropertyViewModels(properties.OrderByPropertyName(sortFieldValue, orderByValue)
                                                                 .Skip((pageIndex - 1) * pageSize)
                                                                 .Take(pageSize).ToList()),
                Featured = _converter.CreatePropertyViewModels
                               (_context.Properties.Where(x => x.IsFeatured).OrderBy(x => Guid.NewGuid()).Take(4).ToList()),
                PropertyPagination = pager
            }));
        }
コード例 #27
0
 protected virtual void ResetProperties(UICache source, List <SerializedProperty> properties, ref int index)
 {
     properties[index++].objectReferenceValue = source.CachedRectTransform;
     properties[index++].objectReferenceValue = source.Animation;
     properties[index++].objectReferenceValue = source.Graphic;
 }
コード例 #28
0
        public ActionResult UpdateClient(HomeUIClientViewModels client)
        {
            try
            {
                using (DbContextTransaction transaction = _context.Database.BeginTransaction())
                {
                    StringBuilder container = new StringBuilder();
                    StringBuilder elements  = new StringBuilder();

                    _ImageCropper backgroundImg = client.Background.FirstOrDefault();
                    container.Append(RenderPartialViewToString("~/Views/Home/_Client_Feedback_Container.cshtml", SaveImage(backgroundImg)));

                    client.Clients.ToList().ForEach(x =>
                                                    elements.Append(RenderPartialViewToString("~/Views/Home/_Client_Feedback_Container_Item.cshtml", SaveImage(x))));

                    container.Replace("{{elements}}", elements.ToString());
                    UICache achivementHtml = _context.UICaches.Find(Page.Home, PageComponent.Home_Client, DataType.Html);
                    if (achivementHtml == null)
                    {
                        _context.UICaches.Add(
                            achivementHtml = new UICache(Page.Home, PageComponent.Home_Client, DataType.Html));
                    }//create if html type is not existed
                    achivementHtml.DataCache = container.ToString();

                    UICache achivementJson = _context.UICaches.Find(Page.Home, PageComponent.Home_Client, DataType.Json);
                    if (achivementJson == null)
                    {
                        _context.UICaches.Add(
                            achivementJson = new UICache(Page.Home, PageComponent.Home_Client, DataType.Json));
                    }//create if json type is not existed
                    achivementJson.DataCache = JsonConvert.SerializeObject(
                        new HomeUIClientViewModels
                    {
                        Clients = client.Clients.Select(x => new ClientViewModels
                        {
                            ImagePath  = x.ImagePath,
                            ImageName  = x.ImageName,
                            IsUploaded = true,

                            Name     = x.Name,
                            Position = x.Position,
                            Content  = x.Content,
                        }).ToList(),
                        Background = client.Background.Select(x => new _ImageCropper
                        {
                            ImagePath  = x.ImagePath,
                            ImageName  = x.ImageName,
                            IsUploaded = true,
                        }).ToList()
                    });

                    _context.SaveChanges();
                    transaction.Commit();
                }//end of transaction

                return(RedirectToAction(nameof(UpdateClient)));
            }
            catch (Exception)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError));
            }
        }