Example #1
0
        public bool Add(string ev_id, string pro_id, float saleoff, string name, string start_date, string end_date, ref string error)
        {
            string sql = "Insert into Event values('" + ev_id + "',N'" + name + "','" + start_date + "','" + end_date + "')" +
                         "Insert into Event_Detail values('" + ev_id + "','" + pro_id + "'," + saleoff + ")";

            return(db.MyExecuteNonQuery(sql, CommandType.Text, ref error));
        }
Example #2
0
        /*--------------------------------IMPORT--------------------------------------*/

        public bool Add_Import_Bill(string imp_id, string dis_id, string emp_id, string date, float total, ref string err)
        {
            return(db.MyExecuteNonQuery("usp_iImport_Bill", CommandType.StoredProcedure, ref err,
                                        new SqlParameter("@imp_id", imp_id),
                                        new SqlParameter("@dis_id", dis_id),
                                        new SqlParameter("@emp_id", emp_id),
                                        new SqlParameter("@date", DateTime.Parse(date)),
                                        new SqlParameter("@total", total)));
        }
Example #3
0
 public bool Add(string cus_id, string name, string mid_name, string sur_name, string gender, string id, string address, string tel, string dob, string img_path, ref string error)
 {
     //string sql = "INSERT INTO Customer VALUES('" + cus_id + "',N'" + name + "',N'" + mid_name + "',N'" + sur_name + "','" + gender + "','" + id + "',N'" + address + "','" + tel + "','" + dob + "',N'" + img_path + "')";
     return(db.MyExecuteNonQuery("usp_iKhachHang", CommandType.StoredProcedure, ref error,
                                 new SqlParameter("@cus_id", cus_id),
                                 new SqlParameter("@name", name),
                                 new SqlParameter("@mid_name", mid_name),
                                 new SqlParameter("@sur_name", sur_name),
                                 new SqlParameter("@gender", gender),
                                 new SqlParameter("@id", id),
                                 new SqlParameter("@add", address),
                                 new SqlParameter("@tel", tel),
                                 new SqlParameter("@dob", DateTime.Parse(dob)),
                                 new SqlParameter("@img", img_path)
                                 ));
 }
Example #4
0
        public DataSet Get_Imp_Bill(ref string error)
        {
            string sql = null;

            try
            {
                if (d == 0)
                {
                    d = 1;
                    db.MyExecuteNonQuery(sql1, CommandType.Text, ref error);
                    db.MyExecuteNonQuery(sql2, CommandType.Text, ref error);
                }
                sql = " Select *From Store_Imp_Bill";
            }catch { }
            return(db.ExecuteQueryDataSet(sql, CommandType.Text));
        }
Example #5
0
        //public bool SignUp(string emp_id, string cus_id, string user, string pass, ref string error)
        //{
        //    string sql = "INSERT INTO ACCOUNT VALUES(N'" + emp_id +"',N'" + cus_id +"',N'" + user + "',N'" + pass + "')";
        //    return db.MyExecuteNonQuery(sql, CommandType.Text, ref error);
        //}

        public bool ChangePassword(string username, string oldpass, string newpass, ref string err)
        {
            return(db.MyExecuteNonQuery("usp_uMatKhau", CommandType.StoredProcedure, ref err,
                                        new SqlParameter("@username", username),
                                        new SqlParameter("@oldpass", oldpass),
                                        new SqlParameter("@newpass", newpass)
                                        ));
        }
Example #6
0
 public bool Add(string emp_id, string name, string mid_name,
                 string sur_name, string gender, string id, string address, string tel,
                 string dob, string job, string img_path, string stt, ref string error)
 {
     //string sql = "INSERT INTO Employee VALUES('"+emp_id+"',N'"+name+ "',N'"+mid_name+ "',N'"+sur_name+ "','"+gender+ "','"+id + "',N'"+address + "','" +tel + "','" +dob+ "','" +job + "',N'" +img_path + "')";
     return(db.MyExecuteNonQuery("usp_iNhanVien", CommandType.StoredProcedure, ref error,
                                 new SqlParameter("@emp_id", emp_id),
                                 new SqlParameter("@name", name),
                                 new SqlParameter("@mid_name", mid_name),
                                 new SqlParameter("@sur_name", sur_name),
                                 new SqlParameter("@gender", gender),
                                 new SqlParameter("@id", id),
                                 new SqlParameter("@add", address),
                                 new SqlParameter("@tel", tel),
                                 new SqlParameter("@dob", DateTime.Parse(dob)),
                                 new SqlParameter("@jobid", job),
                                 new SqlParameter("@img", img_path),
                                 new SqlParameter("@status", stt)
                                 ));
 }
Example #7
0
 public bool Add_Category(string id, string name, ref string err)
 {
     return(db.MyExecuteNonQuery("usp_iLoaiSanPham", CommandType.StoredProcedure, ref err,
                                 new SqlParameter("@category_id", id),
                                 new SqlParameter("@name", name)));
 }