Exemplo n.º 1
0
    protected void Fine_User(object sender, EventArgs e)
    {
        int    ttid = Convert.ToInt32(Session["ttid"].ToString());
        Button btn  = (Button)sender;

        string[] arguments = btn.CommandArgument.ToString().Split(new char[] { ',' });
        string   parkingid = arguments[0];
        int      userid    = Convert.ToInt32(arguments[1]);
        string   name      = arguments[1];
        int      index     = Convert.ToInt32(arguments[2]);
        int      parking   = Convert.ToInt32(parkingid);
        int      user      = Convert.ToInt32(userid);

        if (parking == 0 || user == 0)
        {
            Response.Write("there is no user");
        }
        else if (index == 2 || index == 4)
        {
            Response.Write("its parking here u cannot fine the player");
        }
        else
        {
            fine fineuser = new fine();
            fineuser.Finebyuser(ttid, parking, userid);
        }
        GridView1.DataSource = new user_parking_view().GetUsersOnMyParking(ttid);
        GridView1.DataBind();
    }
Exemplo n.º 2
0
 public bool AddCategory(string cat, string amount)
 {
     if ((from i in dc.fines where i.cat.Equals(cat) select i.cat).Count() == 0)
     {
         fine fs = new fine();
         fs.cat       = cat;
         fs.total_fee = amount;
         dc.fines.InsertOnSubmit(fs);
         dc.SubmitChanges();
         return(true);
     }
     else
     {
         return(false);
     }
 }