protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack)
     {
         return;
     }
     if (Session["Oturum"] != null)
     {
         User currentUser = Session["Oturum"] as User;
         if (currentUser != default(User))
         {
             rptSiparislerim.DataSource = GgDbProvider.GetOrderBySupplierId(currentUser.ObjectID);
             rptSiparislerim.DataBind();
         }
         if (rptSiparislerim.Items.Count == 0)
         {
             lblNoSiparis.Visible = true;
         }
     }
     else
     {
         Session["URL"] = "gelensiparis";
         Response.Redirect("Login.aspx");
     }
 }
    protected void rptSiparislerim_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "iptal")
        {
            int   id = Convert.ToInt32(e.CommandArgument);
            Order o  = GgDbProvider.GetOrderByObjectId(id);
            if (o != default(Order))
            {
                o.StatusId = 4;
            }
            o.LastOperationDate = DateTime.Now;
        }
        if (e.CommandName == "onay")
        {
            int   id = Convert.ToInt32(e.CommandArgument);
            Order o  = GgDbProvider.GetOrderByObjectId(id);
            if (o != default(Order))
            {
                o.StatusId = 2;
            }
            o.LastOperationDate = DateTime.Now;
        }

        GgDbProvider.SaveChanges();
        if (Session["Oturum"] != null)
        {
            User currentUser = Session["Oturum"] as User;
            if (currentUser != default(User))
            {
                rptSiparislerim.DataSource = GgDbProvider.GetOrderBySupplierId(currentUser.ObjectID);
                rptSiparislerim.DataBind();
            }
        }
        else
        {
            Session["URL"] = "gelensiparis";
            Response.Redirect("Login.aspx");
        }
    }