public ActionResult AcceptClick(PSS_PurchasePlan obj) { string key = Request["key"]; int isOk = default(int); //key表示是否编辑的标识,1表示处于编辑状态 0表示增加状态 if (key == "1") { isOk = ipss_purchaseplanbll.Update(obj); } else { PSS_PurchasePlan temp = ipss_purchaseplanbll.GetEntity(obj.PurchaseNo); if (temp == null) { HttpCookie cookie = Request.Cookies["user"]; obj.OperateNo = cookie.Values["Code"]; obj.OperateDate = DateTime.Now.ToString("G"); isOk = ipss_purchaseplanbll.Insert(obj); } else { isOk = -1; } } return(Content(isOk.ToString())); }
public int Delete(PSS_PurchasePlan obj) { using (Conn) { string query = @"DELETE FROM PSS_PurchasePlan WHERE PurchaseNo = @PurchaseNo"; return(Conn.Execute(query, obj)); } }
public int Insert(PSS_PurchasePlan obj) { using (Conn) { string query = @"INSERT INTO PSS_PurchasePlan VALUES(@PurchaseNo,@PurchaseDate,@Remark,@OperateNo,@OperateDate,@PurchaseStatus)"; return(Conn.Execute(query, obj)); } }
public int Update(PSS_PurchasePlan obj) { using (Conn) { string query = @"UPDATE PSS_PurchasePlan SET PurchaseNo=@PurchaseNo,PurchaseDate=@PurchaseDate, Remark=@Remark,OperateNo=@OperateNo,OperateDate=@OperateDate,PurchaseStatus=@PurchaseStatus WHERE PurchaseNo =@PurchaseNo"; return(Conn.Execute(query, obj)); } }
public ActionResult PurchasePlanDetail(string PurchaseNo) { PSS_PurchasePlan plan = ipss_purchaseplanbll.GetEntity(PurchaseNo); return(View(plan)); }
public int Delete(PSS_PurchasePlan obj) { return(dal.Delete(obj)); }
public int Insert(PSS_PurchasePlan obj) { return(dal.Insert(obj)); }
public int Update(PSS_PurchasePlan obj) { return(dal.Update(obj)); }