public ActionResult Addrq()
        {
            ValidateRequest = false;
              string a = Request.QueryString["a"];

               if (Session["giohang"]== null)
               {
               Response.Write("Ban chua lua chon san pham !");
               }
               else
               {
               List<Request_Stationery> ls = new List<Request_Stationery>();
               foreach( GiohangModel gm in (List<GiohangModel>)Session["giohang"] )
               {
                   Request_Stationery s = new Request_Stationery();
                   s.ProductId = gm.Productid;
                   s.Quantity = gm.Soluong;
                   ls.Add(s);
               }
               string chuoi = "";
               Employee el = (Employee)Session["Employee"];//form
               Request_StationeryModel rsm = new Request_StationeryModel();
               Request r = new Request();
               string[] kq = a.Split('|');
               chuoi +=  kq[0] + kq[1] + kq[2];
               r.RequestName = kq[0];
               r.RequestContent = kq[1];
               r.Description = kq[2];
               r.DateDispatch = DateTime.Now;
               r.Accept = true;
               r.State = "1";
               r.CatalogRQId = Convert.ToInt32(kq[3]);
               r.EmployeeNumber = el.EmployeeNumber;
               rsm.inserdata(r);
               int a1 = r.RequestId;
               foreach( Request_Stationery r1 in ls )
               {
                   r1.RequestId = a1;
                   rsm.insert2(r1);
               }
               Response.Write(ls.Count);
              RequestModel rm = new RequestModel();

              string ixep = el.RegistrationNumber;
              Employee xep = rsm.informationxep(ixep);
              DataClassesStationeryDataContext dtdc = new DataClassesStationeryDataContext();
               Config c1 = dtdc.Configs.First();
               if (rm.Send(el.Email, xep.Email, kq[0], kq[1], c1.Type,Convert.ToInt32(c1.Ports), c1.MailNetwork, c1.Password))
               {
                   Redirect("Default1/MyRequest10");
               }

               }
            return null;
        }
 //them vao bang thu 2
 public void insert2(Request_Stationery rs1)
 {
     dc.Request_Stationeries.InsertOnSubmit(rs1);
     dc.SubmitChanges();
 }
 partial void DeleteRequest_Stationery(Request_Stationery instance);
 partial void UpdateRequest_Stationery(Request_Stationery instance);
 partial void InsertRequest_Stationery(Request_Stationery instance);
		private void detach_Request_Stationeries(Request_Stationery entity)
		{
			this.SendPropertyChanging();
			entity.Stationery = null;
		}
		private void attach_Request_Stationeries(Request_Stationery entity)
		{
			this.SendPropertyChanging();
			entity.Request = this;
		}