Ejemplo n.º 1
0
        internal bool ndryshoKokeFature(KokeFature kf)
        {
            bool isSuccess = false;

            using (SqlConnection conn = Connection.GetConnection())
            {
                string query = @"UPDATE [dbo].[koke_fature]
                               SET [Id_tavolina] = @Id_tavolina,
                                [Data] = @Data,
                                [Id_kamarier] = @Id_kamarier,
                                [Status] = @Status,
                                [Nr_fature] = @Nr_fature
                             WHERE Id = @Id";
                using (SqlCommand cmd = new SqlCommand(query, conn))
                {
                    cmd.Parameters.AddWithValue("@Id_tavolina", kf.t.id);
                    cmd.Parameters.AddWithValue("@Data", kf.data);
                    cmd.Parameters.AddWithValue("@Nr_fature", kf.nrFature);
                    cmd.Parameters.AddWithValue("@Status", kf.nrFature);
                    cmd.Parameters.AddWithValue("@Id_kamarier", kf.kamarier.id);
                    conn.Open();
                    isSuccess = cmd.ExecuteNonQuery() > 0 ? true : false;
                    conn.Close();
                }
                return(isSuccess);
            }
        }
Ejemplo n.º 2
0
        internal bool shtoKokeFature(KokeFature kf)
        {
            bool isSuccess = false;

            using (SqlConnection conn = Connection.GetConnection())
            {
                string query = @"INSERT INTO [dbo].[koke_furnizimi]
                                (
                                [Id],
                                [Id_tavolina],
                                [Data],
                                [Id_kamarier],
                                [Status],
                                [Nr_fature],
                            VALUES
                                (
                                 @Id_tavolina,
                                 @Data,
                                 @Id_kamarier,
                                 @Status,
                                 @Nr_fature
                                )";
                using (SqlCommand cmd = new SqlCommand(query, conn))
                {
                    cmd.Parameters.AddWithValue("@Id_tavolina", kf.t.id);
                    cmd.Parameters.AddWithValue("@Data", kf.data);
                    cmd.Parameters.AddWithValue("@Nr_fature", kf.nrFature);
                    cmd.Parameters.AddWithValue("@Status", kf.nrFature);
                    cmd.Parameters.AddWithValue("@Id_kamarier", kf.kamarier.id);
                    conn.Open();
                    isSuccess = cmd.ExecuteNonQuery() > 0 ? true : false;
                    conn.Close();
                }
            }
            return(isSuccess);
        }
Ejemplo n.º 3
0
 public FatureShitje()
 {
     a          = new Artikull();
     kokeFature = new KokeFature();
 }