Пример #1
0
    protected void SortDDL_SelectedIndexChanged(object sender, EventArgs e)
    {
        int    x     = SortDDL.SelectedIndex;
        string order = "";

        switch (x)
        {
        case 1:
        {
            order = " ORDER BY OrderTotalMoney DESC";
            break;
        }

        case 3:
        {
            order = " ORDER BY OrderIsSupplied";
            break;
        }

        case 2:
        {
            order = " ORDER BY OrderDate";
            break;
        }
        }
        Pharmcy.PharmcyWS webser = new Pharmcy.PharmcyWS();
        DataSet           ds     = webser.GetUserOrders((string)Session["userId"], order);

        if (ds.Tables[0].Rows.Count != 0)
        {
            ShowOrder.Visible    = true;
            ShowDetails.Visible  = false;
            CloseOrders.Visible  = true;
            ShowOrder.DataSource = ds;
            ShowOrder.DataBind();
        }
        else
        {
            CloseOrders_Click(sender, e);
            Response.Write("<script>alert('לא נמצאו הזמנות')</script>");
        }
    }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         User u = (User)Session["user"];
         HelloLabel.Text = u.CUserName;
         Pharmcy.PharmcyWS webser = new Pharmcy.PharmcyWS();
         Session["userId"] = u.CUserId;
         DataSet ds = webser.GetUserOrders(u.CUserId, "");
         if (ds.Tables[0].Rows.Count != 0)
         {
             CloseOrders.Visible  = true;
             ShowOrder.Visible    = true;
             ShowOrder.DataSource = ds;
             ShowOrder.DataBind();
         }
         else
         {
             Response.Write("<script>alert('לא נמצאו הזמנות')</script>");
         }
     }
 }