public static bool InsertFile(PDNLink pdn) { try { return(PDNLinkDAO.InsertFile(pdn)); } catch (Exception) { throw; } }
public static bool UpdateFile(PDNLink pdn) { try { return(PDNLinkDAO.UpdateFile(pdn)); } catch (Exception) { throw; } }
public static bool InsertFile(PDNLink pdn) { try { db.PDNLinks.InsertOnSubmit(pdn); db.SubmitChanges(); return(true); } catch (Exception) { throw; } }
protected void gvDetails_RowDeleting(object sender, GridViewDeleteEventArgs e) { string macongty = Session["congty"].ToString(); string idphieu = Session["maphieu"].ToString(); Label lblID = (Label)gvDetails.Rows[e.RowIndex].FindControl("lblIDAttactFile"); PDNLink Link = new PDNLink(); Link.ID = int.Parse(lblID.Text); Link.Gsbh = macongty; Link.pdno = idphieu; Link.Cancel = true; PDNLinkBUS.UpdateFile(Link); gvDetails.DataSource = db.ExecuteQuery <PDNLink>("select * from PDNLink where pdno='" + idphieu + "' and Gsbh='" + macongty + "' and Cancel='0'"); gvDetails.DataBind(); }
public static bool UpdateFile(PDNLink pdn) { try { PDNLink link = db.PDNLinks.Where(p => p.ID == pdn.ID && p.Gsbh == pdn.Gsbh && p.pdno == pdn.pdno).FirstOrDefault(); if (link != null) { link.ID = pdn.ID; link.pdno = pdn.pdno; link.Gsbh = pdn.Gsbh; link.Cancel = pdn.Cancel; db.SubmitChanges(); } return(true); } catch (Exception) { throw; } }