public void InsertForm() { if (Request.QueryString["id"] != null) { int groupid = Convert.ToInt32(Request.QueryString["id"]); using (VaranegarEntities db = new VaranegarEntities()) { EmailRecieverRoles pg = new EmailRecieverRoles(); pg.Title = txtTitle.Text; pg.IsDelete = false; pg.groupdid = groupid; db.EmailRecieverRoles.Add(pg); db.SaveChanges(); } } }
public void InsertForm() { using (VaranegarEntities db = new VaranegarEntities()) { ContactUsFormRecievers p = new ContactUsFormRecievers(); p.RecieverTitle = txtTitle.Text; p.RecieverEmail = txtEmail.Text; p.Priority = Convert.ToInt32(txtPrio.Text); p.IsDelete = false; db.ContactUsFormRecievers.Add(p); db.SaveChanges(); EmailRecieverRoles aa = new EmailRecieverRoles(); aa.Title = "تماس با ما - " + txtTitle.Text; aa.IsDelete = false; db.EmailRecieverRoles.Add(aa); Emails aaa = new Emails(); aaa.EmailTitle = txtEmail.Text; aaa.fk_RecieverRoleID = aa.EmailRecieverRoleID; aaa.IsDelete = false; } }