public void RemoveMeFromFamily(int memberID, string Address, string Address2, string City, string State, string Zip) { member member = db.members.Find(memberID); int originalFamilyID = (int)member.familyID; IEnumerable <member> familyMembers = MemberRepository.GetMemberByFamily(originalFamilyID); if (familyMembers.Count() > 1) { string originalFamilyName = FamilyRepository.GetFamilyByID(originalFamilyID).FamilyName; family family = new family(); family.FamilyName = originalFamilyName; family.Address = Address; //family.Address2 = Address2; family.City = City; family.State = State; family.Zip = Zip; family.EnteredBy = User.Identity.Name.ToString(); family.DateEntered = System.DateTime.Today; family.Status = "Active"; FamilyRepository.AddRecord(family); //set member family to new familyid member.familyID = family.familyID; db.SaveChanges(); } }
// // GET: /Family/Delete/5 public ActionResult Delete(int FamilyID) { ViewBag.FamilyID = FamilyID; family family = FamilyRepository.GetFamilyByID(FamilyID); return(PartialView(family)); }
/// <summary> /// 家庭主页 /// 1.家庭信息 /// 2.家庭成员信息 /// 3.留言列表 /// /// </summary> /// <returns></returns> public ActionResult FamilyPage() { user_table user = checkUser(); family fa = db.family.SingleOrDefault <family>(f => f.id == user.fid); ViewData["family"] = fa;//家庭信息 List <user_table> users = (from u in db.user_table where u.fid == fa.id && u.status == 0 select u).ToList <user_table>(); ViewData["users"] = users;//家庭成员信息 List <comment> comments = (from c in db.comment where c.fid == fa.id orderby c.id descending select c).ToList <comment>(); List <CommentModel> modes = new List <CommentModel>(); foreach (comment cs in comments) { CommentModel model = new CommentModel(); model.C = cs; user_table ut = db.user_table.SingleOrDefault <user_table>(u => u.id == cs.uid); model.U = ut; modes.Add(model); } ViewData["modes"] = modes;//留言信息 return(View()); }
// // GET: /Family/Edit/5 public ActionResult Edit(int FamilyID) { family family = FamilyRepository.GetFamilyByID(FamilyID); GetData(); return(PartialView(family)); }
public Person() { FName = ""; SName = ""; MName = ""; Family = family.Unknown; }
private void btnSearch_Click(object sender, EventArgs e) { if (!filledValues()) { //MessageBox.Show("Complete la información"); } else { Cursor.Current = Cursors.WaitCursor; // dgvFamilies.Rows.Clear(); serviceDAA = new DBControllerWSClient(); familia = (serviceDAA.queryFamilyByCode(txtFamily.Text)); if (familia.idFamily != null) { // dgvFamilies.Rows.Add(new String[] { // familia.idFamily, familia.name, ""+familia.description // }); UpdateFamilyForm updateFamily = new UpdateFamilyForm(); updateFamily.currentFamily = new family(); //family e1 = new family(); //e1 = serviceDAA.queryFamilyByCode(dgvFamilies.Rows[i].Cells[0].Value.ToString()); updateFamily.currentFamily = familia; updateFamily.SetParent(this); updateFamily.ShowDialog(); updateDataGridView(); } else { MessageBox.Show("Familia de Producto no Encontrada"); } Cursor.Current = Cursors.Arrow; } }
/// <summary> /// 家庭信息修改 /// </summary> /// <returns></returns> public ActionResult FamilyIfoUpdate() { user_table user = checkUser(); family f = db.family.SingleOrDefault <family>(fa => fa.id == user.fid); ViewData["family"] = f; return(View()); }
public async Task <ActionResult> DeleteConfirmed(int?id) { family family = await db.families.FindAsync(id); db.families.Remove(family); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public ActionResult FamilyMemberList(int familyID) { IEnumerable <member> FamilyMembers = MemberRepository.GetMemberByFamily(familyID); family family = FamilyRepository.GetFamilyByID(familyID); ViewBag.Heading = string.Format("{0} Family Member", family.FamilyName); ViewBag.RecordCount = FamilyMembers.Count(); return(PartialView(FamilyMembers)); }
//מוסיפה משפחה public static bool newFamily(family family) { if (volunteeringET.family.FirstOrDefault(f => f.mail == family.mail) == null) { volunteeringET.family.Add(family); volunteeringET.SaveChanges(); return(true); } return(false); }
private int AddNewRowToTable(string name) { int id = -1; switch ((Types)tabControl1.SelectedIndex) { case Types.Family: family obj = new family { name = name, majorid = Selections[Types.Major].Id }; entities.family.Add(obj); id = obj.id; break; case Types.Genus: genus obj2 = new genus { name = name, familyid = Selections[Types.Family].Id }; entities.genus.Add(obj2); id = obj2.id; break; case Types.Species: species obj3 = new species { name = name, genusid = Selections[Types.Genus].Id }; entities.species.Add(obj3); id = obj3.id; break; case Types.Synonym: synonym obj4 = new synonym { name = name, speciesid = Selections[Types.Species].Id }; entities.synonym.Add(obj4); id = obj4.id; break; default: major obj5 = new major { name = name }; entities.major.Add(obj5); id = obj5.id; break; } entities.SaveChanges(); GridView.CurrentRow.Cells[0].Value = id; Selections[(Types)tabControl1.SelectedIndex].Id = id; return(id); }
/// <summary> /// 根据家庭id,申请加入家庭及其页面 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult FamilyIdPage(int id) { user_table u = checkUser(); if (u.status != 1) { Redirect("/user/FamilyRequestStatus");//不是1的话,处于申请状态下,不需要提出申请操作 } family fa = db.family.SingleOrDefault <family>(f => f.id == id); ViewData["family"] = fa;//家庭信息 return(View()); }
public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } family family = await db.families.FindAsync(id); if (family == null) { return(HttpNotFound()); } return(View(family)); }
public familyDTO GetFamily(family f) { familyDTO newfamily = new familyDTO(); newfamily.childrenOnSite = f.childrenOnSite; newfamily.city = f.city; newfamily.familyID = f.familyID; newfamily.formContact = f.formContact; newfamily.houseNumber = f.houseNumber; newfamily.lastName = f.lastName; newfamily.mail = f.mail; newfamily.password = f.password; newfamily.phone = f.phone; newfamily.street = f.street; newfamily.userName = f.userName; return(newfamily); }
public ActionResult DeleteConfirmed(int FamilyID) { family family = FamilyRepository.GetFamilyByID(FamilyID); int count = MemberRepository.GetMemberByFamily(FamilyID).Count(); if (count == 0) { FamilyRepository.DeleteRecord(family); TempData["Message2"] = string.Format("{0} successfully deleted.", family.FamilyName); } else { TempData["Message2"] = string.Format("Can not delete {0} record. Has member(s) attached.", family.FamilyName); } return(RedirectToAction("List")); }
private void btnDeleteFamily_Click(object sender, EventArgs e) { int i = dgvFamilies.CurrentCell.RowIndex; if (i >= 0) { family familia_aux = new family(); familia_aux = families[i]; familia_aux.state = 0; serviceDA.updateFamily(familia_aux); updateDataGridView(); MessageBox.Show("Se ha eliminado la familia seleccionada"); } else { MessageBox.Show("Seleccione una familia"); } }
private void cmbFamily_Leave(object sender, EventArgs e) { string old = lblFamily.Text.Replace("Familya: ", ""); string text = cmbFamily.Text.Trim(); if (text == string.Empty || text.Contains("DynamicProxies") || old == text) { return; } int id = -1; family f = entities.family.Where(x => x.name == text || x.name == text.Replace("I", "İ")).FirstOrDefault(); if (f == null) { DialogResult dr = MessageBox.Show(cmbFamily.Text + " isminde bir familya bulunamadı yanlış yazdıysanız hayıra basın ve düzeltin. Yanlışlık yoksa kayıt oluşturulsun mu?", "Family Bulunamadı", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2); if (dr == DialogResult.No) { cmbGenus.Enabled = false; cmbSpecies.Enabled = false; return; } family newFamily = new family(); newFamily.major = entities.major.ToList()[0]; newFamily.name = text; entities.family.Add(newFamily); entities.SaveChanges(); id = newFamily.id; Log.Debug("[Yeni Familya]: " + text, "ID:" + id + "\nMajor:" + newFamily.major.name + "\n->Familya:" + newFamily.name); } else { id = f.id; } cmbGenus.DataSource = entities.genus.Where(x => x.familyid == id).OrderBy(x => x.name).ToList(); cmbGenus.DisplayMember = "name"; cmbGenus.ValueMember = "id"; cmbGenus.Invalidate(); cmbGenus.Enabled = true; cmbGenus.Text = ""; cmbSpecies.Text = ""; lblFamily.Text = "Familya: " + cmbFamily.Text; lblFamily.Visible = true; lblSpeciesName.Text = string.Empty; }
//ביטול קבוע של התנדבות public static bool CancellationIndividualdVolunteering(int volunteerOfChildID) { volunteerOfChild voc = volunteeringET.volunteerOfChild.Find(volunteerOfChildID); if (voc != null) { child c = volunteeringET.child.Find(voc.childId); family f = volunteeringET.family.Find(c.familyId); volunteer v = volunteeringET.volunteer.Find(voc.volunteerId); string subject = "ביטול התנדבות חד פעמי"; string mail = f.mail; string body = "שלום וברכה!, מתנצלים אך נראה שהמתנדבת " + v.firstName + " " + v.lastName + " אינה יכולה להתנדב ביום " + voc.day + " בשעה: " + voc.hour + "בצורה חד פעמית ,סליחה ותודה מראש על ההבנה"; GlobalBL.SendEmail(mail, subject, body); return(true); } return(false); }
/// <summary> /// 创建家庭请求 /// </summary> /// <param name="name"></param> /// <param name="description"></param> /// <param name="signature"></param> /// <returns></returns> public ActionResult FamilyCreateRequest(String name, String description, String signature) { if (Session["user"] == null) { Response.Redirect("/user/login"); } //1.添加家庭信息 family f = new family(); f.description = description; f.name = name; f.signature = signature; db.family.AddObject(f); int result = db.SaveChanges(); if (result > 0) { //成功 //2.修改用户状态 user_table user = (user_table)Session["user"]; user = db.user_table.SingleOrDefault <user_table>(u => u.id == user.id); user.fid = f.id; user.status = 0; //创建家庭不用申请,直接修改为0 int row = db.SaveChanges(); if (row > 0) { Session["user"] = user; Response.Redirect("/user/FamilyRequestStatus"); } else { Response.Redirect("/user/error"); } } else { Response.Redirect("/user/error"); } return(View()); }
//מקבלת ילד לפי תעודת זהות ומשנה לו את הסטטוס לפעיל public static bool UpdateTheStatus(int id) { child c = volunteeringET.child.Find(id); if (c != null) { c.status = EStatusChild.ACTIVE.ToString(); string password = GlobalBL.ToRaffleAndPostUserNameAndPassword(); family f = volunteeringET.family.Find(c.familyId); f.password = password; f.userName = f.lastName + f.phone; volunteeringET.SaveChanges(); string body = "ברכות, כעת נרשמת בהצלחה לידיד לילד ותוכל להשתמש במגוון שירותי האתר , הסיסמא ושם המשתמש שאיתם תוכל להיכנס לאתר הם: " + "your password is: " + f.password + f.userName; string subject = "בקשה להרשמה לאתר ידיד לילד"; GlobalBL.SendEmail(f.mail, subject, body); return(true); } return(false); }
public ActionResult Edit(family family) { try { if (ModelState.IsValid) { db.Entry(family).State = EntityState.Modified; db.SaveChanges(); TempData["Message2"] = string.Format("{0} record update successfully.", family.FamilyName); GetData(); return(RedirectToAction("List")); } } catch (Exception ex) { TempData["Message2"] = string.Format("Error editing {0} record.", family.FamilyName); } GetData(); return(View(family)); }
private void btnUpdateFamily_Click(object sender, EventArgs e) { int i = dgvFamilies.CurrentCell.RowIndex; if (i >= 0) { UpdateFamilyForm updateFamily = new UpdateFamilyForm(); updateFamily.currentFamily = new family(); family e1 = new family(); serviceDAA = new DBControllerWSClient(); e1 = serviceDAA.queryFamilyByCode(dgvFamilies.Rows[i].Cells[0].Value.ToString()); updateFamily.currentFamily = e1; updateFamily.ShowDialog(); updateDataGridView(); } else { MessageBox.Show("Seleccione una familia"); } }
//ביטול קבוע של התנדבות public static bool CancelledVolunteering(int volunteerOfChildID) { volunteerOfChild voc = volunteeringET.volunteerOfChild.Find(volunteerOfChildID); if (voc != null) { child c = volunteeringET.child.Find(voc.childId); family f = volunteeringET.family.Find(c.familyId); volunteer v = volunteeringET.volunteer.Find(voc.volunteerId); string subject = "ביטול התנדבות קבועה"; string mail = f.mail; string body = "שלום וברכה!, מתנצלים אך נראה שהמתנדבת " + v.firstName + " " + v.lastName + " אינה יכולה עוד להתחייב בהתנדבות שנערכת ביום " + voc.day + " בשעה: " + voc.hour + "בקרוב נעדכן אותכם על מתנדבת נוספת המתאימה לתפקיד ,תודה וסליחה."; GlobalBL.SendEmail(mail, subject, body); v.status = EStatus.cancelled.ToString(); volunteeringET.SaveChanges(); return(true); } return(false); }
public static childDTO GetChild(child c) { childDTO newChild = new childDTO(); family f = volunteeringET.family.Find(c.familyId); newChild.age = c.age; newChild.childID = c.childID; newChild.dateEntryToSite = c.dateEntryToSite; newChild.familyId = c.familyId; newChild.firstName = c.firstName; newChild.sax = c.sax; newChild.tz = c.tz; newChild.childrenOnSite = f.childrenOnSite; newChild.city = f.city; newChild.mail = f.mail; newChild.phone = f.phone; newChild.street = f.street; newChild.houseNumber = f.houseNumber; newChild.formContact = f.formContact; return(newChild); }
public ActionResult Create(family family) { try { if (ModelState.IsValid) { db.families.Add(family); db.SaveChanges(); TempData["Message2"] = "family record added successfully."; GetData(); FamilyRepository.AddRecord(family); //return Content("Fami!ly record created successfully"); return(RedirectToAction("Create")); } } catch (Exception ex) { TempData["Message2"] = "Error adding family"; } GetData(); return(View(family)); }
/// <summary> /// 修改家庭信息请求 /// </summary> /// <returns></returns> public ActionResult FamilyIfoUpdateRequest(String name, String signature, String description) { user_table user = checkUser(); family f = db.family.SingleOrDefault <family>(fa => fa.id == user.fid); if (name.Length > 0) { f.name = name; } if (signature.Length > 0) { f.signature = signature; } if (description.Length > 0) { f.description = description; } db.SaveChanges(); return(Redirect("/user/FamilyPage")); }
Initialize(family, emSize, style, unit, gdiCharSet, gdiVerticalFont);
private void cmbGenus_Leave(object sender, EventArgs e) { string text = cmbGenus.Text.Trim(); if (text == string.Empty || text.Contains("DynamicProxies")) { _plant.speciesid = null; return; } int id = -1; genus g = entities.genus.Where(x => x.name == text).FirstOrDefault(); family f = entities.family.Where(x => x.name == cmbFamily.Text).FirstOrDefault(); if (g == null) { DialogResult dr = MessageBox.Show(cmbGenus.Text + " isminde bir cins bulunamadı yanlış yazdıysanız hayıra basın ve düzeltin. Yanlışlık yoksa kayıt oluşturulsun mu?", "Cins Bulunamadı", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2); if (dr == DialogResult.No) { cmbSpecies.Enabled = false; return; } genus newGenus = new genus(); newGenus.family = f; newGenus.name = text; entities.genus.Add(newGenus); entities.SaveChanges(); id = newGenus.id; Log.Debug("[Yeni Cins]: " + text, "ID:" + id + "\nMajor:" + f.major.name + "\nFamilya:" + f.name + "\n->Cins:" + text); } else { id = g.id; } var list = entities.synonym.Where(x => x.species.genusid == id).ToList(); var list2 = entities.species.Where(x => x.genusid == id).Select(x => x.name).ToList(); List <string> turler = new List <string>(); int turId = -1; foreach (synonym sinonim in list) { if (sinonim.speciesid != turId) { turId = Convert.ToInt32(sinonim.speciesid); turler.Add(sinonim.species.name); } turler.Add(sinonim.name + " (sinonim)"); } foreach (string tur in list2) { if (turler.IndexOf(tur) == -1) { turler.Add(tur); } } cmbSpecies.DataSource = turler; cmbSpecies.Invalidate(); cmbSpecies.Enabled = true; cmbSpecies.Text = ""; lblGenus.Visible = true; lblGenus.Text = "Cins: " + cmbGenus.Text; lblSpeciesName.Text = string.Empty; }
public static System.Drawing.Font Get_Font(family f, int size) { switch (f) { case family.arial: switch (size) { case 4: return(arial4); case 6: return(arial6); case 8: return(arial8); case 10: return(arial10); case 12: return(arial12); case 14: return(arial14); case 16: return(arial16); case 18: return(arial18); case 20: return(arial20); case 24: return(arial24); case 28: return(arial28); case 30: return(arial30); case 36: return(arial36); default: throw new System.Exception("no size:" + size + " in family: " + f); } case family.times: switch (size) { case 4: return(times4); case 6: return(times6); case 8: return(times8); case 10: return(times10); case 12: return(times12); case 14: return(times14); case 16: return(times16); case 18: return(times18); case 20: return(times20); case 24: return(times24); case 28: return(times28); case 30: return(times30); case 36: return(times36); default: throw new System.Exception("no size:" + size + " in family: " + f); } case family.courier: switch (size) { case 4: return(courier4); case 6: return(courier6); case 8: return(courier8); case 10: return(courier10); case 12: return(courier12); case 14: return(courier14); case 16: return(courier16); case 18: return(courier18); case 20: return(courier20); case 24: return(courier24); case 28: return(courier28); case 30: return(courier30); case 36: return(courier36); default: throw new System.Exception("no size:" + size + " in family: " + f); } default: throw new System.Exception("no such family"); } }
public bool newFamily([FromBody] family family) { return(FamilyBL.newFamily(family)); }