예제 #1
0
        protected void button1_Click1(object sender, EventArgs e)
        {
            DAL.myClass userDal  = new DAL.myClass();
            string      Username = TextBox1.Text;
            string      Password = txtPassword.Text;

            if (Username == "" || Password == "")
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('No data');</script>"); 
            }
            else
            {
                int result = userDal.Login(Username, Password);
                if (result == 1)
                {
                    Session["user_id"] = TextBox1.Text;
                    Label1.Text        = "Login Successful!";
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert(" + Session["user_id"].ToString() + "');</script>");
                    Response.Redirect("~/Home.aspx");
                }
                else if (result == 0)
                {
                    Session["user_id"] = null;
                    Label1.Text        = "Login Unsuccessful!";
                }

                else if (result == -5)
                {
                    Session["user_id"] = null;
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('SQL Error');</script>"); 
                }
            }
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            DAL.myClass userDal  = new DAL.myClass();
            string      id       = TextBox1.Text;
            string      name     = TextBox2.Text;
            string      mid      = TextBox3.Text;
            string      quantity = TextBox4.Text;
            string      amount   = TextBox5.Text;

            if (id == "" || name == "" || mid == "" || quantity == "" || amount == "")
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('Kindly Enter Data');</script>"); 
            }
            else
            {
                int result  = userDal.customer(id, name, mid, quantity, amount);
                int result1 = userDal.Bill(id);
                int result2 = userDal.repetedcustomer(id);
                if (result == -5 || result1 == -5 || result2 == -5)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('SQL Error');</script>"); 
                }
                else
                {
                    Response.Redirect("~/Output4.aspx");
                }
            }
        }
예제 #3
0
        protected void button2_Click(object sender, EventArgs e)
        {
            DAL.myClass userDal = new DAL.myClass();
            DataTable   DT      = new DataTable();

            if (TextBox8.Text != TextBox9.Text)
            {
                Label1.Text = "Password not same!";
            }
            if (TextBox1.Text == "" || TextBox2.Text == "" || TextBox3.Text == "" || TextBox4.Text == "" || TextBox5.Text == "" || TextBox6.Text == "" || TextBox7.Text == "" || TextBox8.Text == "" || TextBox9.Text == "")
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('Kindly Enter Data');</script>"); 
            }
            else if (TextBox8.Text == TextBox9.Text)
            {
                int result = userDal.Signup(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, Int32.Parse(TextBox5.Text), TextBox7.Text, TextBox6.Text, TextBox8.Text);
                if (result == 0)
                {
                    Label1.Text = "Username already exists!";
                }

                else if (result == 1)
                {
                    Label1.Text = "Account made successfully!";
                }

                else if (result == -5)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('SQL Error');</script>"); 
                }
            }
        }
예제 #4
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            DAL.myClass userDal      = new DAL.myClass();
            string      PurchaseID   = TextBox1.Text;
            string      DealerID     = TextBox2.Text;
            string      Medicineid   = TextBox3.Text;
            string      PurchaseDate = TextBox4.Text;
            string      Quantity     = TextBox5.Text;
            string      price        = TextBox6.Text;
            string      Totalprice   = TextBox7.Text;


            if (TextBox1.Text == "" || TextBox2.Text == "" || TextBox3.Text == "" || TextBox4.Text == "" || TextBox5.Text == "" || TextBox6.Text == "" || TextBox7.Text == "")
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('Kindly Enter Data');</script>"); 
            }
            else
            {
                int result = userDal.dealer(PurchaseID, DealerID, Medicineid, PurchaseDate, Quantity, price, Totalprice);
                userDal.showdealerbill();
                if (result == -5)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('SQL Error');</script>"); 
                }
                else
                {
                    Response.Redirect("~/Output5.aspx");
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user_id"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            else if (Session["Employ"].ToString() == "1")
            {
                DAL.myClass userDal = new DAL.myClass();
                DataTable   table   = new DataTable();
                table = userDal.showallEmployees();
                GridView1.DataSource    = table;
                GridView1.EmptyDataText = "No Records Found";

                GridView1.DataBind();
            }
            else if (Session["Employ"].ToString() == "2")
            {
                DAL.myClass userDal = new DAL.myClass();
                DataTable   table   = new DataTable();
                table = userDal.findemploy(Session["Eid"].ToString());
                GridView1.DataSource    = table;
                GridView1.EmptyDataText = "No Records Found";
                GridView1.DataBind();
            }
            else if (Session["Employ"].ToString() == "3")
            {
                DAL.myClass userDal = new DAL.myClass();
                DataTable   table   = new DataTable();
                table = userDal.findemployname(Session["Eid"].ToString());
                GridView1.DataSource    = table;
                GridView1.EmptyDataText = "No Records Found";
                GridView1.DataBind();
            }
        }
        protected void button2_Click(object sender, EventArgs e)
        {
            DAL.myClass userDal = new DAL.myClass();
            DataTable   DT      = new DataTable();

            if (Password.Text != ConfPassword.Text)
            {
                Label1.Text = "Password not same!";
            }
            if (Name.Text == "" || Address.Text == "" || Salary.Text == "" || Designation.Text == "" || Email.Text == "" || Password.Text == "" || ConfPassword.Text == "" || Contact.Text == "" || UName.Text == "")
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('Kindly Enter Data');</script>"); 
            }
            else if (Password.Text == ConfPassword.Text)
            {
                int result = userDal.Signup(Name.Text, Contact.Text, Address.Text, Designation.Text, Int32.Parse(Salary.Text), Email.Text, Gender.Text, UName.Text, Password.Text);
                if (result == 0)
                {
                    Label1.Text = "Username already exists!";
                }

                else if (result == 1)
                {
                    Label1.Text = "Account made successfully!";
                }

                else if (result == -5)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('SQL Error');</script>"); 
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Did"].ToString() == "1")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.showalldealers();
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Did"].ToString() == "2")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.showallcompanies();
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Did"].ToString() == "3")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.showallpurchases();
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Did"].ToString() == "4")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.showallsales();
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Did"].ToString() == "5")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.searchdealerbyid(Session["Did2"].ToString());
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Did"].ToString() == "6")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.DealernamefromCompID(Session["Did2"].ToString());
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
 }
예제 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DAL.myClass userDal = new DAL.myClass();
            DataTable   table   = new DataTable();

            table = userDal.showdealerbill();
            GridView1.DataSource    = table;
            GridView1.EmptyDataText = "Amount is less or due to another fault No record found";
            GridView1.DataBind();
        }
예제 #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["user_id"] == null)
     {
         Response.Redirect("Login.aspx");
     }
     else
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.showdealerbill();
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "Amount is less or due to another fault No record found";
         GridView1.DataBind();
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user_id"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            else
            {
                DAL.myClass userDal = new DAL.myClass();

                MedicineID.DataSource = userDal.getMedicineIdList();
                MedicineID.DataBind();

                CustomerID.DataSource = userDal.getCustomerIdList();
                CustomerID.DataBind();
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            DAL.myClass userDal  = new DAL.myClass();
            string      id       = TextBox1.Text;
            string      name     = TextBox2.Text;
            string      mid      = TextBox3.Text;
            string      quantity = TextBox4.Text;
            string      amount   = TextBox5.Text;

            if (id == "" || name == "" || mid == "" || quantity == "" || amount == "")
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('Kindly Enter Data');</script>"); 
            }
            else
            {
                userDal.customer(id, name, mid, quantity, amount);
                TextBox3.Text = "";
                TextBox4.Text = "";
            }
        }
예제 #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["user_id"] == null)
     {
         Response.Redirect("Login.aspx");
     }
     else if (Session["Button"].ToString() == "1")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.showallMedicine();
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Button"].ToString() == "2")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.showOutOfStock();
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Button"].ToString() == "3")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.showAllExpired();
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Button"].ToString() == "4")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.searchMedicinebyId(Session["id"].ToString());
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Button"].ToString() == "5")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.ExpireMedicinebyId(Session["id"].ToString());
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Button"].ToString() == "6")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.whotookthesemedicine(Session["id"].ToString());
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Button"].ToString() == "7")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.findallinfo(Session["id"].ToString());
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Button"].ToString() == "8")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.quantityleft(Session["id"].ToString());
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Button"].ToString() == "9")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.purchasedate(Session["id"].ToString());
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Button"].ToString() == "10")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.noofsale(Session["id"].ToString());
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Button"].ToString() == "11")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.updatemanf(Session["id"].ToString(), Session["id2"].ToString());
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
     else if (Session["Button"].ToString() == "12")
     {
         DAL.myClass userDal = new DAL.myClass();
         DataTable   table   = new DataTable();
         table = userDal.updateexpiry(Session["id"].ToString(), Session["id2"].ToString());
         GridView1.DataSource    = table;
         GridView1.EmptyDataText = "No Records Found";
         GridView1.DataBind();
     }
 }