Esempio n. 1
0
        /// <summary>
        /// 根据属性ID获取属性信息
        /// </summary>
        public string GetPropInfoById()
        {
            var      service = new PropService(CurrentUserInfo);
            PropInfo obj     = new PropInfo();
            string   content = string.Empty;

            string key = string.Empty;

            if (Request("PropID") != null && Request("PropID") != string.Empty)
            {
                key = Request("PropID").ToString().Trim();
            }

            obj = service.GetPropInfoById(key);
            var SKUDomain = "SKU";

            if (obj != null)
            {
                obj.Children = service.GetPropListByParentId(SKUDomain, obj.Prop_Id);
            }

            var jsonData = new JsonData();

            jsonData.totalCount = obj == null ? "0" : "1";
            jsonData.data       = obj;

            content = jsonData.ToJSON();
            return(content);
        }
Esempio n. 2
0
        /// <summary>
        ///获取生成的序号
        /// </summary>
        /// <param name="pContext"></param>
        /// <returns></returns>
        public string CreateIndex(HttpContext pContext)
        {
            var service = new PropService(CurrentUserInfo);

            int index = service.CreateIndex(pContext.Request["partentPropID"].ToString(), pContext.Request["propID"].ToString());

            return(string.Format("{{\"displayIndex\":'{0}'}}", index));
        }
Esempio n. 3
0
 private void Start()
 {
     dataEntityCollection            = Service.Get <CPDataEntityCollection>();
     propService                     = Service.Get <PropService>();
     trayInputButton                 = GetComponentInParent <TrayInputButton>();
     memberLockedButton              = GetComponent <MemberLockedTrayInputButton>();
     trayInputButton.OnStateChanged += onTrayInputButtonStateChanged;
 }
        public override IEnumerator PerformFirstPass()
        {
            ManifestContentKey      propManifestContentKey = StaticGameDataUtils.GetManifestContentKey(typeof(PropDefinition));
            AssetRequest <Manifest> manifest = Content.LoadAsync(propManifestContentKey);

            yield return(manifest);

            PropService propService = new PropService(Service.Get <EventDispatcher>(), manifest.Asset);

            Service.Set(propService);
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            IApplicationContext ctx = ContextRegistry.GetContext();

            #region DI
            INumCheck nc  = (INumCheck)ctx.GetObject("NumCheck");
            int       rst = nc.NCheck(1, 3); // NCheck 함수만 사용, 객체 생성은 Spring의 몫

            //Console.WriteLine(smd.Low + ", " + smd.High);


            // Not DI
            NumCheck nc2  = new NumCheck();
            int      rst2 = nc2.NCheck(1, 3); // NumCheck 객체를 미리 생성

            //Console.WriteLine(smd2.Low + ", " + smd2.High);
            #endregion

            #region Property
            if (ctx.ContainsObject("PropService"))
            {
                object obj = ctx["PropService"];

                PropService         ps      = (PropService)obj;
                string              prop_SG = ps.SG;
                string              prop_JP = ps.JP["City"];
                List <string>       prop_KO = ps.KO;
                NameValueCollection prop_CN = ps.CN;
            }
            #endregion

            #region AOP Way (1) - Need Config object  / Dont Reference from 61 line / Reference App.config(AOP)
            ICommand command = (ICommand)ctx["MyCommand"];
            command.TargetMethod("Processing", "Going");
            #endregion

            #region AOP Way (2) - Dont Need Config object / Reference from 61 line
            ProxyFactory factory = new ProxyFactory(new ServiceCommandObject());
            factory.AddAdvice(new RunningTimeAroundAdvice());
            factory.AddAdvice(new RunningTimeBeforeAdvice());
            factory.AddAdvice(new AfterReturningAdvice());
            factory.AddAdvice(new RunningTimeThrowAdvice());
            ICommand cmd = (ICommand)factory.GetProxy();
            cmd.TargetMethod("Processing", "Going");
            #endregion

            //  AOP Result Txt
            //  1. RunningTimeAroundAdvice(Before) - Before AroundAdvice executing
            //  2. RunningTimeBeforeAdvice - BeforeAdvice executing
            //  3. TargetMethod - Changed(Processing -> Changed), Going
            //  4. AfterReturningAdvice - Running time end
            //  1. RunningTimeAroundAdvice(After) - After AroundAdvice executing
        }
Esempio n. 6
0
        public void GetPropTreeChildrenJson(PropService service, string parentId, StringBuilder sb, string propType)
        {
            IList <PropInfo> list;
            PropInfo         queryEntity = new PropInfo();

            queryEntity.Parent_Prop_id = parentId;

            //对应属性域(jifeng.cao 20140220)
            queryEntity.Prop_Domain = FormatParamValue(Request("ApplicationId"));
            //如果是遍历SKU属性,则根据客户标识获取数据
            if (propType == "1" && queryEntity.Prop_Domain == "SKU")
            {
                queryEntity.CustomerId = this.CurrentUserInfo.CurrentLoggingManager.Customer_Id;
            }
            else
            {
                queryEntity.CustomerId = null;
            }

            list = service.GetWebProp(queryEntity, 0, 1000);
            sb.Append("\"leaf\":false,\"expanded\": true, \"children\":[");
            if (list != null && list.Count > 0)
            {
                foreach (var item in list)
                {
                    sb.Append("{");
                    sb.Append("\"ID\":\"" + item.Prop_Id + "\",");
                    sb.Append("\"ParentId\":\"" + item.Parent_Prop_id + "\",");
                    sb.Append("\"prop_id\":\"" + item.Prop_Id + "\",");
                    sb.Append("\"prop_code\":\"" + item.Prop_Code + "\",");
                    sb.Append("\"prop_name\":\"" + item.Prop_Name + "\",");
                    sb.Append("\"prop_eng_name\":\"" + item.Prop_Eng_Name + "\",");
                    sb.Append("\"prop_type\":\"" + item.Prop_Type + "\",");
                    sb.Append("\"parent_prop_id\":\"" + item.Parent_Prop_id + "\",");
                    sb.Append("\"prop_level\":\"" + item.Prop_Level + "\",");
                    sb.Append("\"prop_domain\":\"" + item.Prop_Domain + "\",");
                    sb.Append("\"prop_input_flag\":\"" + item.Prop_Input_Flag + "\",");
                    sb.Append("\"prop_max_length\":\"" + item.Prop_Max_Length + "\",");
                    sb.Append("\"prop_default_value\":\"" + item.Prop_Default_Value + "\",");
                    sb.Append("\"prop_status\":\"" + item.Prop_Status + "\",");
                    sb.Append("\"display_index\":\"" + item.Display_Index + "\",");
                    sb.Append("\"create_user_id\":\"" + item.Create_User_Id + "\",");
                    sb.Append("\"create_time\":\"" + item.Create_Time + "\",");
                    sb.Append("\"modify_user_id\":\"" + item.Modify_User_Id + "\",");
                    sb.Append("\"modify_time\":\"" + item.Modify_Time + "\",");
                    //提取子属性
                    GetPropTreeChildrenJson(service, item.Prop_Id, sb, item.Prop_Type);
                    sb.Append("},");
                }
                sb.Remove(sb.Length - 1, 1);
            }
            sb.Append("]");
        }
Esempio n. 7
0
        /// <summary>
        /// 查询属性Tree
        /// </summary>
        public string GetPropTreeListData()
        {
            var propService = new PropService(CurrentUserInfo);
            IList <PropInfo> list;
            PropInfo         queryEntity = new PropInfo();

            queryEntity.Parent_Prop_id = "-99";
            queryEntity.Prop_Domain    = FormatParamValue(Request("ApplicationId"));
            if (queryEntity.Prop_Domain != null && queryEntity.Prop_Domain.Trim().ToUpper() == "SKU")
            {
                //查询sku的tree
                queryEntity.Parent_Prop_id = "-88";
                queryEntity.CustomerId     = CurrentUserInfo.ClientID;
            }

            list = propService.GetWebProp(queryEntity, 0, 1000);
            StringBuilder sb = new StringBuilder();

            if (list != null && list.Count > 0)
            {
                sb.Append("{\"expanded\": true, \"text\":\"属性\", \"children\": [");
                foreach (var item in list)
                {
                    //sb.Append("{\"expanded\": true, \"leaf\":true, ");
                    sb.Append("{\"expanded\": true, ");
                    sb.Append("\"ID\":\"" + item.Prop_Id + "\",");
                    sb.Append("\"ParentId\":\"" + item.Parent_Prop_id + "\",");
                    sb.Append("\"prop_id\":\"" + item.Prop_Id + "\",");
                    sb.Append("\"prop_code\":\"" + item.Prop_Code + "\",");
                    sb.Append("\"prop_name\":\"" + item.Prop_Name + "\",");
                    sb.Append("\"prop_eng_name\":\"" + item.Prop_Eng_Name + "\",");
                    sb.Append("\"prop_type\":\"" + item.Prop_Type + "\",");
                    sb.Append("\"parent_prop_id\":\"" + item.Parent_Prop_id + "\",");
                    sb.Append("\"prop_level\":\"" + item.Prop_Level + "\",");
                    sb.Append("\"prop_domain\":\"" + item.Prop_Domain + "\",");
                    sb.Append("\"prop_input_flag\":\"" + item.Prop_Input_Flag + "\",");
                    sb.Append("\"prop_max_length\":\"" + item.Prop_Max_Length + "\",");
                    sb.Append("\"prop_default_value\":\"" + item.Prop_Default_Value + "\",");
                    sb.Append("\"prop_status\":\"" + item.Prop_Status + "\",");
                    sb.Append("\"display_index\":\"" + item.Display_Index + "\",");
                    sb.Append("\"create_user_id\":\"" + item.Create_User_Id + "\",");
                    sb.Append("\"create_time\":\"" + item.Create_Time + "\",");
                    sb.Append("\"modify_user_id\":\"" + item.Modify_User_Id + "\",");
                    sb.Append("\"modify_time\":\"" + item.Modify_Time + "\",");
                    //提取子属性
                    GetPropTreeChildrenJson(propService, item.Prop_Id, sb, item.Prop_Type);
                    sb.Append("},");
                }
                sb.Remove(sb.Length - 1, 1);
            }
            sb.Append("]}");
            return(sb.ToString());
        }
Esempio n. 8
0
        private void Start()
        {
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();

            participationData       = cPDataEntityCollection.GetComponent <ParticipationData>(cPDataEntityCollection.LocalPlayerHandle);
            membershipData          = cPDataEntityCollection.GetComponent <MembershipData>(cPDataEntityCollection.LocalPlayerHandle);
            gameObjectReferenceData = cPDataEntityCollection.GetComponent <GameObjectReferenceData>(cPDataEntityCollection.LocalPlayerHandle);
            type = InteractInWorldIconType.UICanvas;
            type = ((tweakableType != 0) ? tweakableType : type);
            setState(type);
            propService      = Service.Get <PropService>();
            indicatorRequest = Content.LoadAsync(onInteractIndicatorLoaded, InteractIndicatorContentKey);
        }
Esempio n. 9
0
        /// <summary>
        /// 查询属性
        /// </summary>
        public string GetPropListData()
        {
            var form = Request("form").DeserializeJSONTo <PropQueryEntity>();

            var propService = new PropService(CurrentUserInfo);
            IList <PropInfo> list;
            string           content = string.Empty;

            int pageIndex = Utils.GetIntVal(FormatParamValue(Request("page"))) - 1;

            PropInfo queryEntity = new PropInfo();

            queryEntity.Prop_Name   = FormatParamValue(form.prop_name);
            queryEntity.Prop_Domain = FormatParamValue(Request("ApplicationId"));
            if (Request("parentId") != null && Request("parentId").Length > 0)// && Request("parentId") != "ALL")
            {
                queryEntity.Parent_Prop_id = FormatParamValue(Request("parentId"));
            }
            else
            {
                queryEntity.Parent_Prop_id = "-99";
            }

            //(jifeng.cao 20140220)
            if (Request("propType") != null && Request("propType").Length > 0)
            {
                //如果是遍历SKU属性,则根据客户标识获取数据
                if (FormatParamValue(Request("propType")) == "1" && queryEntity.Prop_Domain == "SKU")
                {
                    queryEntity.CustomerId = this.CurrentUserInfo.CurrentLoggingManager.Customer_Id;
                }
                else
                {
                    queryEntity.CustomerId = null;
                }
            }

            list = propService.GetWebProp(queryEntity, pageIndex, PageSize);
            var dataTotalCount = propService.GetWebPropCount(queryEntity);

            var jsonData = new JsonData();

            jsonData.totalCount = dataTotalCount.ToString();
            jsonData.data       = list;

            content = string.Format("{{\"totalCount\":{1},\"topics\":{0}}}",
                                    jsonData.data.ToJSON(),
                                    jsonData.totalCount);
            return(content);
        }
Esempio n. 10
0
    //加载数据来源
    private void initDataFrom()
    {
        var source = new PropService().GetPropListByParentId(loggingSessionInfo, "DATAFROM", "AAE0B5C3708F4189B6D775D234295CB5");

        SelectDataFrom.DataValueField = "Prop_Id";
        SelectDataFrom.DataTextField  = "Prop_Name";
        SelectDataFrom.DataSource     = source;
        SelectDataFrom.DataBind();
        ListItem lis = new ListItem();

        lis.Text  = "--请选择--";
        lis.Value = "";
        SelectDataFrom.Items.Insert(0, lis);
    }
Esempio n. 11
0
        private bool isUsePropOnActionValid(object payload)
        {
            bool        result      = true;
            PropService propService = Service.Get <PropService>();

            if (propService.LocalPlayerPropUser != null && propService.LocalPlayerPropUser.Prop != null)
            {
                PropDefinition propDef = Service.Get <PropService>().LocalPlayerPropUser.Prop.PropDef;
                if (propDef.PropType == PropDefinition.PropTypes.Consumable && propDef.ExperienceType == PropDefinition.ConsumableExperience.PartyGameLobby)
                {
                    result = false;
                }
            }
            return(result);
        }
Esempio n. 12
0
        /// <summary>
        /// This Method is used to Insert data
        /// </summary>
        /// <param name="objcountry">JobType,Category Name,</param>
        /// <returns>1 for success and -1 for fail</returns>
        public string RecordInsert(PropCountry objCountry, string UserName)
        {
            PropService p = new PropService();

            Dllcountry objDal = new Dllcountry();

            try
            {
                return(objDal.Insertcountry(objCountry, UserName));
            }
            catch (Exception info)
            {
                throw info;
            }
            finally
            {
                objDal = null;
            }
        }
Esempio n. 13
0
        /// <summary>
        /// 删除
        /// </summary>
        public string BrandDetailDeleteData()
        {
            string content      = string.Empty;
            string error        = "";
            var    responseData = new ResponseData();
            var    service      = new BrandDetailBLL(this.CurrentUserInfo);
            var    propService  = new PropService(this.CurrentUserInfo);

            string key = string.Empty;

            if (FormatParamValue(Request("ids")) != null && FormatParamValue(Request("ids")) != string.Empty)
            {
                key = FormatParamValue(Request("ids")).ToString().Trim();
            }

            if (key == null || key.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "ID不能为空";
                return(responseData.ToJSON());
            }

            string[] ids = key.Split(',');
            if (ids.Length > 0)
            {
                foreach (var id in ids)
                {
                    var propObj = new BrandDetailEntity();
                    propObj.BrandId = id;
                    service.Delete(propObj);
                    //propService.DeleteProp(new PropInfo() { Prop_Id = id });

                    service.SetBrandAndPropSyn(propObj.BrandId, propObj.BrandName, 1, 1, out error);
                }
            }

            responseData.success = true;
            responseData.msg     = error;

            content = responseData.ToJSON();
            return(content);
        }
Esempio n. 14
0
        public string SaveSku(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <SaveSkuRP> >();
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var rd = new SaveSkuRD();//返回值

            //处理促销分组
            //先把之前的删除掉
            var service = new PropService(loggingSessionInfo);         //保存到t_sku表
            //    var brandDetailBLL = new BrandDetailBLL(CurrentUserInfo);
            var skuPropServer = new SkuPropServer(loggingSessionInfo); //保存到T_Sku_Property
            var propInfo      = rp.Parameters.SkuProp;

            //验证重复性
            int DistinctchildrenCount = propInfo.Children.Select(m => m.Prop_Name).Distinct().Count();

            if (DistinctchildrenCount != propInfo.Children.Count)
            {
                throw new APIException("规格的值不能重复添加")
                      {
                          ErrorCode = 135
                      };
            }

            if (string.IsNullOrEmpty(propInfo.Prop_Name))
            {
                throw new APIException("缺少参数【Prop_Name】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }

            bool isNew = false;

            if (string.IsNullOrEmpty(propInfo.Prop_Id))
            {
                propInfo.Prop_Id = Guid.NewGuid().ToString();
                isNew            = true;
            }
            propInfo.Prop_Code          = propInfo.Prop_Name;
            propInfo.Prop_Eng_Name      = "";
            propInfo.Prop_Type          = "2";//属性类型 1=组,2=属性,3=属性明细';
            propInfo.Parent_Prop_id     = "-99";
            propInfo.Prop_Level         = 1;
            propInfo.Prop_Domain        = "SKU";
            propInfo.Prop_Input_Flag    = "select";
            propInfo.Prop_Max_Length    = 1000;
            propInfo.Prop_Default_Value = "";
            propInfo.Prop_Status        = 1;
            propInfo.Display_Index      = 0;
            if (isNew)
            {
                propInfo.Create_User_Id = loggingSessionInfo.UserID;
                propInfo.Create_Time    = DateTime.Now.ToString();
            }
            propInfo.Modify_User_Id = loggingSessionInfo.UserID;
            propInfo.Modify_Time    = DateTime.Now.ToString();
            string error = "";

            service.SaveProp(propInfo, ref error);
            if (!string.IsNullOrEmpty(error))
            {
                throw new APIException(error)
                      {
                          ErrorCode = 135
                      };
            }
            if (!isNew)//不是新的
            {
                string propIds = "";
                foreach (var itemInfo in propInfo.Children)//数组,更新数据
                {
                    if (!string.IsNullOrEmpty(itemInfo.Prop_Id))
                    {
                        if (propIds != "")
                        {
                            propIds += ",";
                        }
                        propIds += "'" + itemInfo.Prop_Id + "'";
                    }
                }
                //删除不在这个里面的
                service.DeletePropByIds(propIds, propInfo);
            }

            int i = 0;

            foreach (var itemInfo in propInfo.Children)//数组,更新数据
            {
                if (string.IsNullOrEmpty(itemInfo.Prop_Id))
                {
                    itemInfo.Prop_Id = Guid.NewGuid().ToString();
                }
                itemInfo.Prop_Code          = itemInfo.Prop_Name;
                itemInfo.Prop_Eng_Name      = "";
                itemInfo.Prop_Type          = "3";              //属性类型 1=组,2=属性,3=属性明细';
                itemInfo.Parent_Prop_id     = propInfo.Prop_Id; //父类id
                itemInfo.Prop_Level         = 2;
                itemInfo.Prop_Domain        = "SKU";
                itemInfo.Prop_Input_Flag    = "select";
                itemInfo.Prop_Max_Length    = 1000;
                itemInfo.Prop_Default_Value = "";
                itemInfo.Prop_Status        = 1;
                itemInfo.Display_Index      = ++i;
                service.SaveProp(itemInfo, ref error);
            }

            //如果是新建的情况
            //如果不存在属性关系(sku和属性之间的关系)
            if (!skuPropServer.CheckSkuProp(propInfo.Prop_Id))
            {
                SkuPropInfo skuPropInfo = new SkuPropInfo();
                skuPropInfo.sku_prop_id   = Utils.NewGuid();
                skuPropInfo.prop_id       = propInfo.Prop_Id;
                skuPropInfo.CustomerId    = loggingSessionInfo.ClientID;
                skuPropInfo.status        = propInfo.Prop_Status.ToString();
                skuPropInfo.display_index = propInfo.Display_Index;
                skuPropServer.AddSkuProp(skuPropInfo);
            }

            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            return(rsp.ToJSON());
        }
Esempio n. 15
0
        public string SaveSkuValue(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <SaveSkuValueRP> >();
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var rd = new SaveSkuRD();//返回值

            //处理促销分组
            //先把之前的删除掉
            var service = new PropService(loggingSessionInfo);//保存到t_sku表

            //  var skuPropServer = new SkuPropServer(loggingSessionInfo);//保存到T_Sku_Property

            if (string.IsNullOrEmpty(rp.Parameters.parent_prop_id))
            {
                throw new APIException("缺少参数【parent_prop_id】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }
            if (string.IsNullOrEmpty(rp.Parameters.prop_name))
            {
                throw new APIException("缺少参数【prop_name】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }

            string   error    = "";
            PropInfo itemInfo = new PropInfo();

            itemInfo.Prop_Id            = Guid.NewGuid().ToString();
            itemInfo.Prop_Name          = rp.Parameters.prop_name;
            itemInfo.Prop_Code          = itemInfo.Prop_Name;
            itemInfo.Prop_Eng_Name      = "";
            itemInfo.Prop_Type          = "3";                          //属性类型 1=组,2=属性,3=属性明细';
            itemInfo.Parent_Prop_id     = rp.Parameters.parent_prop_id; //父类id
            itemInfo.Prop_Level         = 2;
            itemInfo.Prop_Domain        = "SKU";
            itemInfo.Prop_Input_Flag    = "select";
            itemInfo.Prop_Max_Length    = 1000;
            itemInfo.Prop_Default_Value = "";
            itemInfo.Prop_Status        = 1;
            // itemInfo.Display_Index = ++i;
            if (service.CheckProp(itemInfo))//判断在同一个父类下面,是不是有这个属性代码了。
            {
                throw new APIException("该sku下面,已经有这个sku值了")
                      {
                          ErrorCode = 135
                      };
            }


            var children = service.GetPropListByParentId("SKU", rp.Parameters.parent_prop_id);
            int i        = children == null ? 0 : children.Count;

            itemInfo.Display_Index = ++i;
            service.SaveProp(itemInfo, ref error);



            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            return(rsp.ToJSON());
        }
Esempio n. 16
0
        /// <summary>
        /// 获取子节点数据
        /// </summary>
        /// <param name="pParentNodeID">父节点ID</param>
        /// <returns></returns>
        protected override TreeNodes GetNodes(string pParentNodeID)
        {
            TreeNodes nodes = new TreeNodes();

            var service              = new PropService(new SessionManager().CurrentUserLoginInfo);
            IList <PropInfo> data    = new List <PropInfo>();
            string           content = string.Empty;

            string key    = string.Empty;
            string domain = string.Empty;

            if (Request("node") != null && Request("node") != string.Empty)
            {
                key = Request("node").ToString().Trim();
            }
            if (key == "root" || key.Trim().Length == 0)
            {
                key = "-99";
            }
            if (Request("domain") != null && Request("domain") != string.Empty)
            {
                domain = Request("domain").ToString().Trim();
            }

            //if (key.Length == 2)
            //{
            //    data = service.GetCityListByProvince(key);
            //}
            //else if (key.Length == 4)
            //{
            //    data = service.GetAreaListByCity(key);
            //}
            //else if (key.Length == 0)
            //{
            //    data = service.GetProvinceList();
            //}

            var queryEntity = new PropInfo();

            queryEntity.Parent_Prop_id = key;
            queryEntity.Prop_Domain    = domain;


            if (queryEntity.Parent_Prop_id != "-99")
            {
                var      pr        = new PropService(CurrentUserInfo);
                PropInfo parentObj = pr.GetPropInfoById(key);
                if (parentObj.Prop_Type != "2")
                {
                    queryEntity.CustomerId = this.CurrentUserInfo.ClientID;
                }
            }
            data = service.GetWebProp(queryEntity, 0, 1000);

            var jsonData = new JsonData();

            jsonData.totalCount = data.Count.ToString();
            jsonData.data       = data;

            var parentCode = string.Empty;

            foreach (var item in data)
            {
                nodes.Add(item.Prop_Id, item.Prop_Name,
                          item.Parent_Prop_id,
                          false);
            }
            //
            //var root = new TreeNodes();
            //root.Add(new TreeNode() { ID = "1", IsLeaf = false, Text = "1" });
            //root.Add(new TreeNode() { ID = "1_1", ParentID = "1", IsLeaf = false, Text = "1_1" });
            //root.Add(new TreeNode() { ID = "1_1_1", ParentID = "1_1", IsLeaf = false, Text = "1_1_1`" });
            return(nodes);
        }
Esempio n. 17
0
        /// <summary>
        /// pageload
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            string content = string.Empty;

            if (string.IsNullOrEmpty(Request["method"]))
            {
                //MenuList = DataLoader.LoadFrom<ClientMenuButtonEntity>(
                //    new SessionManager().CurrentUserLoginInfo.UserOPRight.Tables[0],
                //    new DirectPropertyNameMapping()).Where(c =>
                //        string.IsNullOrEmpty(c.ButtonText)).ToArray();

                //var loggingSessionInfo = this.Session["loggingSessionInfo"] as LoggingSessionInfo;
                var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
                if (loggingSessionInfo == null)
                {
                    this.Response.Redirect("~/GoSso.aspx");
                }
                else
                {
                    if (lblLoginUserName != null)
                    {
                        lblLoginUserName.InnerText = loggingSessionInfo.CurrentUser.User_Name;//因为ChildPage.Master的前台页面Inherits="JIT.CPOS.BS.Web.Framework.MasterPage.CPOS" 但是不含有 lblLoginUserName
                    }
                }
                AppSysService appSysService = new AppSysService(loggingSessionInfo);
                this.MenuList = appSysService.GetRoleMenusList(loggingSessionInfo,
                                                               loggingSessionInfo.CurrentUserRole.RoleId);//根据当前用户的角色,来取他拥有的页面

                var dbMenuIds = appSysService.GetMenuIds(Request.Url);
                if (dbMenuIds.Count == 0 && !string.IsNullOrWhiteSpace(Mid))
                {
                    dbMenuIds.Add(Mid);
                }
                foreach (var dbMenuId in dbMenuIds)
                {
                    string tempMid     = string.Empty;
                    string tempPMenuID = string.Empty;
                    string tempMMenuID = string.Empty;
                    if (!string.IsNullOrWhiteSpace(dbMenuId))
                    {
                        tempMid = dbMenuId;
                    }
                    //PMenuId
                    {
                        var currentMenu = MenuList.Where(p => p.Menu_Id == tempMid).SingleOrDefault();
                        if (currentMenu != null)
                        {
                            if (!string.IsNullOrWhiteSpace(currentMenu.Parent_Menu_Id))
                            {
                                tempPMenuID = currentMenu.Parent_Menu_Id;
                            }
                        }
                    }
                    //MMenuId
                    {
                        var currentMenu = MenuList.Where(p => p.Menu_Id == tempPMenuID).SingleOrDefault();
                        if (currentMenu != null)
                        {
                            if (!string.IsNullOrWhiteSpace(currentMenu.Parent_Menu_Id))
                            {
                                tempMMenuID = currentMenu.Parent_Menu_Id;
                            }
                        }
                    }
                    //防止多条menuId
                    if (!string.IsNullOrWhiteSpace(tempMMenuID))
                    {
                        Mid     = tempMid;
                        PMenuID = tempPMenuID;
                        MMenuID = tempMMenuID;
                        break;
                    }
                    else if (!string.IsNullOrWhiteSpace(tempPMenuID) && string.IsNullOrWhiteSpace(PMenuID))
                    {
                        Mid     = tempMid;
                        PMenuID = tempPMenuID;
                    }
                    else if (!string.IsNullOrWhiteSpace(tempMid) && string.IsNullOrWhiteSpace(Mid))
                    {
                        Mid = tempMid;
                    }
                }

                #region 旧代码
                //this.MenuList = appSysService.GetRoleMenusList(loggingSessionInfo,
                //    loggingSessionInfo.CurrentUserRole.RoleId);//根据当前用户的角色,来取他拥有的页面
                //MMenuID = Request.QueryString["MMenuID"] == null ? "" : Request.QueryString["MMenuID"].ToString();
                //PMenuID = Request.QueryString["PMenuID"] == null ? "" : Request.QueryString["PMenuID"].ToString();
                //if (PMenuID == "")
                //{
                //    var currentMenu = MenuList.Where(p => p.Menu_Id == Mid).SingleOrDefault();
                //    if (currentMenu != null)
                //    {
                //        PMenuID = currentMenu.Parent_Menu_Id;
                //    }



                //}
                //if (MMenuID == "")
                //{
                //    var currentMenu = MenuList.Where(p => p.Menu_Id == PMenuID).SingleOrDefault();
                //    if (currentMenu != null)
                //    {
                //        MMenuID = currentMenu.Parent_Menu_Id;
                //    }

                //}
                #endregion
                if (!IsPostBack)
                {
                    //Jermyn20140703 修改logo图片来源
                    CustomerBasicSettingBLL customerBSServer = new CustomerBasicSettingBLL(loggingSessionInfo);
                    var customerBSList = customerBSServer.QueryByEntity(new CustomerBasicSettingEntity
                    {
                        CustomerID    = loggingSessionInfo.CurrentUser.customer_id.Trim()
                        , SettingCode = "WebLogo"
                        , IsDelete    = 0
                    }, null);
                    if (customerBSList == null || customerBSList.Length == 0 || customerBSList[0] == null ||
                        customerBSList[0].SettingValue == null ||
                        customerBSList[0].SettingValue.Equals(""))
                    {
                        //Jermyn20131202 添加logo图片
                        PropService propServer = new PropService(loggingSessionInfo);
                        string      strLogo    = propServer.GetWebLogo();
                        if (strLogo == null || strLogo.Equals(""))
                        {
                        }
                        else
                        {
                            strWebLogo = strLogo;
                        }
                    }
                    else
                    {
                        strWebLogo = customerBSList[0].SettingValue;
                    }
                }
            }
            else
            {
                switch (Request["method"])
                {
                case "LogOut": content = LogOut(); break;

                case "KeepSession": content = ""; break;
                }
                Response.Write(content);
                HttpContext.Current.ApplicationInstance.CompleteRequest();
                //Response.End();
            }
        }
Esempio n. 18
0
        /// <summary>
        /// 保存属性
        /// </summary>
        public string SavePropData()
        {
            var      service        = new PropService(CurrentUserInfo);
            var      brandDetailBLL = new BrandDetailBLL(CurrentUserInfo);
            var      skuPropServer  = new SkuPropServer(this.CurrentUserInfo);
            PropInfo item           = new PropInfo();
            string   content        = string.Empty;
            var      responseData   = new ResponseData();

            string key     = string.Empty;
            string item_id = string.Empty;

            if (Request("item") != null && Request("item") != string.Empty)
            {
                key = Request("item").ToString().Trim();
            }
            if (Request("PropId") != null && Request("PropId") != string.Empty)
            {
                item_id = Request("PropId").ToString().Trim();
            }

            item = key.DeserializeJSONTo <PropInfo>();

            PropInfo parentObj = new PropInfo();

            parentObj.Prop_Level = 1;
            if (item.Parent_Prop_id != null && item.Parent_Prop_id.Trim().Length > 0)
            {
                parentObj = service.GetPropInfoById(item.Parent_Prop_id);
                if (parentObj != null)
                {
                    item.Prop_Level = parentObj.Prop_Level + 1;
                }
            }
            else
            {
                item.Parent_Prop_id = "-99";
                item.Prop_Status    = 1;
            }

            if (item.Prop_Domain == "SKU" && item.Prop_Level == 2)
            {
                if (service.CheckSkuLast(item.Parent_Prop_id))
                {
                    responseData.success = false;
                    responseData.msg     = "SKU组最多有5个子节点";
                    return(responseData.ToJSON());
                }
            }

            if (item.Prop_Name == null || item.Prop_Name.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "名称不能为空";
                return(responseData.ToJSON());
            }
            if (item.Prop_Code == null || item.Prop_Code.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "代码不能为空";
                return(responseData.ToJSON());
            }


            #region 商品sku 属性时判断  Display_Index只能在1-5,且不能在
            if (item.Prop_Type == "2" && item.Prop_Domain == "SKU")
            {
                string skuMsg = string.Empty;
                if (item.Display_Index < 1 || item.Display_Index > 5)
                {
                    skuMsg = "序号必须在1~5范围内";
                }

                //是否存在sku

                if (skuPropServer.CheckSkuPropByDisplayindex(this.CurrentUserInfo.CurrentLoggingManager.Customer_Id, item.Display_Index))
                {
                    skuMsg = "序号被占用,请重新选择1~5的序号。";
                }
                if (!string.IsNullOrWhiteSpace(skuMsg))
                {
                    responseData.msg = skuMsg;
                    return(responseData.ToJSON());
                }
            }
            #endregion


            bool   status  = true;
            string message = "保存成功";
            //------------------------------------------------
            //if (item.Prop_Domain.Equals("SKU") && item.Prop_Level.Equals("3"))
            //{
            //    item.Prop_Domain = "ITEM";
            //}
            //-----------------------------------------------------------------
            item.Prop_Status = 1;
            if (item.Prop_Id.Trim().Length == 0)
            {
                item.Prop_Id = Utils.NewGuid();
                service.SaveProp(item, ref message);
            }
            else
            {
                service.SaveProp(item, ref message);
            }

            if (message != "属性代码已存在")
            {
                if (item.Prop_Type == "2" && item.Prop_Domain == "SKU")
                {
                    string skuMsg = string.Empty;
                    if (item.Display_Index < 1 && item.Display_Index > 5)
                    {
                        skuMsg = "序号必须在1~5范围内";
                    }

                    //是否存在sku

                    if (skuPropServer.CheckSkuPropByDisplayindex(this.CurrentUserInfo.CurrentLoggingManager.Customer_Id, item.Display_Index))
                    {
                        skuMsg = "序号被占用,请重新选择1~5的序号。";
                    }
                    if (!string.IsNullOrWhiteSpace(skuMsg))
                    {
                        responseData.msg = skuMsg;
                        return(responseData.ToJSON());
                    }

                    //如果不存在属性关系
                    if (!skuPropServer.CheckSkuProp(item.Prop_Id))
                    {
                        SkuPropInfo skuPropInfo = new SkuPropInfo();
                        skuPropInfo.sku_prop_id   = Utils.NewGuid();
                        skuPropInfo.prop_id       = item.Prop_Id;
                        skuPropInfo.CustomerId    = this.CurrentUserInfo.CurrentLoggingManager.Customer_Id;
                        skuPropInfo.status        = item.Prop_Status.ToString();
                        skuPropInfo.display_index = item.Display_Index;
                        skuPropServer.AddSkuProp(skuPropInfo);
                    }
                }
                else
                {
                    SkuPropInfo skuPropInfo = new SkuPropInfo();
                    skuPropInfo.prop_id = item.Prop_Id;
                    skuPropServer.DeleteSkuProp(skuPropInfo);
                }
            }
            else
            {
                status = false;
            }



            if (parentObj != null && (parentObj.Prop_Code == "品牌" || parentObj.Prop_Id == "F8823C2EBACF4965BA134D3B10BD0B9F"))
            {
                brandDetailBLL.SetBrandAndPropSyn(item.Prop_Id, item.Prop_Name, 2, 0, out message);
            }

            responseData.success = status;
            responseData.msg     = message;

            content = responseData.ToJSON();
            return(content);
        }
Esempio n. 19
0
        /// <summary>
        /// 删除
        /// </summary>
        public string PropDeleteData()
        {
            string content        = string.Empty;
            string error          = "";
            var    responseData   = new ResponseData();
            var    service        = new PropService(this.CurrentUserInfo);
            var    brandDetailBLL = new BrandDetailBLL(this.CurrentUserInfo);
            var    skuPropServer  = new SkuPropServer(this.CurrentUserInfo);

            string key = string.Empty;

            if (FormatParamValue(Request("ids")) != null && FormatParamValue(Request("ids")) != string.Empty)
            {
                key = FormatParamValue(Request("ids")).ToString().Trim();
            }

            if (key == null || key.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "ID不能为空";
                return(responseData.ToJSON());
            }



            string[] ids = key.Split(',');

            if (ids.Length > 0)
            {
                foreach (var id in ids)
                {
                    if (skuPropServer.ISCheckSkuProp(id))
                    {
                        responseData.success = false;
                        responseData.msg     = "属性已被引用";
                        return(responseData.ToJSON());
                    }
                    if (skuPropServer.ISCheckSkuProp2(id))
                    {
                        responseData.success = false;
                        responseData.msg     = "规格已被引用";
                        return(responseData.ToJSON());
                    }
                }
            }
            if (ids.Length > 0)
            {
                foreach (var id in ids)
                {
                    var propObj = new PropInfo();
                    propObj.Prop_Id = id;

                    var      tmpPropObj = service.GetPropInfoById(id);
                    PropInfo parentObj  = null;
                    if (tmpPropObj.Parent_Prop_id != null && tmpPropObj.Parent_Prop_id.Trim().Length > 0)
                    {
                        parentObj = service.GetPropInfoById(tmpPropObj.Parent_Prop_id);
                    }
                    if (parentObj != null && (parentObj.Prop_Code == "品牌" || parentObj.Prop_Id == "F8823C2EBACF4965BA134D3B10BD0B9F"))
                    {
                        brandDetailBLL.SetBrandAndPropSyn(propObj.Prop_Id, propObj.Prop_Name, 2, 1, out error);
                    }



                    service.DeleteProp(propObj);

                    SkuPropInfo skuPropInfo = new SkuPropInfo();
                    skuPropInfo.prop_id = propObj.Prop_Id;
                    skuPropServer.DeleteSkuProp(skuPropInfo);
                }
            }

            responseData.success = true;
            responseData.msg     = error;

            content = responseData.ToJSON();
            return(content);
        }
Esempio n. 20
0
        /// <summary>
        /// 保存
        /// </summary>
        public string SaveBrandDetailData()
        {
            var service               = new BrandDetailBLL(CurrentUserInfo);
            var objectImagesBLL       = new ObjectImagesBLL(CurrentUserInfo);
            var propService           = new PropService(CurrentUserInfo);
            BrandDetailEntity obj     = new BrandDetailEntity();
            string            content = string.Empty;
            string            error   = "";
            var responseData          = new ResponseData();

            string key     = string.Empty;
            string item_id = string.Empty;

            if (Request("item") != null && Request("item") != string.Empty)
            {
                key = Request("item").ToString().Trim();
            }
            if (Request("item_id") != null && Request("item_id") != string.Empty)
            {
                item_id = Request("item_id").ToString().Trim();
            }

            obj = key.DeserializeJSONTo <BrandDetailEntity>();

            if (obj.BrandName == null || obj.BrandName.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "名称不能为空";
                return(responseData.ToJSON());
            }
            if (obj.BrandCode == null || obj.BrandCode.Trim().Length == 0)
            {
                responseData.success = false;
                responseData.msg     = "代码不能为空";
                return(responseData.ToJSON());
            }

            if (item_id.Trim().Length == 0)
            {
                obj.BrandId    = Utils.NewGuid();
                obj.CustomerId = this.CurrentUserInfo.CurrentUser.customer_id;
                service.Create(obj);

                var tmpImageList = objectImagesBLL.QueryByEntity(new ObjectImagesEntity()
                {
                    ObjectId = obj.BrandId
                }, null);
                if (tmpImageList != null && tmpImageList.Length > 0)
                {
                    foreach (var tmpImageItem in tmpImageList)
                    {
                        objectImagesBLL.Delete(tmpImageItem);
                    }
                }
                if (obj.ItemImageList != null)
                {
                    foreach (var tmpImageItem in obj.ItemImageList)
                    {
                        tmpImageItem.ObjectId   = obj.BrandId;
                        tmpImageItem.CustomerId = this.CurrentUserInfo.CurrentUser.customer_id;
                        objectImagesBLL.Create(tmpImageItem);
                    }
                }

                service.SetBrandAndPropSyn(obj.BrandId, obj.BrandName, 1, 0, out error);
            }
            else
            {
                obj.BrandId    = item_id;
                obj.CustomerId = CurrentUserInfo.CurrentUser.customer_id;
                service.Update(obj, false);

                var tmpImageList = objectImagesBLL.QueryByEntity(
                    new ObjectImagesEntity()
                {
                    ObjectId = obj.BrandId
                }, null);
                if (tmpImageList != null && tmpImageList.Length > 0)
                {
                    foreach (var tmpImageItem in tmpImageList)
                    {
                        objectImagesBLL.Delete(tmpImageItem);
                    }
                }
                if (obj.ItemImageList != null)
                {
                    foreach (var tmpImageItem in obj.ItemImageList)
                    {
                        tmpImageItem.ObjectId   = obj.BrandId;
                        tmpImageItem.CustomerId = this.CurrentUserInfo.CurrentUser.customer_id;
                        objectImagesBLL.Create(tmpImageItem);
                    }
                }

                service.SetBrandAndPropSyn(obj.BrandId, obj.BrandName, 1, 0, out error);
            }

            responseData.success = true;
            responseData.msg     = error;

            content = responseData.ToJSON();
            return(content);
        }