Exemplo n.º 1
0
        public bool InsertDebt(int billid,string debtname, string arrears, int provid)
        {
            try
            {
                da = new DataAccess();
                cmd = new SqlCommand("SP_Insert_Debt", da.SqlConn());
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@BillID",SqlDbType.Int);
                cmd.Parameters["@BillID"].Value = billid;
                cmd.Parameters.Add("@DebName", SqlDbType.NVarChar);
                cmd.Parameters["@DebName"].Value = debtname;
                cmd.Parameters.Add("@Arrears",SqlDbType.VarChar);
                cmd.Parameters["@Arrears"].Value = arrears;

                cmd.Parameters.Add("@ProvID",SqlDbType.Int);
                cmd.Parameters["@ProvID"].Value = provid;
                cmd.Connection.Open();
                cmd.ExecuteNonQuery();
                return true;
            }
            catch (Exception ex)
            {
                string err = ex.Message;
                return false;
            }
        }
Exemplo n.º 2
0
        public bool InsertPaymentOrder(string ReasonPayment,decimal Quantity,string Employee, int provid)
        {
            try
            {
                da = new DataAccess();
                cmd = new SqlCommand("SP_Insert_PaymentOrder", da.SqlConn());
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@ReasonPayment",SqlDbType.NVarChar);
                cmd.Parameters["@ReasonPayment"].Value = ReasonPayment;

                cmd.Parameters.Add("@Quantity",SqlDbType.Money);
                cmd.Parameters["@Qiantity"].Value = Quantity;

                cmd.Parameters.Add("@Employee",SqlDbType.NVarChar);
                cmd.Parameters["@Employee"].Value = Employee;
                cmd.Parameters.Add("@ProvID", SqlDbType.Int);
                cmd.Parameters["@ProvID"].Value = provid;
                cmd.Connection.Open();
                cmd.ExecuteNonQuery();
                return true;
            }
            catch (Exception ex)
            {
                string err = ex.Message;
                return false;
            }
        }
Exemplo n.º 3
0
 public DataTable SelectAllBill()
 {
     try
     {
         da = new DataAccess();
         cmd = new SqlCommand("SP_SelectAll_Bill", da.SqlConn());
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Connection.Open();
         cmd.ExecuteNonQuery();
         sda = new SqlDataAdapter(cmd);
         ds = new DataSet();
         sda.Fill(ds, "Bill");
         return ds.Tables["Bill"];
     }
     catch (Exception ex)
     {
         ex.ToString();
         return null;
     }
 }
Exemplo n.º 4
0
 public DataTable SelectOneOrderDetails(int OrderID)
 {
     try
     {
         da = new DataAccess();
         cmd = new SqlCommand("SP_SelectOne_OrderDetails", da.SqlConn());
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.AddWithValue("OrderID",OrderID);
         cmd.Connection.Open();
         cmd.ExecuteNonQuery();
         sda = new SqlDataAdapter(cmd);
         ds = new DataSet();
         sda.Fill(ds, "Order");
         return ds.Tables["Order"];
     }
     catch (Exception ex)
     {
         ex.ToString();
         return null;
     }
 }
Exemplo n.º 5
0
 public DataTable GetTotalByProvID(int ProvID)
 {
     try
     {
         da = new DataAccess();
         cmd = new SqlCommand("SP_GetTotal_ByProvID", da.SqlConn());
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.AddWithValue("@ProvID",ProvID);
         cmd.Connection.Open();
         cmd.ExecuteNonQuery();
         sda = new SqlDataAdapter(cmd);
         ds = new DataSet();
         sda.Fill(ds, "GetTotal");
         return ds.Tables["GetTotal"];
     }
     catch (Exception ex)
     {
         ex.ToString();
         return null;
     }
 }
Exemplo n.º 6
0
 public DataTable SearchBill(DateTime BuyDate, int BillID)
 {
     try
     {
         da = new DataAccess();
         cmd = new SqlCommand("Search_Bill", da.SqlConn());
         cmd.Parameters.AddWithValue("@BuyDate",BuyDate);
         cmd.Parameters.AddWithValue("@BillID",BillID);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Connection.Open();
         cmd.ExecuteNonQuery();
         sda = new SqlDataAdapter(cmd);
         ds = new DataSet();
         sda.Fill(ds, "SearchBill");
         return ds.Tables["SearchBill"];
     }
     catch (Exception ex)
     {
         ex.ToString();
         return null;
     }
 }
Exemplo n.º 7
0
 public BE_OrderDetails TotalOrderDetails(int OrderID)
 {
     try
     {
         da = new DataAccess();
         cmd = new SqlCommand("SP_Total_OrderDetails", da.SqlConn());
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.AddWithValue("OrderID", OrderID);
         cmd.Connection.Open();
         cmd.ExecuteNonQuery();
         sda = new SqlDataAdapter(cmd);
         ds = new DataSet();
         sda.Fill(ds, "TotalOrderDetails");
         DataTable dTable = new DataTable();
         dTable = ds.Tables["TotalOrderDetails"];
         BE_OrderDetails BEOrderdetails = new BE_OrderDetails(dTable.Rows[0]);
         return BEOrderdetails;
     }
     catch (Exception ex)
     {
         ex.ToString();
         return null;
     }
 }
Exemplo n.º 8
0
        public bool UpdateStatusOrder(int OrderID,bool Status)
        {
            try
            {
                da = new DataAccess();
                cmd = new SqlCommand("SP_Update_Order",da.SqlConn());
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@OrderID",SqlDbType.Int);
                cmd.Parameters["@OrderID"].Value = OrderID;
                cmd.Parameters.Add("@Status", SqlDbType.Int);
                cmd.Parameters["@Status"].Value = Status;
                cmd.Connection.Open();
                cmd.ExecuteNonQuery();
                return true;

                //sqlcom = new SqlCommand("Update_CatPro", this.objConn.SqlConn());
                //sqlcom.CommandType = CommandType.StoredProcedure;
                ////comm.Parameters.Add("@Cat_Id",SqlDbType.NVarChar);
                //sqlcom.Parameters.AddWithValue("@Cat_Id", catid);
                ////comm.Parameters.Add("@CatName", SqlDbType.NVarChar);
                //sqlcom.Parameters.AddWithValue("@CatName", catname);
                //sqlcom.Parameters.AddWithValue("@CatDes", catdes);
                //sqlcom.Parameters.AddWithValue("@Active", check);
                //sqlcom.Parameters.AddWithValue("@Language_Id", language);
                //sqlcom.Parameters.AddWithValue("@StartDate", date);
                //sqlcom.Connection.Open();
                //sqlcom.ExecuteNonQuery();
                //test = true;

            }
            catch (Exception ex)
            {
                string err = ex.Message;
                return false;
            }
        }
Exemplo n.º 9
0
        public bool UpdateQuantityProduct(int ProductID, int Quantity)
        {
            try
            {
                da = new DataAccess();
                cmd = new SqlCommand("SP_Update_QuantityProduct", da.SqlConn());
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@Product_ID",SqlDbType.Int);
                cmd.Parameters["@Product_ID"].Value = ProductID;
                cmd.Parameters.Add("@Quantity",SqlDbType.Int);
                cmd.Parameters["@Quantity"].Value = Quantity;

                cmd.Connection.Open();
                cmd.ExecuteNonQuery();
                return true;
            }
            catch (Exception ex)
            {
                string err = ex.Message;
                return false;
            }
        }
Exemplo n.º 10
0
 public DataTable SelectSubCatName(int Cat_ID)
 {
     try
     {
         da = new DataAccess();
         cmd = new SqlCommand("SP_SelectSubName_ToBill", da.SqlConn());
         cmd.Parameters.AddWithValue("Cat_ID",Cat_ID);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Connection.Open();
         cmd.ExecuteNonQuery();
         sda = new SqlDataAdapter(cmd);
         ds = new DataSet();
         sda.Fill(ds, "SubCatName");
         return ds.Tables["SubCatName"];
     }
     catch (Exception ex)
     {
         ex.ToString();
         return null;
     }
 }
Exemplo n.º 11
0
 public DataTable SelectQuantityProduct(int ProductID)
 {
     try
     {
         da = new DataAccess();
         cmd = new SqlCommand("SP_Select_QuantityProduct", da.SqlConn());
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.AddWithValue("Product_ID", ProductID);
         cmd.Connection.Open();
         cmd.ExecuteNonQuery();
         sda = new SqlDataAdapter(cmd);
         ds = new DataSet();
         sda.Fill(ds, "QuantityProduct");
         return ds.Tables["QuantityProduct"];
     }
     catch (Exception ex)
     {
         ex.ToString();
         return null;
     }
 }
Exemplo n.º 12
0
 public En_Bill SelectOneBill(int BillID)
 {
     try
     {
         da = new DataAccess();
         cmd = new SqlCommand("SP_SelectOne_Bill", da.SqlConn());
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.AddWithValue("BillID", BillID);
         cmd.Connection.Open();
         cmd.ExecuteNonQuery();
         sda = new SqlDataAdapter(cmd);
         ds = new DataSet();
         sda.Fill(ds, "Bill");
         DataTable dTable = new DataTable();
         dTable = ds.Tables["Bill"];
         En_Bill BEBill = new En_Bill(dTable.Rows[0]);
         return BEBill;
     }
     catch (Exception ex)
     {
         ex.ToString();
         return null;
     }
 }