예제 #1
0
 protected void uiButtonSearch_Click(object sender, EventArgs e)
 {
     BLL.Packages objData = new Packages();
     objData.SearchPackages(uiTextBoxSearch.Text);
     uiGridViewPackages.DataSource = objData.DefaultView;
     uiGridViewPackages.DataBind();
 }
예제 #2
0
        private void LoadDDLs()
        {
            Cities objCities = new Cities();
            objCities.LoadAll();
            uiDropDownListCity.DataSource = objCities.DefaultView;
            uiDropDownListCity.DataTextField = "ArName";
            uiDropDownListCity.DataValueField = "CityID";
            uiDropDownListCity.DataBind();
            uiDropDownListCity.Items.Insert(0, new ListItem("إختر المدينة", "0"));

            Categories objCategories = new Categories();
            objCategories.LoadAll();
            uiDropDownListCategory.DataSource = objCategories.DefaultView;
            uiDropDownListCategory.DataTextField = "ArName";
            uiDropDownListCategory.DataValueField = "CategoryID";
            uiDropDownListCategory.DataBind();
            uiDropDownListCategory.Items.Insert(0, new ListItem("إختر قطاع العمل", "0"));

            Packages objpack = new Packages();
            objpack.LoadAll();
            uiDropDownListPackage.DataSource = objpack.DefaultView;
            uiDropDownListPackage.DataTextField = "EnName";
            uiDropDownListPackage.DataValueField = "PackageID";
            uiDropDownListPackage.DataBind();
        }
예제 #3
0
        private void LoadDDLs()
        {
            Cities objCities = new Cities();
            objCities.LoadAll();
            uiDropDownListCity.DataSource = objCities.DefaultView;
            uiDropDownListCity.DataTextField = "ArName";
            uiDropDownListCity.DataValueField = "CityID";
            uiDropDownListCity.DataBind();

            Categories objCats = new Categories();
            objCats.LoadAll();
            uiDropDownListCategory.DataSource = objCats.DefaultView;
            uiDropDownListCategory.DataTextField = "ArName";
            uiDropDownListCategory.DataValueField = "CategoryID";
            uiDropDownListCategory.DataBind();

            SubCategories objSubCat = new SubCategories();
            objSubCat.LoadAll();
            uiDropDownListSubCategory.DataSource = objSubCat.DefaultView;
            uiDropDownListSubCategory.DataTextField = "ArName";
            uiDropDownListSubCategory.DataValueField = "SubCategoryID";
            uiDropDownListSubCategory.DataBind();

            Packages objPackages = new Packages();
            objPackages.LoadAll();
            uiDropDownListPackages.DataSource = objPackages.DefaultView;
            uiDropDownListPackages.DataTextField = "EnName";
            uiDropDownListPackages.DataValueField = "PackageID";
            uiDropDownListPackages.DataBind();

            uiDropDownListCategoryFilter.DataSource = objCats.DefaultView;
            uiDropDownListCategoryFilter.DataTextField = "ArName";
            uiDropDownListCategoryFilter.DataValueField = "CategoryID";
            uiDropDownListCategoryFilter.DataBind();
            uiDropDownListCategoryFilter.Items.Insert(0, new ListItem("Select Category", "0"));
        }
예제 #4
0
        protected void uiGridViewPackages_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditPackage")
            {
                Packages objData = new Packages();
                objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
                uiTextBoxEnName.Text = objData.EnName;
                uiTextBoxArName.Text = objData.ArName;
                uiTextBoxEnDesc.Text = objData.EnDescription;
                uiTextBoxArDesc.Text = objData.ArDescription;

                PackageOptionsLink options = new PackageOptionsLink ();
                options.GetPackageOptionsLinksByPackageID(objData.PackageID);
                for (int i = 0; i < options.RowCount; i++)
                {
                    foreach (ListItem item in uiCheckBoxListPackageOptions.Items)
                    {
                        if (item.Value == options.PackageOptionID.ToString())
                        {
                            item.Selected = true;
                            break;
                        }

                    }
                    options.MoveNext();
                }

                uiPanelViewPackages.Visible = false;
                uiPanelEdit.Visible = true;
                CurrentPackage = objData;
            }
            else if (e.CommandName == "DeletePackage")
            {
                Packages objData = new Packages();
                objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
                objData.MarkAsDeleted();
                objData.Save();
                CurrentPackage = null;
                BindData();
            }
        }
예제 #5
0
 private void BindData()
 {
     BLL.Packages objData = new Packages();
     objData.LoadAll();
     uiGridViewPackages.DataSource = objData.DefaultView;
     uiGridViewPackages.DataBind();
 }
예제 #6
0
        private void AddNewRecord()
        {
            Packages objData = new Packages();
            objData.AddNew();
            objData.EnName = uiTextBoxEnName.Text;
            objData.ArName = uiTextBoxArName.Text;
            objData.EnDescription = uiTextBoxEnDesc.Text;
            objData.ArDescription = uiTextBoxArDesc.Text;
            objData.Save();

            foreach (ListItem item in uiCheckBoxListPackageOptions.Items)
            {
                if (item.Selected)
                {
                    PackageOptionsLink Options = new PackageOptionsLink();
                    Options.AddNew();
                    Options.PackageID = objData.PackageID;
                    Options.PackageOptionID = Convert.ToInt32(item.Value);
                    Options.Save();
                }
            }
        }