protected void ExecuteVirtualMachineScaleSetRestartMethod(object[] invokeMethodInputParameters)
        {
            string resourceGroupName = (string)ParseParameter(invokeMethodInputParameters[0]);
            string vmScaleSetName    = (string)ParseParameter(invokeMethodInputParameters[1]);

            System.Collections.Generic.IList <string> instanceIds = null;
            if (invokeMethodInputParameters[2] != null)
            {
                var inputArray2 = Array.ConvertAll((object[])ParseParameter(invokeMethodInputParameters[2]), e => e.ToString());
                instanceIds = inputArray2.ToList();
            }

            var result = VirtualMachineScaleSetsClient.Restart(resourceGroupName, vmScaleSetName, instanceIds);

            WriteObject(result);
        }
        private static System.Collections.Generic.List <Map> UnSerializeZaaps(System.Collections.Generic.IList <byte> serialized)
        {
            System.Collections.Generic.List <Map> list = new System.Collections.Generic.List <Map>();
            for (int i = 0; i < serialized.Count; i += 4)
            {
                int num = (int)serialized[i] << 24 | (int)serialized[i + 1] << 16 | (int)serialized[i + 2] << 8 | (int)serialized[i + 3];
                Map map = Singleton <Game.World> .Instance.GetMap(num);

                if (map == null)
                {
                    throw new System.Exception("Map " + num + " not found");
                }
                list.Add(map);
            }
            return(list);
        }
Exemple #3
0
 private string GenerateValueItems(System.Collections.Generic.IList <AttributeValueInfo> values)
 {
     if (values == null || values.Count == 0)
     {
         return(string.Empty);
     }
     System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
     foreach (AttributeValueInfo current in values)
     {
         stringBuilder.Append("{");
         stringBuilder.AppendFormat("\"ValueId\":\"{0}\",\"ValueStr\":\"{1}\"", current.ValueId.ToString(System.Globalization.CultureInfo.InvariantCulture), current.ValueStr);
         stringBuilder.Append("},");
     }
     stringBuilder.Remove(stringBuilder.Length - 1, 1);
     return(stringBuilder.ToString());
 }
        protected override void AttachChildControls()
        {
            int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId);
            this.keyWord = this.Page.Request.QueryString["keyWord"];
            if (!string.IsNullOrWhiteSpace(this.keyWord))
            {
                this.keyWord = this.keyWord.Trim();
            }
            this.imgUrl        = (HiImage)this.FindControl("imgUrl");
            this.litContent    = (System.Web.UI.WebControls.Literal) this.FindControl("litContent");
            this.rptProducts   = (AliOHTemplatedRepeater)this.FindControl("rptProducts");
            this.rptCategories = (AliOHTemplatedRepeater)this.FindControl("rptCategories");
            this.txtTotalPages = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            string text = this.Page.Request.QueryString["sort"];

            if (string.IsNullOrWhiteSpace(text))
            {
                text = "DisplaySequence";
            }
            string text2 = this.Page.Request.QueryString["order"];

            if (string.IsNullOrWhiteSpace(text2))
            {
                text2 = "desc";
            }
            int pageNumber;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageNumber))
            {
                pageNumber = 1;
            }
            int maxNum;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out maxNum))
            {
                maxNum = 20;
            }
            System.Collections.Generic.IList <CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategories(this.categoryId, 1000);
            this.rptCategories.DataSource = maxSubCategories;
            this.rptCategories.DataBind();
            int num;

            this.rptProducts.DataSource = ProductBrowser.GetProducts(null, new int?(this.categoryId), this.keyWord, pageNumber, maxNum, out num, text, text2);
            this.rptProducts.DataBind();
            this.txtTotalPages.SetWhenIsNotNull(num.ToString());
            PageTitle.AddSiteNameTitle("分类搜索页");
        }
Exemple #5
0
        protected void DoCallback()
        {
            base.Response.Clear();
            base.Response.ContentType = "application/json";
            string text = base.Request.QueryString["action"];

            if (text.Equals("getPrepareData"))
            {
                int typeId = int.Parse(base.Request.QueryString["typeId"]);
                System.Collections.Generic.IList <AttributeInfo> attributes = ProductTypeHelper.GetAttributes(typeId);
                System.Data.DataTable dataTable = ProductTypeHelper.GetBrandCategoriesByTypeId(typeId);
                if (dataTable.Rows.Count == 0)
                {
                    dataTable = ControlProvider.Instance().GetBrandCategories();
                }
                base.Response.Write(this.GenerateJsonString(attributes, dataTable));
                attributes.Clear();
            }
            else
            {
                if (text.Equals("getMemberGradeList"))
                {
                    System.Collections.Generic.IList <MemberGradeInfo> memberGrades = MemberHelper.GetMemberGrades();
                    if (memberGrades == null || memberGrades.Count == 0)
                    {
                        base.Response.Write("{\"Status\":\"0\"}");
                    }
                    else
                    {
                        System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
                        stringBuilder.Append("{\"Status\":\"OK\",\"MemberGrades\":[");
                        foreach (MemberGradeInfo current in memberGrades)
                        {
                            stringBuilder.Append("{");
                            stringBuilder.AppendFormat("\"GradeId\":\"{0}\",", current.GradeId);
                            stringBuilder.AppendFormat("\"Name\":\"{0}\",", current.Name);
                            stringBuilder.AppendFormat("\"Discount\":\"{0}\"", current.Discount);
                            stringBuilder.Append("},");
                        }
                        stringBuilder.Remove(stringBuilder.Length - 1, 1);
                        stringBuilder.Append("]}");
                        base.Response.Write(stringBuilder.ToString());
                    }
                }
            }
            base.Response.End();
        }
Exemple #6
0
        public void OnActionExecuted(ActionExecutedContext filterContext)
        {
            ControllerContext controllerContext = filterContext.Controller.ControllerContext;
            HttpRequestBase   request           = controllerContext.HttpContext.Request;

            if (!request.IsAjaxRequest())
            {
                string text = request.Req("menuid");
                if (!string.IsNullOrEmpty(text))
                {
                    System.Collections.Generic.IList <StrObjectDict> list = DB.Select("select linkmc,menuid,linkid,pxxh,url from xt_menu_link where menuid='" + text + "' order by pxxh");
                    string text2 = "";
                    string text3 = "";
                    for (int i = 0; i < list.Count; i++)
                    {
                        string text4 = text2;
                        text2 = string.Concat(new string[]
                        {
                            text4,
                            "<div iconcls=\"icon-menulist\" id=\"MenuLink_",
                            Utils.GetString(list[i]["LINKID"]),
                            "\">",
                            Utils.GetString(list[i]["LINKMC"]),
                            "</div>"
                        });
                        text3 = text3 + " case \"" + Utils.GetString(list[i]["LINKMC"]) + "\":\r\n";
                        text4 = text3;
                        text3 = string.Concat(new string[]
                        {
                            text4,
                            "top.newtabs(new Date().getTime(), \"",
                            Utils.GetString(list[i]["LINKMC"]),
                            "\", \"",
                            Utils.GetString(list[i]["URL"]),
                            "\");\r\n"
                        });
                        text3 += "break;\r\n";
                    }
                    if (!string.IsNullOrEmpty(text2))
                    {
                        text2 = "<a href=\"javascript:void(0)\" id=\"btnMenuLink\" class=\"easyui-menubutton\" menu=\"#MenuLink\"  iconcls=\"icon-other\">相关链接</a><div id=\"MenuLink\" style=\"width: 130px; display: none;\">" + text2 + "</div>";
                        text2 = text2 + "<script>$(function(){$('#btnMenuLink').menubutton({menu: '#MenuLink',plain: false });}) \r\n $('#MenuLink').menu({ \r\n onClick: function(item) { \r\n switch(item.text) {\r\n" + text3 + "\r\n }}});</script>";
                    }
                    filterContext.Controller.ViewBag.MenuLink = text2;
                }
            }
        }
Exemple #7
0
        protected override void AttachChildControls()
        {
            this.litBuysum = (System.Web.UI.WebControls.Literal) this.FindControl("litBuysum");
            this.litList   = (System.Web.UI.WebControls.Literal) this.FindControl("litList");
            this.litTitle  = (System.Web.UI.WebControls.Literal) this.FindControl("litTitle");
            string text = Globals.RequestQueryStr("vaid");

            if (string.IsNullOrEmpty(text))
            {
                base.GotoResourceNotFound("");
            }
            OneyuanTaoInfo oneyuanTaoInfoById = OneyuanTaoHelp.GetOneyuanTaoInfoById(text);

            if (oneyuanTaoInfoById == null)
            {
                base.GotoResourceNotFound("");
            }
            this.litTitle.Text = oneyuanTaoInfoById.ProductTitle;
            System.Collections.Generic.IList <LuckInfo> luckInfoListByAId = OneyuanTaoHelp.getLuckInfoListByAId(text, this.CurrentMemberInfo.UserId);
            if (luckInfoListByAId == null)
            {
                base.GotoResourceNotFound("");
            }
            this.litBuysum.Text = luckInfoListByAId.Count.ToString();
            System.DateTime buyTime = luckInfoListByAId[0].BuyTime;
            string          text2   = "<p class='timeline'>" + buyTime.ToString("yyyy-MM-dd HH:mm:ss.fff") + "</p><ul class='luckul'>";
            int             num     = 0;

            foreach (LuckInfo current in luckInfoListByAId)
            {
                if (num == 0 && buyTime != current.BuyTime)
                {
                    buyTime = current.BuyTime;
                    text2   = "<p class='timeline'>" + buyTime.ToString("yyyy-MM-dd HH:mm:ss.fff") + "</p><ul class='luckul'>";
                }
                num++;
                text2 += "<li";
                if (current.IsWin)
                {
                    text2 += " class='Win' ";
                }
                text2 += ">";
                text2  = text2 + current.PrizeNum + "</li>";
            }
            this.litList.Text = text2;
            PageTitle.AddSiteNameTitle("我的号码");
        }
Exemple #8
0
 private void GetUserCustomGroupAndGrade(System.Web.HttpContext context)
 {
     context.Response.ContentType = "application/json";
     try
     {
         new System.Text.StringBuilder();
         System.Collections.Generic.IList <CustomGroupingInfo> customGroupingList = CustomGroupingHelper.GetCustomGroupingList();
         System.Collections.Generic.List <CustomGroup>         list = new System.Collections.Generic.List <CustomGroup>();
         if (customGroupingList.Count > 0)
         {
             foreach (CustomGroupingInfo current in customGroupingList)
             {
                 list.Add(new CustomGroup
                 {
                     id   = current.Id,
                     Name = current.GroupName
                 });
             }
         }
         new System.Text.StringBuilder();
         System.Collections.Generic.IList <MemberGradeInfo> memberGrades = MemberHelper.GetMemberGrades();
         System.Collections.Generic.List <SimpleGradeClass> list2        = new System.Collections.Generic.List <SimpleGradeClass>();
         if (memberGrades.Count > 0)
         {
             foreach (MemberGradeInfo current2 in memberGrades)
             {
                 list2.Add(new SimpleGradeClass
                 {
                     GradeId = current2.GradeId,
                     Name    = current2.Name
                 });
             }
         }
         var value = new
         {
             type      = "success",
             data      = list,
             gradedata = list2
         };
         string s = JsonConvert.SerializeObject(value);
         context.Response.Write(s);
     }
     catch (System.Exception ex)
     {
         context.Response.Write("{\"type\":\"error\",data:\"" + ex.Message + "\"}");
     }
 }
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();
            ExecuteClientAction(() =>
            {
                if (ShouldProcess(this.VMScaleSetName, VerbsCommon.Set))
                {
                    string resourceGroupName = this.ResourceGroupName;
                    string vmScaleSetName    = this.VMScaleSetName;
                    System.Collections.Generic.IList <string> instanceIds = this.InstanceId;

                    Rest.Azure.AzureOperationResponse result = null;
                    if (this.ParameterSetName.Equals("FriendMethod"))
                    {
                        result = VirtualMachineScaleSetsClient.ReimageAllWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult();
                    }
                    else if (this.ParameterSetName.Equals("RedeployMethodParameter"))
                    {
                        result = VirtualMachineScaleSetsClient.RedeployWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult();
                    }
                    else if (this.ParameterSetName.Equals("PerformMaintenanceMethodParameter"))
                    {
                        result = VirtualMachineScaleSetsClient.PerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, instanceIds).GetAwaiter().GetResult();
                    }
                    else
                    {
                        var vmScaleSetReimageInput         = new VirtualMachineScaleSetReimageParameters();
                        vmScaleSetReimageInput.InstanceIds = instanceIds;
                        vmScaleSetReimageInput.TempDisk    = this.TempDisk.IsPresent;
                        result = VirtualMachineScaleSetsClient.ReimageWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).GetAwaiter().GetResult();
                    }

                    PSOperationStatusResponse output = new PSOperationStatusResponse
                    {
                        StartTime = this.StartTime,
                        EndTime   = DateTime.Now
                    };

                    if (result != null && result.Request != null && result.Request.RequestUri != null)
                    {
                        output.Name = GetOperationIdFromUrlString(result.Request.RequestUri.ToString());
                    }

                    WriteObject(output);
                }
            });
        }
 protected void Page_Load(object sender, System.EventArgs e)
 {
     try
     {
         this.roleId         = int.Parse(base.Request.QueryString["roleId"]);
         this.oldPermissions = ManagerHelper.GetRolePremissonsByRoleId(this.roleId);
     }
     catch (System.Exception)
     {
         base.GotoResourceNotFound();
     }
     if (!this.Page.IsPostBack)
     {
         this.BindRoleInfo();
         this.BindDate();
     }
 }
Exemple #11
0
 public void ClearDiaryDetails(string applyId)
 {
     if (!string.IsNullOrEmpty(applyId))
     {
         System.Collections.Generic.IList <BudPreReimburseApplyDetail> list = (
             from detail in this.InApplydetailSer
             where applyId.Equals(detail.ApplyId)
             select detail).ToList <BudPreReimburseApplyDetail>();
         if (list != null && list.Count > 0)
         {
             foreach (BudPreReimburseApplyDetail current in list)
             {
                 this.InApplydetailSer.Delete(current);
             }
         }
     }
 }
 private void addEquipmentNode(string typeId, TreeNode typeNode)
 {
     System.Collections.Generic.IList <EquEquipment> list = (
         from equ in this.equService
         where typeId.Equals(equ.TypeId)
         select equ).ToList <EquEquipment>();
     if (list != null && list.Count > 0)
     {
         foreach (EquEquipment current in list)
         {
             TreeNode treeNode = new TreeNode(current.EquName, current.Id);
             treeNode.Expanded = new bool?(true);
             this.addYearNode(treeNode, current.Id);
             typeNode.ChildNodes.Add(treeNode);
         }
     }
 }
Exemple #13
0
        /// <summary> Sorts its argument (destructively) using insert sort; in the context of this package
        /// insertion sort is simple and efficient given its relatively small inputs.
        ///
        /// </summary>
        /// <param name="vector">vector to sort
        /// </param>
        /// <param name="comparator">comparator to define sort ordering
        /// </param>
        public static void insertionSort <T>(System.Collections.Generic.IList <T> vector, IComparer <T> comparator)
        {
            int max = vector.Count;

            for (int i = 1; i < max; i++)
            {
                T   value_Renamed = vector[i];
                int j             = i - 1;
                T   valueB;
                while (j >= 0 && comparator.Compare((valueB = vector[j]), value_Renamed) > 0)
                {
                    vector[j + 1] = valueB;
                    j--;
                }
                vector[j + 1] = value_Renamed;
            }
        }
Exemple #14
0
        public override void ExecuteCmdlet()
        {
            ExecuteClientAction(() =>
            {
                if (ShouldProcess(this.VMScaleSetName, VerbsLifecycle.Start))
                {
                    string resourceGroupName = this.ResourceGroupName;
                    string vmScaleSetName    = this.VMScaleSetName;
                    System.Collections.Generic.IList <string> instanceIds = this.InstanceId;

                    var result   = VirtualMachineScaleSetsClient.Start(resourceGroupName, vmScaleSetName, instanceIds);
                    var psObject = new PSOperationStatusResponse();
                    ComputeAutomationAutoMapperProfile.Mapper.Map <Azure.Management.Compute.Models.OperationStatusResponse, PSOperationStatusResponse>(result, psObject);
                    WriteObject(psObject);
                }
            });
        }
Exemple #15
0
        internal static void CopyGraphics(System.Collections.Generic.IList <Graphic> fromCollection, GraphicCollection toCollection)
        {
            // copy all graphics
            foreach (Graphic featureGraphic in fromCollection)
            {
                Graphic graphic = new Graphic();
                foreach (String attributeName in featureGraphic.Attributes.Keys)
                {
                    graphic.Attributes[attributeName] = featureGraphic.Attributes[attributeName];
                }

                graphic.Geometry = featureGraphic.Geometry;
                graphic.Symbol   = featureGraphic.Symbol;

                toCollection.Add(graphic);
            }
        }
Exemple #16
0
        public System.Collections.Generic.IList <T> ExecuteQueryForList <T>(string statementName, object parameterObject, int skipResults, int maxResults)
        {
            ISqlMapper sqlMap = this.GetSqlMap();

            System.DateTime now = System.DateTime.Now;
            System.Collections.Generic.IList <T> result;
            try
            {
                System.Collections.Generic.IList <T> list = sqlMap.QueryForList <T>(statementName, parameterObject, skipResults, maxResults);
                result = list;
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
            return(result);
        }
Exemple #17
0
    public void BindGv()
    {
        if (!string.IsNullOrEmpty(base.Request["id"].ToString()))
        {
            string strWhere = "AND r.ResourceId IN ( select CID from Res_ResourceRelation where FID='" + base.Request["id"].ToString() + "')";
            //string strWhere = " AND r.ResourceId IN ('067ef1eb-3386-4a00-8133-d33154337057','0842da52-2cf1-40ba-86e4-058a1e8fc16d')";
            cn.justwin.BLL.Resource resource = new cn.justwin.BLL.Resource();
            DataTable table = resource.Query(this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex, strWhere, "");//string condition, string priceTypeCondition);
            System.Collections.Generic.IList <PriceType> priceTypes = PriceType.GetPriceTypes(base.UserCode);
            if (this.gvResource.Columns.Count < 14 + priceTypes.Count)
            {
                int num = 9;
                foreach (PriceType current in priceTypes)
                {
                    BoundField boundField = new BoundField();
                    boundField.DataField  = current.PriceTypeName;
                    boundField.HeaderText = current.PriceTypeName;
                    this.gvResource.Columns.Insert(num++, boundField);
                }
            }
            //table.Columns.Remove("采购价");
            //table.Columns.Remove("目标成本价");
            //table.Columns.Remove("最后采购价");

            table.Columns.Add("NUM");
            foreach (DataRow dr in table.Rows)
            {
                DataTable dt = publicDbOpClass.DataTableQuary("select NUM from Res_ResourceRelation where CID ='" + dr["ResourceId"].ToString() + "' and FID='" + base.Request["id"].ToString() + "'");
                if (dt.Rows.Count == 1)
                {
                    dr["NUM"] = dt.Rows[0]["NUM"];
                }
                else
                {
                    dr["NUM"] = "0";
                }
            }
            this.gvResource.DataSource = table;
            this.gvResource.DataBind();
        }
        else
        {
            this.gvResource.DataSource = null;
            this.gvResource.DataBind();
        }
    }
Exemple #18
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("余额充值");
            this.litPaymentType = (System.Web.UI.WebControls.Literal) this.FindControl("litPaymentType");
            System.Collections.Generic.IList <PaymentModeInfo> paymentModes = ShoppingProcessor.GetPaymentModes();
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);

            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            string userAgent = this.Page.Request.UserAgent;

            if (masterSettings.EnableWeiXinRequest)
            {
                if (userAgent.ToLower().Contains("micromessenger") && masterSettings.IsValidationService)
                {
                    stringBuilder.AppendLine("<div class=\"payway\" name=\"88\">微信支付</div>");
                }
            }
            if (paymentModes != null && paymentModes.Count > 0)
            {
                foreach (PaymentModeInfo current in paymentModes)
                {
                    string      xml         = HiCryptographer.Decrypt(current.Settings);
                    XmlDocument xmlDocument = new XmlDocument();
                    xmlDocument.LoadXml(xml);
                    XmlNodeList elementsByTagName = xmlDocument.GetElementsByTagName("Partner");
                    if (elementsByTagName.Count != 0)
                    {
                        if (masterSettings.EnableAlipayRequest)
                        {
                            if (!string.IsNullOrEmpty(xmlDocument.GetElementsByTagName("Partner")[0].InnerText) && !string.IsNullOrEmpty(xmlDocument.GetElementsByTagName("Key")[0].InnerText) && !string.IsNullOrEmpty(xmlDocument.GetElementsByTagName("Seller_account_name")[0].InnerText))
                            {
                                stringBuilder.AppendFormat("<div class=\"payway\" name=\"{0}\">{1}</div>", current.ModeId, current.Name).AppendLine();
                            }
                        }
                    }
                    else if (masterSettings.EnableWapShengPay)
                    {
                        if (!string.IsNullOrEmpty(xmlDocument.GetElementsByTagName("SenderId")[0].InnerText) && !string.IsNullOrEmpty(xmlDocument.GetElementsByTagName("SellerKey")[0].InnerText))
                        {
                            stringBuilder.AppendFormat("<div class=\"payway\" name=\"{0}\">{1}</div>", current.ModeId, current.Name).AppendLine();
                        }
                    }
                }
            }
            this.litPaymentType.Text = stringBuilder.ToString();
        }
    protected string GetTypeName(string orderNum)
    {
        XpmCodeServices xpmCodeServices = new XpmCodeServices();

        System.Collections.Generic.IList <XpmCode> bySignCode = xpmCodeServices.GetBySignCode("taskType");
        string result = string.Empty;

        foreach (XpmCode current in bySignCode)
        {
            if (current.CodeID == orderNum.Length / 3)
            {
                result = current.CodeName;
                break;
            }
        }
        return(result);
    }
 private void btnAddSearch_Click(object sender, System.EventArgs e)
 {
     System.Collections.Generic.IList <int> productIds = ProductHelper.GetProductIds(new ProductQuery
     {
         Keywords   = this.keywords,
         CategoryId = this.categoryId,
         SaleStatus = ProductSaleStatus.OnSale
     });
     foreach (int current in productIds)
     {
         if (this.productId != current)
         {
             ProductHelper.AddRelatedProduct(this.productId, current);
         }
     }
     base.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString(), true);
 }
 public void ProcessRequest(System.Web.HttpContext context)
 {
     context.Response.ContentType = "text/plain";
     try
     {
         int    couponId = int.Parse(context.Request["id"].ToString());
         string text     = context.Request["products"].ToString();
         bool   flag     = bool.Parse(context.Request["bsingle"].ToString());
         bool   flag2    = bool.Parse(context.Request["setSale"].ToString());
         bool   flag3;
         if (!flag)
         {
             bool isAllProduct = bool.Parse(context.Request["all"].ToString());
             System.Collections.Generic.IList <string> productIDs = text.Split(new char[]
             {
                 '|'
             });
             flag3 = ActivityHelper.AddProducts(couponId, isAllProduct, productIDs);
             if (flag2)
             {
                 ProductHelper.UpShelf(text.Replace('|', ','));
             }
         }
         else
         {
             int productID = int.Parse(text);
             flag3 = ActivityHelper.AddProducts(couponId, productID);
             if (flag2)
             {
                 ProductHelper.UpShelf(productID.ToString());
             }
         }
         if (flag3)
         {
             context.Response.Write("{\"type\":\"success\",\"data\":\"添加商品成功\"}");
         }
         else
         {
             context.Response.Write("{\"type\":\"success\",\"data\":\"写数据库失败\"}");
         }
     }
     catch (System.Exception ex)
     {
         context.Response.Write("{\"type\":\"error\",\"data\":\"" + ex.Message + "\"}");
     }
 }
Exemple #22
0
        protected string GetGameMenu()
        {
            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            int gameId = 0;

            if (int.TryParse(base.Request.QueryString["gameId"], out gameId))
            {
                System.Collections.Generic.IList <GamePrizeInfo> gamePrizeListsByGameId = GameHelper.GetGamePrizeListsByGameId(gameId);
                if (gamePrizeListsByGameId != null && gamePrizeListsByGameId.Count <GamePrizeInfo>() > 0)
                {
                    int num = 0;
                    using (System.Collections.Generic.IEnumerator <GamePrizeInfo> enumerator = gamePrizeListsByGameId.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            GamePrizeInfo current = enumerator.Current;
                            string        arg     = "";
                            if (num == 0)
                            {
                                arg = "active";
                            }
                            if (num > 0)
                            {
                                stringBuilder.AppendFormat("<li class=\"{0}\" id=\"li{2}\" lival=\"{2}\">{1}<i class='' onclick='DelPrize(this)'></i></li>", arg, current.PrizeName, current.PrizeId);
                            }
                            else
                            {
                                stringBuilder.AppendFormat("<li class=\"{0}\" id=\"li{2}\" lival=\"{2}\">{1}</li>", arg, current.PrizeName, current.PrizeId);
                            }
                            num++;
                        }
                        goto IL_119;
                    }
                }
                stringBuilder.AppendFormat("<li class=\"{0}\">{1}</li>", "active", "一等奖");
                this.hfIndex.Value = "1";
            }
            else
            {
                stringBuilder.AppendFormat("<li class=\"{0}\">{1}</li>", "active", "一等奖");
                this.hfIndex.Value = "1";
            }
IL_119:
            return(stringBuilder.ToString());
        }
Exemple #23
0
        private void BindList(int skip)
        {
            if (this.rp_guest != null)
            {
                System.Collections.Generic.IList <int> browedProductList = BrowsedProductQueue.GetBrowedProductList((skip * this.maxNum) + this.MaxNum);

                int browedListCount = browedProductList.Count;
                if (browedListCount > (skip * this.maxNum) + this.MaxNum)
                {
                    int isRemove = browedListCount - this.maxNum;
                    while (isRemove > 0)
                    {
                        isRemove--;
                        browedProductList.RemoveAt(0);
                    }
                }
                else
                {
                    browedProductList.Clear();
                }
                //DataTable table = ProductBrowser.GetSuggestProductsProducts(browedProductList, 6);
                DataTable table = ProductBrowser.GetVistiedProducts(browedProductList);
                if (table != null)
                {
                    if (table.Rows.Count < this.maxNum)
                    {
                        DataTable dt = ProductBrowser.GetVistiedProducts(this.MaxNum - table.Rows.Count, skip * this.maxNum + 1, skip * this.maxNum + 1 + this.MaxNum);
                        TableToTable(table, dt);
                    }
                }
                else
                {
                    table = ProductBrowser.GetVistiedProducts(this.MaxNum, skip * this.maxNum + 1, skip * this.maxNum + 1 + this.MaxNum);
                }

                if (table.Rows.Count < 5)
                {
                    this.rp_guest.DataSource = null;
                    this.rp_guest.DataBind();
                    return;
                }
                this.rp_guest.DataSource = table;
                this.rp_guest.DataBind();
            }
        }
Exemple #24
0
        private void btnExport_Click(object sender, System.EventArgs e)
        {
            //修改1;
            string arg_6B_0            = Globals.ApplicationPath;
            AdvancedProductQuery query = this.GetQuery();

            System.Data.DataTable dataTable = ProductHelper.GetExportProducts(query, true, true, (string)this.ViewState["RemoveProductIds"]).Tables[3];
            System.Collections.Generic.List <ExportToLocal.ProductDetail> list = new System.Collections.Generic.List <ExportToLocal.ProductDetail>();
            foreach (System.Data.DataRow dataRow in dataTable.Rows)
            {
                int productId = System.Convert.ToInt32(dataRow["ProductId"]);
                System.Collections.Generic.IList <int> tagIds = null;
                System.Collections.Generic.Dictionary <int, System.Collections.Generic.IList <int> > attrs;
                ProductInfo productDetails = ProductHelper.GetProductDetails(productId, out attrs, out tagIds);
                list.Add(new ExportToLocal.ProductDetail
                {
                    pi     = productDetails,
                    attrs  = attrs,
                    tagIds = tagIds
                });
            }
            string strflag;

            if (!(this.calendarStartDate.SelectedDate.HasValue && this.calendarEndDate.SelectedDate.HasValue))
            {
                strflag = "";
            }
            else
            {
                strflag = "_" +
                          DateTime.Parse(this.calendarStartDate.SelectedDate.ToString()).ToString("yyyyMMdd") + "-" + DateTime.Parse(this.calendarEndDate.SelectedDate.ToString()).ToString("yyyyMMdd");
            }
            //this._workDir = this._baseDir.CreateSubdirectory(this._flag);
            //string text = this._workDir.FullName + string.Format("\\local{0}.csv", this._flag);
            this._workDir = this._baseDir.CreateSubdirectory(this._flag);
            string text = this._workDir.FullName + string.Format("\\本地商品数据包{0}.csv", strflag);

            string text2 = text.Replace(".csv", "");

            if (!System.IO.Directory.Exists(text2))
            {
                System.IO.Directory.CreateDirectory(text2);
            }
            this.DoExportForHishop(text, text2, list);
        }
Exemple #25
0
        public static String getLauncherClassName(Context context)
        {
            Intent intent = new Intent(Intent.ActionMain);

            intent.AddCategory(Intent.CategoryLauncher);

            System.Collections.Generic.IList <ResolveInfo> resolveInfos = context.PackageManager.QueryIntentActivities(intent, 0);
            foreach (ResolveInfo resolveInfo in resolveInfos)
            {
                String pkgName = resolveInfo.ActivityInfo.ApplicationInfo.PackageName;
                if (pkgName.ToLower() == context.PackageName.ToLower())
                {
                    String className = resolveInfo.ActivityInfo.Name;
                    return(className);
                }
            }
            return(null);
        }
Exemple #26
0
 private string GenerateJson(System.Collections.Generic.IList <CategoryInfo> categories)
 {
     System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
     stringBuilder.Append("{");
     stringBuilder.Append("\"Status\":\"OK\",");
     stringBuilder.Append("\"Categories\":[");
     foreach (CategoryInfo current in categories)
     {
         stringBuilder.Append("{");
         stringBuilder.AppendFormat("\"CategoryId\":\"{0}\",", current.CategoryId.ToString(System.Globalization.CultureInfo.InvariantCulture));
         stringBuilder.AppendFormat("\"HasChildren\":\"{0}\",", current.HasChildren ? "true" : "false");
         stringBuilder.AppendFormat("\"CategoryName\":\"{0}\"", current.Name);
         stringBuilder.Append("},");
     }
     stringBuilder.Remove(stringBuilder.Length - 1, 1);
     stringBuilder.Append("]}");
     return(stringBuilder.ToString());
 }
Exemple #27
0
        //动态生成ID
        public string GetNewID(string TableName, string ColumnName)
        {
            string strNew = "";

            System.Collections.Generic.IList <T> LUser = GetAll();
            if (LUser.Count == 0)
            {
                string  strSQL     = string.Format("select data_length as USER_ID  from  user_tab_cols where table_name='{0}' and column_name='{1}'", TableName, ColumnName);
                decimal DataLength = RepositoryContext.DbContext.Database.SqlQuery <decimal>(strSQL).ToList()[0];
                strNew = "1".PadLeft((int)DataLength, '0');
            }
            else
            {
                string strValue = GetAll().Select(i => i.GetType().GetProperty(ColumnName).GetValue(i, null)).Max().ToString();
                strNew = (int.Parse(strValue) + 1).ToString().PadLeft(strValue.Length, '0');
            }
            return(strNew);
        }
 protected string GetMemberCustomGroup()
 {
     System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
     System.Collections.Generic.IList <CustomGroupingInfo> customGroupingList = CustomGroupingHelper.GetCustomGroupingList();
     if (customGroupingList != null && customGroupingList.Count > 0)
     {
         foreach (CustomGroupingInfo current in customGroupingList)
         {
             if (current.Id != this.currentGroupId)
             {
                 stringBuilder.Append(" <label class=\"middle mr20\">");
                 stringBuilder.AppendFormat("<input type=\"checkbox\" class=\"CustomGroup\" value=\"{0}\">{1}", current.Id, current.GroupName);
                 stringBuilder.Append("  </label>");
             }
         }
     }
     return(stringBuilder.ToString());
 }
Exemple #29
0
    private void BindMonth()
    {
        this.dropMonth.Items.Clear();
        this.dropMonth.Items.Add(new ListItem("选择月份", ""));
        BudTaskService budTaskService = new BudTaskService();

        if (!string.IsNullOrEmpty(this.dropYear.SelectedValue))
        {
            System.Collections.Generic.IList <int> months = budTaskService.GetMonths(this.prjId, this.dropYear.SelectedValue);
            if (months != null)
            {
                foreach (int current in months)
                {
                    this.dropMonth.Items.Add(new ListItem(current.ToString() + "月", current.ToString("00")));
                }
            }
        }
    }
        /// <summary>Construct a <c>DisjunctionScorer</c>.</summary>
        /// <param name="subScorers">A collection of at least two subscorers.
        /// </param>
        /// <param name="minimumNrMatchers">The positive minimum number of subscorers that should
        /// match to match this query.
        /// <br/>When <c>minimumNrMatchers</c> is bigger than
        /// the number of <c>subScorers</c>,
        /// no matches will be produced.
        /// <br/>When minimumNrMatchers equals the number of subScorers,
        /// it more efficient to use <c>ConjunctionScorer</c>.
        /// </param>
        public DisjunctionSumScorer(System.Collections.Generic.IList <Scorer> subScorers, int minimumNrMatchers, IState state) : base(null)
        {
            nrScorers = subScorers.Count;

            if (minimumNrMatchers <= 0)
            {
                throw new System.ArgumentException("Minimum nr of matchers must be positive");
            }
            if (nrScorers <= 1)
            {
                throw new System.ArgumentException("There must be at least 2 subScorers");
            }

            this.minimumNrMatchers = minimumNrMatchers;
            this.subScorers        = subScorers;

            InitScorerDocQueue(state);
        }
 public NoticeReportGenerator()
 {
     this.m_ReportGenerationSync = new object();
     this.m_StateSync = new object();
     this.m_UsePreCompileTemplate = true;
     this.m_NoticeRendererLock = new object();
     this.InitializeDelegates();
     this.m_Adapter = null;
     this.m_FetchOnly = false;
     this.m_ForceGenerate = false;
     this.m_Exporter = null;
     this.m_Templates = null;
     this.m_RenderedNoticeQueue = new ConcurrentQueue<NoticeRenderedNotice>();
     this.m_SaveRenderedNoticeQueue = new ConcurrentQueue<NoticeRenderedNotice>();
     this.m_ThreadExceptions = new ConcurrentQueue<System.Exception>();
     this.m_NoticeCache = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<CachedNoticeInfo>>();
     this.m_RenderingNoticeCount = 0;
     this.m_ExportingNoticeCount = 0;
     this.m_RetreivedNoticeBlocksCount = 0;
     this.m_IsBusy = false;
     this.m_IsCancelled = false;
     this.m_NoticeReports = new System.Collections.Generic.List<NoticeReport>();
     this.m_RenderingNoticeQueue = new ConcurrentQueue<RenderingNotice>();
     this.m_TemplateCache = new System.Collections.Generic.Dictionary<long, byte[]>();
     this.m_ExportCacheDirectoryName = "Cache_" + System.Guid.NewGuid().ToString().Replace("-", "");
 }
 internal MixedCodeDocumentFragmentEnumerator(IList<MixedCodeDocumentFragment> items)
 {
     _items = items;
     _index = -1;
 }
 public NoticeReportGenerator(NoticeAdapter adapter, System.Collections.Generic.IList<NoticeNoticeTemplate> templates)
     : this()
 {
     this.m_Adapter = adapter;
     this.m_Templates = templates;
 }