public void EditApprove(Approve ap) { string sql = string.Format(" update Approve set Title='{0}',BeginDate='{1}',EndDate='{2}',Reason='{3}' where ApproveID='{4}'" , ap.Title, ap.BeginDate, ap.EndDate, ap.Reason, ap.ApproveID); DBhelper.Change(sql); }
public void AddApprove(Approve ap) { //(select ManagerID from Department where DeptID= (select DeptID from UserInfo where UserName='******')) string sql = string.Format("insert into Approve values ((select userid from UserInfo where UserName='******'),'{1}','{2}','{3}','{4}',null,getdate(),null,'0',null,null)" , ap.ApplyUser, ap.Title, ap.BeginDate, ap.EndDate, ap.Reason); DBhelper.Change(sql); }