private void LoadListView() { MemberDocument memberList = new MemberDocument(); List <MemberDocument> memberDocuments = new List <MemberDocument>(); using (TheFacade facade = new TheFacade()) { memberDocuments = facade.MemberFacade.GetMemberByMemberId(MemberID); } lvNewMember.DataSource = memberDocuments; lvNewMember.DataBind(); }
protected void lvNewMember_ItemDataBound(object sender, ListViewItemEventArgs e) { using (TheFacade facade = new TheFacade()) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; Label lblDocumentName = (Label)e.Item.FindControl("lblDocumentName"); HyperLink hlinkDocumentNamePath = (HyperLink)e.Item.FindControl("hlinkDocumentNamePath"); Label lblVerificationStatus = (Label)e.Item.FindControl("lblVerificationStatus"); Label lblLastUpdateDate = (Label)e.Item.FindControl("lblLastUpdateDate"); MemberDocument member = dataItem.DataItem as MemberDocument; lblDocumentName.Text = member.DocumentName; hlinkDocumentNamePath.NavigateUrl = string.Format("~/{0}", member.Path); hlinkDocumentNamePath.Text = member.Path; lblVerificationStatus.Text = member.DocumentTypeID.ToString();//member.Status.ToString(); lblLastUpdateDate.Text = member.MemberID.ToString(); } } }
public List <MemberDocument> CreateMemberDocument(long ID) { List <MemberDocument> memberDocuments = new List <MemberDocument>(); try { //if (FileUploadTradeLicense.PostedFile.ContentType == "Image/jpeg/png/PNG/jpg/JPG/JPEG" && TINCertificateFileUpload.PostedFile.ContentType == "Image/jpeg/png/PNG/jpg/JPG/JPEG" && VATCertificateFileUpload.PostedFile.ContentType == "Image/jpeg/png/PNG/jpg/JPG/JPEG" && BankStatmentFileUpload.PostedFile.ContentType == "Image/jpeg/png/PNG/jpg/JPG/JPEG" && PartnershipAgrementFileUpload.PostedFile.ContentType == "Image/jpeg/png/PNG/jpg/JPG/JPEG" && PayorderFileUpload.PostedFile.ContentType == "Image/jpeg/png/PNG/jpg/JPG/JPEG") //{ //if (fuTradeLicense.PostedFile.ContentLength < 102400 && TINCertificateFileUpload.PostedFile.ContentLength < 102400 && VATCertificateFileUpload.PostedFile.ContentLength < 102400 && BankStatmentFileUpload.PostedFile.ContentLength < 102400 && PartnershipAgrementFileUpload.PostedFile.ContentLength < 102400 && PayorderFileUpload.PostedFile.ContentLength < 102400) //{ if (fuTINCertificate.HasFile) { string TINCertificatefilename = fuTINCertificate.FileName; string path = Server.MapPath(@"\MemberData\" + ID.ToString() + @"\Document\\"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } fuTINCertificate.SaveAs(Path.Combine(path, TINCertificatefilename)); MemberDocument memberDocument = new MemberDocument(); memberDocument.MemberID = ID; try { memberDocument.DocumentName = EnumHelper.EnumToString <EnumCollection.DocumentType>(Convert.ToInt32(EnumCollection.DocumentType.TIN_Certificate)); } catch (Exception ex) { } memberDocument.DocumentTypeID = Convert.ToInt32(EnumCollection.DocumentType.TIN_Certificate); memberDocument.Path = path + TINCertificatefilename.Trim(); memberDocuments.Add(memberDocument); } if (fuTradeLicense.HasFile) { string filename = fuTINCertificate.FileName; string path = Server.MapPath(@"\MemberData\" + ID.ToString() + @"\Document\\"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } fuTINCertificate.SaveAs(Path.Combine(path, filename)); MemberDocument memberDocument = new MemberDocument(); memberDocument.MemberID = ID; memberDocument.DocumentName = EnumHelper.EnumToString <EnumCollection.DocumentType>(Convert.ToInt32(EnumCollection.DocumentType.Trade_license)); memberDocument.DocumentTypeID = Convert.ToInt32(EnumCollection.DocumentType.Trade_license); memberDocument.Path = path + filename.Trim(); memberDocuments.Add(memberDocument); } if (fuPartnershipAgrement.HasFile) { string filename = fuPartnershipAgrement.FileName; string path = Server.MapPath(@"\MemberData\" + ID.ToString() + @"\Document\\"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } fuTINCertificate.SaveAs(Path.Combine(path, filename)); MemberDocument memberDocument = new MemberDocument(); memberDocument.MemberID = ID; memberDocument.DocumentName = EnumHelper.EnumToString <EnumCollection.DocumentType>(Convert.ToInt32(EnumCollection.DocumentType.Partnership_Aggrement)); memberDocument.DocumentTypeID = Convert.ToInt32(EnumCollection.DocumentType.Partnership_Aggrement); memberDocument.Path = path + filename.Trim(); memberDocuments.Add(memberDocument); } if (fuBankStatment.HasFile) { string filename = fuTINCertificate.FileName; string path = Server.MapPath(@"\MemberData\" + ID.ToString() + @"\Document\\"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } fuTINCertificate.SaveAs(Path.Combine(path, filename)); MemberDocument memberDocument = new MemberDocument(); memberDocument.MemberID = ID; memberDocument.DocumentName = EnumHelper.EnumToString <EnumCollection.DocumentType>(Convert.ToInt32(EnumCollection.DocumentType.Bank_Statment)); memberDocument.DocumentTypeID = Convert.ToInt32(EnumCollection.DocumentType.Bank_Statment); memberDocument.Path = path + filename.Trim(); memberDocuments.Add(memberDocument); } if (fuVATCertificate.HasFile) { string filename = fuTINCertificate.FileName; string path = Server.MapPath(@"\MemberData\" + ID.ToString() + @"\Document\\"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } fuTINCertificate.SaveAs(Path.Combine(path, filename)); MemberDocument memberDocument = new MemberDocument(); memberDocument.MemberID = ID; memberDocument.DocumentName = EnumHelper.EnumToString <EnumCollection.DocumentType>(Convert.ToInt32(EnumCollection.DocumentType.VAT_Certificate)); memberDocument.DocumentTypeID = Convert.ToInt32(EnumCollection.DocumentType.VAT_Certificate); memberDocument.Path = path + filename.Trim(); memberDocuments.Add(memberDocument); } } catch (Exception ex) { lblmessage.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message; } return(memberDocuments); }