public const int constMoveType = 2; //mal kabul için move type 2 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["User"] == null) { Response.Redirect("Login.aspx"); } ddlstProduct.DataSource = new bllProducts().GetAllProducts(); ddlstProduct.AppendDataBoundItems = true; ddlstProduct.DataTextField = "ProductCode"; ddlstProduct.DataValueField = "Id"; ddlstProduct.Items.Insert(0, new ListItem("", "-1")); ddlstProduct.DataBind(); ddlstLocHall.DataSource = new bllHall().getAll(); ddlstLocHall.DataTextField = "HallName"; ddlstLocHall.DataValueField = "Id"; ddlstLocHall.DataBind(); ddlstLocStore.DataSource = new bllStore().getAll(); ddlstLocStore.DataTextField = "StoreType"; ddlstLocStore.DataValueField = "Id"; ddlstLocStore.DataBind(); ddlstStatus.DataSource = new bllStatus().GetAll(); ddlstStatus.DataTextField = "StatusType"; ddlstStatus.DataValueField = "Id"; ddlstStatus.DataBind(); List <Location> lstLocation = new bllLocation().GetAll(); ddlstColon.DataSource = lstLocation.Select(x => x.Column).Distinct().ToList(); ddlstColon.DataBind(); ddlstShelf.DataSource = lstLocation.Select(x => x.Shelf).Distinct().ToList(); ddlstShelf.DataBind(); Calendar1.Visible = false; } }
protected void btnFiltre_Click(object sender, EventArgs e) { try { List <Location> lst = new bllLocation().GetAll(); lst = lst.Where(x => (string.IsNullOrEmpty(txtStore.Text) || (x.StoreType.IndexOf(txtStore.Text, 0, StringComparison.CurrentCultureIgnoreCase) > -1)) && (string.IsNullOrEmpty(txtHall.Text) || (x.HallType.IndexOf(txtHall.Text, 0, StringComparison.CurrentCultureIgnoreCase) > -1)) && (string.IsNullOrEmpty(txtColon.Text) || (x.Column.CompareTo(int.Parse(txtColon.Text)) == 0)) && (string.IsNullOrEmpty(txtShelf.Text) || (x.Shelf.CompareTo(int.Parse(txtShelf.Text)) == 0)) ).ToList(); lstLocationsView.DataSource = lst; lstLocationsView.DataBind(); }catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "alert", ex.Message, true); Response.Write(ex.Message); } }