protected void Page_Load(object sender, EventArgs e)
        {
            if (Session.IsNewSession)
            {
                Response.Redirect("~/cust_login.aspx");
            }
            else
            {
                if (!IsPostBack)
                {
                    if (Session["logged"] == null)
                    {
                        Session["logged"] = 0;
                        Session["user"] = "";
                    }

                    if (int.Parse(Session["logged"].ToString()) == 1)
                    {
                        user.Text = Session["user"].ToString();
                    }
                }
                if (!IsPostBack)
                {
                    cylinder_comp_keeper ck = new cylinder_comp_keeper();
                    TextBox1.Text = (ck.get_count()).ToString();
                }
            }
        }
 protected void Button2_Click(object sender, EventArgs e)
 {
     cylinder_comp_keeper ck = new cylinder_comp_keeper();
     ck.delete(int.Parse(TextBox3.Text));
     TextBox1.Text = (ck.get_count()).ToString();
     Label4.Text = "Cylinder ID " + TextBox3.Text + " deleted!"; 
     TextBox3.Text = ""; 
     
 }
       protected void Button1_Click(object sender, EventArgs e)
       {
           cylinder_comp_keeper ck = new cylinder_comp_keeper();
           int id = ck.get_id(); 
           ck.insert(id);
           TextBox2.Text = id.ToString();
           TextBox1.Text = (ck.get_count()).ToString();  
 
       }
Beispiel #4
0
 public int add_cylinder(int id,int count)
 {
     cylinder_comp_keeper ck = new cylinder_comp_keeper();
     cylinder_dealer_keeper dk = new cylinder_dealer_keeper();
     if (ck.get_count() == 0)
     {
         return 0;
     }
     else
     {
         for (int i = 0; i < count; i++)
         {
             cylinder_class cyl = ck.extract();
             ck.update(cyl._id, id);
             dk.insert(cyl, id);
         }
         return 1;
     }
 }
        private void GetData(int ch)
        {
            if (ch != 0)
            {
                cylinder_dealer_keeper cd = new cylinder_dealer_keeper();
                ArrayList arr = cd.GetData(ch) ;

                Session["da"] = arr[0];
                Session["ds"] = arr[1];
            }
            else
            {
                cylinder_comp_keeper ck = new cylinder_comp_keeper();
                ArrayList arr = ck.GetData(ch);

                Session["da"] = arr[0];
                Session["ds"] = arr[1];

            }
        }