public string GroupTableSelectForGroupId(string gName, string user) { utemp = context.UserTables.SingleOrDefault(x => x.user_id == user); int a = utemp.no_of_group; usergroupid = 0; for (int i = 0; i < a; i++) { ugtemp = context2.UserAndGroupTables.First(x => x.user_id == user && x.user_group_id > usergroupid); usergroupid = ugtemp.user_group_id; string groupId = ugtemp.group_id; gtemp = context.GroupTables.SingleOrDefault(x => x.group_id == groupId); string groupName = gtemp.group_name; if (groupName.Equals(gName)) { break; } else { continue; } } return(gtemp.group_id); }
public string documentTableSelectByDocNameForGroupDoc(string docName, string gId) { gtemp = context.GroupTables.SingleOrDefault(x => x.group_id == gId); int noofdoc = gtemp.total_document; docgroupid = 0; for (int i = 0; i < noofdoc; i++) { dgtemp = context2.DocumentAndGroupTables.First(x => x.group_id == gId && x.doc_group_id > docgroupid); docgroupid = dgtemp.doc_group_id; string docId = dgtemp.doc_id; dtemp = context.DocumentTables.SingleOrDefault(x => x.doc_id == docId); string name = dtemp.doc_name; if (name.Equals(docName)) { break; } else { continue; } } return(dtemp.doc_id); }
public string UserAndGroupTableSelectAndReturnGroupNames(string tempuser) { ugtemp = context2.UserAndGroupTables.FirstOrDefault(x => x.user_id == tempuser && x.user_group_id > usergroupid); usergroupid = ugtemp.user_group_id; gtemp = context.GroupTables.SingleOrDefault(x => x.group_id == ugtemp.group_id); return(gtemp.group_name); }
//Deleting from DocumentAndGroupTable public void deleteFromDocumentAndGroupTableAndNoOfDocDecreaseInGroupTable(string docId, string gId) { dgtemp = context2.DocumentAndGroupTables.SingleOrDefault(x => x.doc_id == docId && x.group_id == gId); context2.DocumentAndGroupTables.DeleteOnSubmit(dgtemp); context2.SubmitChanges(); gtemp = context.GroupTables.Single(x => x.group_id == gId); gtemp.total_document--; context.SubmitChanges(); }
public void deleteFromDocumentAndGroupTableByDocId(string docId) { dgtemp = context2.DocumentAndGroupTables.First(x => x.doc_id == docId); string gId = dgtemp.group_id; context2.DocumentAndGroupTables.DeleteOnSubmit(dgtemp); context2.SubmitChanges(); gtemp = context.GroupTables.Single(x => x.group_id == gId); gtemp.total_document = gtemp.total_document - 1; context.SubmitChanges(); }
//Insert into GroupTable public void groupTableInsert(string groupId, string groupName, string adminId) { GroupTable ob = new GroupTable(); ob.group_id = groupId; ob.group_name = groupName; ob.admin_id = adminId; ob.total_member = 1; ob.total_document = 0; //LinqToSql2DataContext context = new LinqToSql2DataContext(); context.GroupTables.InsertOnSubmit(ob); context.SubmitChanges(); }
//////Selecting first row of a table public string firstRowGroupTable() { gtemp = context.GroupTables.First(); return(gtemp.group_id); }
public void updateTotalMemberDecrease(string gId) { gtemp = context.GroupTables.SingleOrDefault(x => x.group_id == gId); gtemp.total_member--; context.SubmitChanges(); }
public void updateAdminId(string adminId, string gId) { gtemp = context.GroupTables.SingleOrDefault(x => x.group_id == gId); gtemp.admin_id = adminId; context.SubmitChanges(); }
/*public int getTotalMember(string gId) * { * gtemp = context.GroupTables.SingleOrDefault(x => x.group_id == gId); * return gtemp.total_member; * }*/ public void updateTotalDocument(string gId) { gtemp = context.GroupTables.SingleOrDefault(x => x.group_id == gId); gtemp.total_document++; context.SubmitChanges(); }
public int getTotalDocument(string gId) { gtemp = context.GroupTables.SingleOrDefault(x => x.group_id == gId); return(gtemp.total_document); }
partial void UpdateGroupTable(GroupTable instance);
public string getGroupName(string gId) { gtemp = context.GroupTables.SingleOrDefault(x => x.group_id == gId); return(gtemp.group_name); }
public string GroupTableSelectByGroupIdAndReturnAdminId(string gId) { gtemp = context.GroupTables.FirstOrDefault(x => x.group_id == gId); return(gtemp.admin_id); }
public void GroupTableSelect(string gId) { //LinqToSql2DataContext context = new LinqToSql2DataContext(); gtemp = context.GroupTables.SingleOrDefault(x => x.group_id == gId); }
//////Selecting last row of a table public string lastRowGroupTable() { gtemp = context.GroupTables.AsEnumerable().Last(); return(gtemp.group_id); }
partial void InsertGroupTable(GroupTable instance);
public string getAdminId(string gId) { gtemp = context.GroupTables.SingleOrDefault(x => x.group_id == gId); return(gtemp.admin_id); }
partial void DeleteGroupTable(GroupTable instance);
public int getTotalMember(string gId) { gtemp = context.GroupTables.SingleOrDefault(x => x.group_id == gId); return(gtemp.total_member); }