43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using dccdc.Models;
|
|
using Dapper;
|
|
|
|
namespace dccdc.DAL
|
|
{
|
|
public class ProfessionalChargeProjectDal
|
|
{
|
|
public bool Update(ProfessionalChargeProjectModel model)
|
|
{
|
|
using (IDbConnection conn = CommHelper.GetSqlConnection())
|
|
{
|
|
string sql = @"UPDATE [dbo].[professional_charge_project]
|
|
SET [physical_num] = @physical_num
|
|
,[charge_project_name] = @charge_project_name
|
|
,[charge_project_price] = @charge_project_price
|
|
WHERE id=@id";
|
|
return (conn.Execute(sql, model) != 0 ? true : false);
|
|
}
|
|
}
|
|
public bool Add(ProfessionalChargeProjectModel model)
|
|
{
|
|
using (IDbConnection conn = CommHelper.GetSqlConnection())
|
|
{
|
|
string sql = @"INSERT INTO [dbo].[professional_charge_project]
|
|
([physical_num]
|
|
,[charge_project_name]
|
|
,[charge_project_price])
|
|
VALUES
|
|
(@physical_num
|
|
,@charge_project_name
|
|
,@charge_project_price)";
|
|
return (conn.Execute(sql, model) != 0 ? true : false);
|
|
}
|
|
}
|
|
}
|
|
}
|