Exemplo n.º 1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if ((TextBox1.Text =="" ) || (TextBox3.Text == "") || (TextBox4.Text == "") || (TextBox5.Text == "") || (TextBox6.Text == "") || (TextBox7.Text == "") || (DropDownList1.SelectedItem.ToString() == "Select") || (DropDownList2.SelectedItem.ToString() == "Select") || (DropDownList3.SelectedItem.ToString() == "Select"))
            {

                Label13.Text = "Error in submitting application! Please resubmit!";
            }
            else
            {

                customer_keeper ck = new customer_keeper();
                int id = ck.get_id();
                customer_class cc = new customer_class();
                cc._id = id;
                cc._name = TextBox1.Text;
                cc._father = TextBox4.Text;
                cc._address = TextBox3.Text;
                cc._email = TextBox2.Text;
                cc._contact = TextBox6.Text;
                cc._dist = DropDownList3.SelectedItem.ToString();
                cc._pin = TextBox5.Text;
                cc._dob = TextBox7.Text;  

                dealer_keeper dk = new dealer_keeper();
                int dealer = dk.GetDealerID(cc._dist);
                cc._dealer_id = dealer;

                ck.insert(cc);

                Label12.Text = "Your New connection request has been submitted for Validation.";
                Label13.Text = "Customer ID " + id.ToString();

            }
            
        }
Exemplo n.º 2
0
        protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
        {
            string city = DropDownList2.SelectedItem.Text;
            dealer_keeper dk = new dealer_keeper();

            ArrayList arr = dk.GetData(city);
            Session["da"] = arr[0];
            Session["ds"] = arr[1];
            SetData(); 
        }
Exemplo n.º 3
0
        protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
        {
            string city = DropDownList2.SelectedItem.Text;
            dealer_keeper dk = new dealer_keeper();

            ArrayList arr = dk.GetDataList(city);
            foreach (string s in arr)
            {
                DropDownList3.Items.Add(s);   
            }
        }
Exemplo n.º 4
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (DropDownList3.SelectedItem.ToString() == TextBox2.Text) { Label8.Text = "you cannot change to the same dealer!"; }
     else {
         dealer_keeper dk = new dealer_keeper();
         int id = dk.GetDealerID(DropDownList3.SelectedItem.ToString());
         port_keeper pk = new port_keeper();
         int id1 = pk.get_id();
         pk.insert(id1, int.Parse(TextBox1.Text), id,TextBox3.Text );
         Label8.Text = "Porting id generated = " + id1; 
         
     }
 }
Exemplo n.º 5
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if ((TextBox1.Text != "") || (TextBox2.Text != "") || (TextBox4.Text != "") || (TextBox5.Text != "") || (TextBox6.Text != "") || (TextBox7.Text != "") || (DropDownList1.SelectedItem.ToString() != "Select")&&(TextBox5.Text == TextBox6.Text))
     {
         dealer_keeper dk = new dealer_keeper();
         int id = dk.get_id();
         dk.insert(id, TextBox1.Text, TextBox2.Text, DropDownList2.SelectedItem.ToString(), DropDownList1.SelectedItem.ToString(), (TextBox4.Text), TextBox5.Text, TextBox7.Text);
         Label10.Text = "YOUR DEALERSHIP APPLICATION HAS BEEN SUBMITTED. YOUR DEALER ID = " + id.ToString();
     }
     else
     {
         Label10.Text = "ERROR IN SUBMITTING FORM";
     }
 }
Exemplo n.º 6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                CheckBox chk = ((CheckBox)(GridView1.Rows[i].FindControl("CheckBox1")));
                if (chk.Checked)
                {
                    GridViewRow gr = GridView1.Rows[i];
                    int id_1 = int.Parse(((Label)(gr.FindControl("Label1"))).Text);
                    int id = int.Parse(((Label)(gr.FindControl("Label3"))).Text);
                    int x = int.Parse(((Label)(gr.FindControl("Label2"))).Text);
                    order_dealer_keeper odk = new order_dealer_keeper();
                    odk.update_status(id_1);
                    dealer_manager dm = new dealer_manager();
                    dealer_keeper dk = new dealer_keeper();
                    int v = dm.add_cylinder(id, x);
                    dk.update_count(id); 
                    GetData();
                    SetData();

                }
            }
        }
Exemplo n.º 7
0
        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            TextBox count = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[1].FindControl("TextBox1")));
            ((DataSet)Session["ds"]).Tables[0].Rows[e.RowIndex][6] = int.Parse (count.Text);

            TextBox idn = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[1].FindControl("TextBox2")));
            ((DataSet)Session["ds"]).Tables[0].Rows[e.RowIndex][0] = int.Parse(idn.Text);

            int x = int.Parse(count.Text);
            int id = int.Parse(idn.Text);

            dealer_keeper dk = new dealer_keeper ();
            dealer_class dc = dk.GetFullDealerData(id);

            if (x < dc._stock_no)
            {
                Label3.Text = "Error! Cannot update lesser amount!";
            }
            else
            {
                x = x - dc._stock_no; 
                dealer_manager dm = new dealer_manager();
                int v = dm.add_cylinder(id, x);
                dk.update_count(id); 
                if (v == 0) Label3.Text = "Sorry. Stock Empty! Refill Stock Now!";
                else
                {

                    SqlCommandBuilder cb = new SqlCommandBuilder((SqlDataAdapter)Session["da"]);
                    ((SqlDataAdapter)Session["da"]).Update((DataSet)Session["ds"], "dealer");
                }
            }
            GetData(Session["city"].ToString());
            GridView1.EditIndex = -1;
            SetData();

        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string user = TextBox1.Text;
            string pass = TextBox2.Text;

            if (user == "admin" && pass == "admin")
            {
                Session["logged"] = 1;
                Session["user"] = "******";
                Response.Redirect("~/company/view_cust_data.aspx");
            }
            else if (user != "admin")
            {
                int id = int.Parse(user);
                dealer_keeper dk = new dealer_keeper();
                int ch = dk.search_user(id, pass);
                if (ch == 1)
                {
                    Session["logged"] = 1;
                    Session["user"] = "******" + id.ToString();
                    Session["dealer_id"] = id;
                    Response.Redirect("~/dealer/oredr_request.aspx");
                }
                else
                {
                    Label3.Text = "Invalid UserName or Password/Your Dealership account might not be verified till now";
                    Session["logged"] = 0;
                }

            }
            else
            {
                Session["logged"] = 0;
 
            }
            
        }
Exemplo n.º 9
0
        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"] = "";
                        Session["user_id"] = 0;
                    }

                    if (int.Parse(Session["logged"].ToString()) == 1)
                    {
                        user.Text = Session["user"].ToString();

                        TextBox1.Text = Session["user_id"].ToString();

                        customer_keeper ck = new customer_keeper();
                        customer_class cc = ck.GetData(int.Parse(Session["user_id"].ToString()));
                        Label3.Text = cc._renewal.ToString();
                        Label5.Text = cc._subsidy_count.ToString();
                        Label7.Text = cc._booking_count.ToString();
                        dealer_keeper dk = new dealer_keeper();
                        dealer_class dc = dk.GetFullDealerData(cc._dealer_id);
                        Label9.Text = dc._name.ToString() + ", " + dc._city + ", " + dc._state;    
                        GetData(int.Parse(Session["user_id"].ToString()));
                        SetData();
                    }
                }
            }
        }
Exemplo n.º 10
0
        protected void GetData(string city)
        {
            dealer_keeper dk = new dealer_keeper();
            

            ArrayList arr = dk.GetData(city);
            Session["da"] = arr[0];
            Session["ds"] = arr[1];
        }