Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string gid = Request.QueryString["gid"];
            if (!string.IsNullOrEmpty(gid))
            {
                if (!Page.IsPostBack)
                {
                    int goodyId;
                    if (int.TryParse(gid, out goodyId))
                    {
                        IGoodyService iGoodySec = GetBusinessInterface<IGoodyService>();
                        model = iGoodySec.GetGoodyById(goodyId);

                        IDonateRecordService iRecordSec = GetBusinessInterface<IDonateRecordService>();
                        List<DonatedRecordBusiEntity> list = iRecordSec.GetDonatorByGoodieId(goodyId);
                        if (list != null)
                        {
                            this.CustomPager1.SetPageCount(list.Count, base.BackgroundPageSize);
                            this.CustomPager1.SearchCondition.Add("gid", gid);
                            string curpageindex = Request.QueryString["curpageindex"];
                            if (!string.IsNullOrEmpty(curpageindex))
                            {
                                this.CustomPager1.CurrentPageIndex = int.Parse(curpageindex);
                            }
                            this.RepeaterUser.DataSource = list.Skip((this.CustomPager1.CurrentPageIndex - 1) * BackgroundPageSize).Take(BackgroundPageSize);
                            this.RepeaterUser.DataBind();
                        }
                    }
                }
            }
        }
Пример #2
0
 /// <summary>
 /// Create a new Goody object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 public static Goody CreateGoody(global::System.Int32 id)
 {
     Goody goody = new Goody();
     goody.Id = id;
     return goody;
 }
Пример #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Goodies EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToGoodies(Goody goody)
 {
     base.AddObject("Goodies", goody);
 }
Пример #4
0
        internal void AddProjectGoody(string goodyName, string goodyDesc, string goodyNum, string goodyPrice, string ddlCurrency,DonationProject projectModel)
        {
            if (!string.IsNullOrEmpty(goodyName)
                && !string.IsNullOrEmpty(goodyDesc)
                && !string.IsNullOrEmpty(goodyNum)
                && !string.IsNullOrEmpty(goodyPrice)
                && !string.IsNullOrEmpty(ddlCurrency)
               )
            {

                string[] arrayName = goodyName.Split(',');
                string[] arrayDesc = goodyDesc.Split(',');
                string[] arrayNum = goodyNum.Split(',');
                string[] arrayPrice = goodyPrice.Split(',');

                for (int i = 0; i < arrayNum.Length; i++)
                {
                    int num = 0;
                    bool isLimited = false;
                    if (int.TryParse(arrayNum[i], out num))
                    {
                        isLimited = true;
                    }
                    Goody model = new Goody
                    {

                        Num = num,
                        Price = decimal.Parse(arrayPrice[i]),
                        Title = arrayName[i],
                        CurrencyStr = ddlCurrency,
                        ProjectId = projectModel.ProjectId,
                        Description = arrayDesc[i],
                        SaleNum = 0,
                        IsLimit = isLimited
                    };
                    projectModel.Goodies.Add(model);
                }
            }
        }