Beispiel #1
0
        public string report(int categoryId)
        {
            List <Entities.Product> Pdata = new List <Entities.Product>();

            Pdata = pro.GetAll(categoryId).ToList();
            decimal TotalUse = 0;

            foreach (var item in Pdata)
            {
                TotalUse += pro.GetAmount(item.ProductId);
            }
            decimal Capacity = ProCat.Find(categoryId).Capacity;

            string info = string.Empty;

            info += "ظرفیت کل : " + Capacity + Environment.NewLine + Environment.NewLine;
            info += "ظرفیت استفاده شده : " + TotalUse + Environment.NewLine + Environment.NewLine;
            info += "ظرفیت آزاد : " + (Capacity - TotalUse) + Environment.NewLine + Environment.NewLine + Environment.NewLine;;

            info += "کالا ها :" + Environment.NewLine + Environment.NewLine;
            foreach (var item in Pdata)
            {
                info += "  \t\t\t\t\t" + item.Title + "\t\t\t" + "  مقدار (" + pro.GetAmount(item.ProductId) + ")" + item.Unit.Title + Environment.NewLine;
            }
            return(info);
        }
Beispiel #2
0
        protected override void OnLoad(EventArgs e)
        {
            grid = new Framwork.GirdControl <Entities.Product>(this);
            grid.AddTextBoxColumn(p => p.Code, "کد");

            grid.AddTextBoxColumn(p => p.Title, "عنوان محصول");

            if (ProductCategoryId.HasValue)
            {
                grid.SetDataSource(pro.GetAll(ProductCategoryId.Value));
            }
            else
            {
                grid.AddTextBoxColumn(p => p.ProductCategoryId, "دسته بندی");
                grid.SetDataSource(pro.GetAll(categoryId));
            }
            base.OnLoad(e);
        }
Beispiel #3
0
 private void ComoboCategory_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         int id = (int)comoboCategory.SelectedValue;
         ICollection <Entities.Product> Source = pro.GetAll(id);
         if (Source.Count != 0)
         {
             btnchose.Enabled = true;
         }
         else
         {
             btnchose.Enabled = false;
         }
     }
     catch
     {
         MessageBox.Show("خطا پیش آمده", "پیام سیستم");
     }
 }