Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SupProps up = new SupProps();

            up.S_id = Request.QueryString["edtsup"];
            SupBLL    ub = new SupBLL();
            DataTable dt = ub.searchSupBLL(up);

            if (dt.Rows.Count > 0)
            {
                txt_sid.Text     = dt.Rows[0]["sup_id"].ToString();
                txt_name.Text    = dt.Rows[0]["name"].ToString();
                txt_cel.Text     = dt.Rows[0]["cell"].ToString();
                txt_address.Text = dt.Rows[0]["address"].ToString();
            }
            else
            {
                Response.Redirect("viewsuppliers.aspx?error=Sorry, Something Went Wrong....!");
            }
        }
Пример #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            SupProps p = new SupProps();

            p.S_id      = txt_sid.Text;
            p.S_name    = txt_name.Text;
            p.S_cell    = txt_cel.Text;
            p.S_address = txt_address.Text;

            SupBLL cus = new SupBLL();

            if (cus.updateSupBLL(p))
            {
                Response.Redirect("viewsuppliers.aspx?success=Supplier Updated Successfully");
            }
            else
            {
                Response.Redirect("viewsuppliers.aspx?error=Sorry, Something Went Wrong....!");
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SupBLL s = new SupBLL();;

            Repeater1.DataSource = s.AllSupBLL();
            Repeater1.DataBind();

            if (Request.Params.AllKeys.Contains("dltsup"))
            {
                SupProps p = new SupProps();
                p.S_id = Request.QueryString["dltsup"];
                SupBLL ss = new SupBLL();
                if (ss.updateSupBLL(p))
                {
                    Response.Redirect("viewsuppliers.aspx?success=Deleted Successfully");
                }
                else
                {
                    Response.Redirect("viewsuppliers.aspx?error=Something Went Wrong....!");
                }
            }
        }
Пример #4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            SupProps p = new SupProps();

            p.S_id      = txt_sid.Text;
            p.S_name    = txt_name.Text;
            p.S_cell    = txt_cell.Text;
            p.S_address = txt_address.Text;

            SupBLL cus = new SupBLL();

            if (cus.insertSupBLL(p))
            {
                Response.Redirect("supplyers.aspx?success=Record Inserted Successfully");
                txt_sid.Text     = "";
                txt_name.Text    = "";
                txt_cell.Text    = "";
                txt_address.Text = "";
            }
            else
            {
                Response.Redirect("supplyers.aspx?error=Record Inserted Unsuccessfull");
            }
        }
Пример #5
0
        public DataTable searchSupDAL(SupProps p)
        {
            string query = "select * from supplyers where sup_id ='" + p.S_id + "'";

            return(db.search(query));
        }
Пример #6
0
        public bool deleteSupDAL(SupProps p)
        {
            string query = "delete from supplyers where sup_id ='" + p.S_id + "'";

            return(db.query_iud(query));
        }
Пример #7
0
        public bool updateSupDAL(SupProps p)
        {
            string query = "update supplyers set name = '" + p.S_name + "',cell = '" + p.S_cell + "',address = '" + p.S_address + "' where sup_id = '" + p.S_id + "'; ";

            return(db.query_iud(query));
        }
Пример #8
0
        public bool insertSupDAL(SupProps p)
        {
            string query = "INSERT INTO supplyers VALUES('" + p.S_id + "','" + p.S_name + "','" + p.S_cell + "','" + p.S_address + "')";

            return(db.query_iud(query));
        }
Пример #9
0
        public DataTable searchSupBLL(SupProps p)
        {
            SupDAL obj = new SupDAL();

            return(obj.searchSupDAL(p));
        }
Пример #10
0
        public bool updateSupBLL(SupProps p)
        {
            SupDAL obj = new SupDAL();

            return(obj.updateSupDAL(p));
        }
Пример #11
0
        public bool deleteSupBLL(SupProps p)
        {
            SupDAL obj = new SupDAL();

            return(obj.deleteSupDAL(p));
        }
Пример #12
0
        public bool insertSupBLL(SupProps p)
        {
            SupDAL obj = new SupDAL();

            return(obj.insertSupDAL(p));
        }