public ActionResult CustFiles(Tender_CustomerFiles custf, HttpPostedFileBase[] fileToUpload, int id = 0, int Gid=0)
        {
            if (id == 3)
                return Content("");

            HttpPostedFileBase file =null;
            if (fileToUpload != null)
                file=fileToUpload[0];
            if(file!=null&&!String.IsNullOrEmpty(file.FileName))
            {
                custf.CustFile = DateTime.Now.ToString("yyyyMMdd") + Guid.NewGuid().ToString("N");
                Directory.CreateDirectory(Path.Combine(System.Web.Configuration.WebConfigurationManager.AppSettings["AttachmentRootPath"], (custf.CustFile.Substring(0, 4) + @"\" + custf.CustFile.Substring(4, 4) + @"\")));
                file.SaveAs(Path.Combine(System.Web.Configuration.WebConfigurationManager.AppSettings["AttachmentRootPath"], (custf.CustFile.Substring(0, 4) + @"\" + custf.CustFile.Substring(4, 4) + @"\" + custf.CustFile.Substring(8))));
                GenericDataAccess.UpdateBySql("Insert into YZAppAttachment(FileID,Name,Ext,Size,OwnerAccount) values(@FileID,@Name,@Ext,@Size,@OwnerAccount)", new string[,] {
                    { "@FileID",custf.CustFile,"DbType.String",null },
                    { "@Name",Path.GetFileName(file.FileName),"DbType.String",null },
                    { "@Ext",Path.GetExtension(file.FileName),"DbType.String",null },
                    { "@Size",file.ContentLength.ToString(),"DbType.Int32",null },
                    { "@OwnerAccount","0","DbType.String",null } });
            }

            db.Tender_CustomerFiless.Add(custf);
            db.SaveChanges();
            //string fPath = @"D://myupload/" + file.FileName;
            //file.SaveAs(fPath);
            //string custT="nul";
            //if(custf!=null)
            //{
            //    custT = custf.CustText;
            //}
            return Content("保存成功");
            //return View(custf);
        }
 public ActionResult CustFiles(int id=0)
 {
     Tender_CustomerFiles custF = new Tender_CustomerFiles();
     custF.Gid = id;
     return View(custF);
 }