//Delete sender code document
        public static bool DeleteSenderCodeDocument(string filePath, int ClientId)
        {
            try
            {
                if (File.Exists(filePath))
                {
                    File.Delete(filePath);
                    ClientDTO ClientDTO = new ClientDTO();
                    ClientDTO = GetById(ClientId);
                    ClientDTO.SenderCodeFilePath = null;

                    GlobalSettings.LoggedInClientId = ClientDTO.Id;
                    int PartnerId = ClientService.GetById(ClientDTO.Id).PartnerId;
                    GlobalSettings.LoggedInPartnerId = PartnerId;

                    Edit(ClientDTO);

                    // Send Mail to Admin
                    PartnerDTO PartnerDTO = new PartnerDTO();
                    PartnerDTO = PartnerService.GetById(ClientDTO.PartnerId);
                    CommonService.SendEmail("Removed sendercode application request", "<HTML><BODY><P>Hello " + CommonService.GetFirstname(PartnerDTO.Name) + "</P><P>Request for sender code from " + ClientDTO.Company + " has been removed.</P></BODY></HTML>", PartnerDTO.Email, "", false);

                    return(true);
                }

                return(false);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        //Upload Sender code document to the server
        public static string UploadSenderCodeDocument(HttpPostedFile file, string documentPath, int ClientId, string FileName)
        {
            try
            {
                var    b      = new byte[file.ContentLength];
                string result = "";
                documentPath = documentPath + ClientId; //"\\" + ModuleName
                MemoryStream ms = new MemoryStream(b);
                // MemoryStream ms = new MemoryStream(file.ContentLength);
                bool IsExists = System.IO.Directory.Exists(documentPath);
                if (IsExists == false)
                {
                    System.IO.Directory.CreateDirectory(documentPath);
                }

                var path = System.IO.Path.Combine(documentPath, FileName); //file.FileName

                if (File.Exists(path))
                {
                    result = "File already Exists";
                    return(result);
                }
                else
                {
                    file.SaveAs(documentPath + "/" + FileName); //file.FileName
                    ms.Close();

                    ClientDTO ClientDTO = new ClientDTO();
                    ClientDTO = ClientService.GetById(ClientId);
                    ClientDTO.SenderCodeFilePath = ClientId + "/" + FileName;// file.FileName;
                    ClientService.Edit(ClientDTO);
                    result = "File uploaded successfully";

                    // Send Mail to Admin
                    PartnerDTO PartnerDTO = new PartnerDTO();
                    PartnerDTO = PartnerService.GetById(ClientDTO.PartnerId);
                    CommonService.SendEmail("New sendercode application request", "<HTML><BODY><P>Hello " + CommonService.GetFirstname(PartnerDTO.Name) + "</P><P>" + ClientDTO.Company + " has requested for new sender code.</P></BODY></HTML>", PartnerDTO.Email, "", false);
                    return(result);
                }
            }
            catch (Exception ex)
            {
                return(ex.ToString());
            }
        }