public void BindCategoryDetail(int categoryCode)
    {
        DALCategory obj = new DALCategory();
        DataSet     ds  = obj.Category_GetDetail(categoryCode);

        txtCategoryName.Text = ds.Tables[0].Rows[0]["CategoryName"].ToString();
    }
Пример #2
0
 private void BtnBookUpdate_Click(object sender, EventArgs e)
 {
     // Textbox'lardan gelen veriler kontrol ediliyor boş veri varsa uyarı mesajı bırakıyoruz çünkü veritabanında boş verilerin bulunmasını istemiyoruz
     // EntityBook üzerinde oluşturduğumuz nesnemize gerekli atamaları yaptıktan sonra
     // Nesnelerimizin kontrolünü yapmak üzere Mantıksal Katmana verilerimizi gönderiyoruz.
     if (TxtBookName.Text != "" && TxtBookISBN.Text != "" && TxtBookPublisher.Text != "" && TxtBookPage.Text != "" && TxtBookPublishedDate.Text != "" &&
         CmbIsAvailable.SelectedItem.ToString() != "" && cmbBookCat.SelectedItem.ToString() != "" && cmbBookWriter.SelectedItem.ToString() != "")
     {
         EntityBook book = new EntityBook();
         book.bookID            = int.Parse(TxtBookId.Text);
         book.bookName          = TxtBookName.Text;
         book.bookISBN          = TxtBookISBN.Text;
         book.bookPublisher     = TxtBookPublisher.Text;
         book.bookPage          = TxtBookPage.Text;
         book.bookSummarize     = RTxtSummarize.Text;
         book.bookPublishedDate = TxtBookPublishedDate.Text;
         book.isBookAvailable   = CmbIsAvailable.SelectedItem.ToString();
         book.bookCategoryId    = DALCategory.CategoryList().FirstOrDefault(n => n.categoryName == cmbBookCat.SelectedItem.ToString());
         book.bookWriterId      = DALWriter.WriterList().FirstOrDefault(n => n.writerName == cmbBookWriter.SelectedItem.ToString());
         LogicBook.LLBookUpdate(book);
         MessageBox.Show("Kitap Başarılı Bir Şekilde Güncellendi");
         TxtBookId.Text            = "";
         TxtBookName.Text          = "";
         TxtBookISBN.Text          = "";
         TxtBookPublisher.Text     = "";
         TxtBookPage.Text          = "";
         RTxtSummarize.Text        = "";
         TxtBookPublishedDate.Text = "";
     }
     else
     {
         MessageBox.Show("Alanları Boş Bırakmayınız");
     }
 }
Пример #3
0
    public void BindCategories()
    {
        DALCategory obj = new DALCategory();
        DataSet     ds  = obj.Category_GetList();

        rptCategories.DataSource = ds.Tables[0];
        rptCategories.DataBind();
    }
Пример #4
0
 public static CategoryEntity ToBllEntity(this DALCategory category)
 {
     return(new CategoryEntity()
     {
         Id = category.Id,
         Name = category.Name
     });
 }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Categories c = new Categories();

        c.CategoryName = txtCategoryName.Text;

        DALCategory obj = new DALCategory();

        obj.Category_Add(c);
    }
Пример #6
0
 public static bool LLCategoryUpdate(EntityCategory cat)
 {
     if (cat.categoryName != "")
     {
         return(DALCategory.CategoryUpdate(cat));
     }
     else
     {
         return(false);
     }
 }
Пример #7
0
 public static bool LLCategoryDelete(int cat)
 {
     if (cat >= 1)
     {
         return(DALCategory.CategoryDelete(cat));
     }
     else
     {
         return(false);
     }
 }
Пример #8
0
 // Logic Layer ana form üzerinden erişilen bir katmandır ve gerekli mantıksal kontrollerin katman olarak geçer
 // Gerekli kontrolleri başarılı bir şekilde geçen Logic Methodlar Data Access Layerdan uygun methodu çağırarak programın çalışmasına devam edilir
 public static int LLCategorySave(EntityCategory cat)
 {
     if (cat.categoryName != "")
     {
         //burada sifreyi sifrele
         return(DALCategory.CategorySave(cat));
     }
     else
     {
         return(-1);
     }
 }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        Categories c = new Categories();

        c.CategoryCode = Convert.ToInt32(Request.QueryString["c_c_p"]);
        c.CategoryName = txtCategoryName.Text;

        DALCategory obj = new DALCategory();

        obj.Category_Update(c);

        Response.Redirect("CategoryList.aspx");
    }
        private void bookPublishedInfo()
        {
            chart5.Titles.Add("Book Publish Info");
            chart5.Series["Kitap"].IsValueShownAsLabel = true;


            //var pd = DALBook.BookList().Where(m => Convert.ToDateTime(m.bookPublishedDate)< localDate);
            //var bookName = DALBook.BookList().Select(m => m.bookName);
            foreach (var item in DALCategory.CategoryList())
            {
                int count = DALBook.BookList().Where(m => m.bookCategoryId.categoryId == item.categoryId).Count();
                chart5.Series["Kitap"].Points.AddXY(item.categoryName, count);
            }
        }
Пример #11
0
        public static DALCategory GetDALEntity(BLLCategory category)
        {
            DALCategory result = new DALCategory()
            {
                Id   = category.Id,
                Name = category.Name
            };

            foreach (var sphere in category.Sphere)
            {
                result.Sphere.Add(SphereMapper.GetDALEntity(sphere));
            }
            return(result);
        }
Пример #12
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        foreach (RepeaterItem item in rptCategories.Items)
        {
            CheckBox chbSelect = (CheckBox)item.FindControl("chbSelect");
            if (chbSelect.Checked)
            {
                Label       lblCategoryCode = (Label)item.FindControl("lblCategoryCode");
                DALCategory obj             = new DALCategory();
                obj.Category_Delete(Convert.ToInt32(lblCategoryCode.Text));
            }
        }

        BindCategories();
    }
Пример #13
0
        protected void lvCat_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            DAL.DALCategory dALCategory = new DALCategory();
            int             catParentID = int.Parse(e.CommandArgument.ToString());

            if (String.Equals(e.CommandName, "btnProd") && dALCategory.GetCategoriesEnfantImgByParentID(catParentID).Count == 0)
            {
                string url = "Produits.aspx?idcat=" + catParentID;
                Response.Redirect(url);
            }
            else
            {
                string url = "Categories.aspx?idCat=" + catParentID;
                Response.Redirect(url);
            }
        }
Пример #14
0
        private void ChargeMenu()
        {
            StringBuilder stringBuilder = new StringBuilder();
            Category      category      = new Category();

            DAL.DALCategory    dALCategory = new DALCategory();
            HashSet <Category> catparents  = new HashSet <Category>();

            catparents = dALCategory.GetCategoryParent();
            HashSet <Category> catenfants = new HashSet <Category>();
            string             caret      = string.Empty;
            string             classMP    = string.Empty;
            string             classMPDT  = string.Empty;

            foreach (Category item in catparents)
            {
                catenfants = dALCategory.GetCategoryByParentId(item.Id);
                if (catenfants.Count - 1 > 0)
                {
                    caret     = "caret";
                    classMP   = "dropdown-toggle";
                    classMPDT = "dropdown";
                }
                else
                {
                    caret     = string.Empty;
                    classMP   = string.Empty;
                    classMPDT = string.Empty;
                }
                stringBuilder.Append($"<li class='dropdown'><a runat='server' class='{classMP}' data-toggle='{classMPDT}' href=\"Produits.aspx?idcat=" + item.Id + "\">" + item.Name + $"<span class='{caret}'></span></a>");
                if (catenfants.Count - 1 > 0)
                {
                    stringBuilder.Append("<ul class='dropdown-menu'>");
                    foreach (var i in catenfants)
                    {
                        stringBuilder.Append("<li class='dropdown-item'><a runat='server'href=\"Produits.aspx?idcat=" + i.Id + "\">" + i.Name + "</a></li>");
                    }

                    stringBuilder.Append("</ul>");
                }
            }
            //stringBuilder.Append("<li class='dropdown'><a runat=\"server\" href=\"~/ VotrePanier\">Panier</a></li>");
            listcatp.InnerHtml = stringBuilder.ToString();
        }
Пример #15
0
        public static DALCategory GetDALEntity(this Category ORMEntity)
        {
            if (ORMEntity == null)
            {
                throw new ArgumentNullException($"{ORMEntity} is null!");
            }

            var newDALCategory = new DALCategory
            {
                Id   = ORMEntity.Id,
                Name = ORMEntity.Name,
            };

            foreach (var sphere in ORMEntity.Sphere)
            {
                newDALCategory.Sphere.Add(sphere.GetDALEntity());
            }
            return(newDALCategory);
        }
Пример #16
0
        public static Category GetORMEntity(this DALCategory DalEntity)
        {
            if (DalEntity == null)
            {
                throw new ArgumentNullException($"{DalEntity} is null!");
            }

            var newCategory = new Category
            {
                Id   = DalEntity.Id,
                Name = DalEntity.Name,
            };

            foreach (var sphere in DalEntity.Sphere)
            {
                newCategory.Sphere.Add(sphere.GetORMEntity());
            }
            return(newCategory);
        }
Пример #17
0
        public bool DeleteCategory(Category category)
        {
            DALCategory categoryDAL = new DALCategory();

            return(categoryDAL.DeleteCategory(category));
        }
Пример #18
0
 public List <CategoryDic> GetCategoryIdName()
 {
     return(dbManager.Execute(conn => DALCategory.GetCategoryIdName(conn)));
 }
 public void Create(DALCategory e)
 {
     context.Set <Category>().Add(e.GetORMEntity());
 }
Пример #20
0
 public bool InsertNewAppData(NewAppData model)
 {
     return(dbManager.Execute(conn => DALCategory.InsertNewAppData(conn, model)));
 }
Пример #21
0
 public int GetMaxModelFloor(NewAppData model)
 {
     return(dbManager.Execute(conn => DALCategory.GetMaxModelFloor(conn, model)));
 }
Пример #22
0
 public bool InsertCategory(CategoryDic model)
 {
     return(dbManager.Execute(conn => DALCategory.InsertCategory(conn, model)));
 }
Пример #23
0
 public List <NewAppData> GetNewAppData()
 {
     return(dbManager.Execute(conn => DALCategory.GetNewAppData(conn)));
 }
 public void UpDate(DALCategory e)
 {
     context.Entry(e.GetORMEntity()).State = EntityState.Modified;
 }
 public void Delete(DALCategory e)
 {
     context.Set <Category>().Attach(e.GetORMEntity());
     context.Set <Category>().Remove(e.GetORMEntity());
 }
Пример #26
0
 public static List <EntityCategory> LLCategoryList()
 {
     return(DALCategory.CategoryList());
 }
Пример #27
0
        public List <Category> GetCategoriesByTypeId(int typeId)
        {
            DALCategory categoyDAL = new DALCategory();

            return(categoyDAL.GetCategoriesByTypeId(typeId));
        }
Пример #28
0
        public bool InsertCategory(Category category)
        {
            DALCategory categoryDAL = new DALCategory();

            return(categoryDAL.InsertCategory(category));
        }
Пример #29
0
        public List <Category> GetcategoryList()
        {
            DALCategory categoryDAL = new DALCategory();

            return(categoryDAL.GetCategoryList());
        }
Пример #30
0
        public bool UpdateCategory(Category category)
        {
            DALCategory categoryDAL = new DALCategory();

            return(categoryDAL.UpdateCategory(category));
        }