public int InsertAttentionIndustry(PersonnelRelationship perRe) { PersonnelRelationshipDataContext db = new PersonnelRelationshipDataContext(); try { db.PersonnelRelationship.InsertOnSubmit(perRe); db.SubmitChanges(); return(int.Parse(perRe.UserID.ToString())); } catch { return(0); } }
public int UpdatePersonnelRelationshipfoByUserID(PersonnelRelationship attInd) { PersonnelRelationshipDataContext db = new PersonnelRelationshipDataContext(); try { var result = (from item in db.PersonnelRelationship where item.UserID == attInd.UserID select item).Single(); result.GUserID = attInd.GUserID; result.IndID = attInd.IndID; result.objType = attInd.objType; db.SubmitChanges(); return(int.Parse(result.UserID.ToString())); } catch { return(0); } }