public void DisplayResultView(DAY day, string result)
    {
        ChangeView((int)State.SEARCH);
        SearchViewManager s_viewManager = currentView.GetComponent <SearchViewManager>();

        s_viewManager.SetView(day, result);
    }
Esempio n. 2
0
 public ViewSalesBetweenTwoDatesUI()
 {
     searchViewManager = new SearchViewManager();
 }
Esempio n. 3
0
        protected void searchButton_OnClick(object sender, EventArgs e)
        {
            SearchViewManager searchViewManager = new SearchViewManager();

            if (companyDropDownList.SelectedIndex != 0 && categoryDropDownList.SelectedIndex == 0)
            {
                int               companyId   = Convert.ToInt32(companyDropDownList.SelectedItem.Value);
                string            companyName = companyDropDownList.SelectedItem.Text;
                List <SearchView> asearchView = searchViewManager.SearchByCompany(companyId, companyName);
                if (asearchView.Count > 0)
                {
                    ViewState["stockin"]          = asearchView;
                    searchViewGridView.DataSource = asearchView;
                    searchViewGridView.DataBind();
                    // pdfbuttonid.Visible = true;
                }
                else
                {
                    // LabelMessage.Visible = true;
                    //LabelMessage.Text = "Quantity not Available";
                    searchViewGridView.DataSource = asearchView;
                    searchViewGridView.DataBind();
                    //pdfbuttonid.Visible = false;
                }
            }
            else if (companyDropDownList.SelectedIndex == 0 && categoryDropDownList.SelectedIndex != 0)
            {
                int categoryId = Convert.ToInt32(categoryDropDownList.SelectedItem.Value);
                List <SearchView> asearchView = searchViewManager.SearchByCategory(categoryId);
                if (asearchView.Count > 0)
                {
                    ViewState["stockin"]          = asearchView;
                    searchViewGridView.DataSource = asearchView;
                    searchViewGridView.DataBind();
                    //pdfbuttonid.Visible = true;
                }
                else
                {
                    //LabelMessage.Visible = true;
                    //LabelMessage.Text = "Quantity not Available";
                    searchViewGridView.DataSource = asearchView;
                    searchViewGridView.DataBind();
                    // pdfbuttonid.Visible = false;
                }
            }
            else if (companyDropDownList.SelectedIndex != 0 && categoryDropDownList.SelectedIndex != 0)
            {
                int companyId  = Convert.ToInt32(companyDropDownList.SelectedItem.Value);
                int categoryId = Convert.ToInt32(categoryDropDownList.SelectedItem.Value);
                List <SearchView> asearchView = searchViewManager.SearchByCompanyAndCategory(companyId, categoryId);
                if (asearchView.Count > 0)
                {
                    ViewState["stockin"]          = asearchView;
                    searchViewGridView.DataSource = asearchView;
                    searchViewGridView.DataBind();
                    //pdfbuttonid.Visible = true;
                }
                else
                {
                    //    LabelMessage.Visible = true;
                    //    LabelMessage.Text = "Quantity not Available";
                    searchViewGridView.DataSource = asearchView;
                    searchViewGridView.DataBind();
                }
            }
            else if (companyDropDownList.SelectedIndex == 0 && categoryDropDownList.SelectedIndex == 0)
            {
                List <SearchView> asearchView = searchViewManager.SearchByAll();
                if (asearchView.Count > 0)
                {
                    ViewState["stockin"]          = asearchView;
                    searchViewGridView.DataSource = asearchView;
                    searchViewGridView.DataBind();
                    //pdfbuttonid.Visible = true;
                }
                else
                {
                    // LabelMessage.Visible = true;
                    // LabelMessage.Text = "Stock In Quantity is not Available";
                    searchViewGridView.DataSource = asearchView;
                    searchViewGridView.DataBind();
                    // pdfbuttonid.Visible = false;
                }
            }
        }