Ejemplo n.º 1
0
        public void UpdatePhoto(PhotoDetails photoDetails)
        {
            int    maxId = GetMaxId("tblPhotos", "Id") + 1;
            string query = "INSERT INTO [tblPhotos]([Id],[PhotoHeader],[ThumbnailUrl],[PhotoUrl])VALUES(" + maxId + ",'" + photoDetails.PhotoHeader + "','" + photoDetails.ThumbnailUrl + "','" + photoDetails.PhotoUrl + "');";

            ExecuteNonQuery(query);
        }
Ejemplo n.º 2
0
        public IEnumerable <PhotoDetails> GetPhotoDetails(String id)
        {
            MySqlConnection m_Conn;
            MySqlCommand    m_Cmd;
            MySqlDataReader dataReader;

            m_Conn = new MySqlConnection(Database.Connect());
            m_Conn.Open();

            ////stored procedure
            m_Cmd = new MySqlCommand("getPhotoDetails", m_Conn);

            m_Cmd.CommandType = System.Data.CommandType.StoredProcedure;

            m_Cmd.Parameters.AddWithValue("id", id);

            dataReader = m_Cmd.ExecuteReader();

            List <PhotoDetails> lst = new List <PhotoDetails>();

            while (dataReader.Read())
            {
                PhotoDetails temp = new PhotoDetails(dataReader.GetString(0), dataReader.GetString(1), dataReader.GetString(2), dataReader.GetString(3), dataReader.GetInt32(4), dataReader.GetDouble(5), dataReader.GetDouble(6));
                lst.Add(temp);
            }

            dataReader.Close();
            m_Conn.Close();

            return(lst);
        }
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\r\n<div class=\"content-container\">\r\n    ");

            #line 5 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoDiv.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(PictureInformation.PictureFigureWithCaptionTag("100vw")));

            #line default
            #line hidden
            this.Write("\r\n    ");

            #line 7 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoDiv.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(PhotoDetails.PhotoDetailsDiv(DbEntry).ToString()));

            #line default
            #line hidden
            this.Write("\r\n    ");

            #line 9 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoDiv.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.PostBodyDiv(DbEntry).ToString()));

            #line default
            #line hidden
            this.Write("\r\n    ");

            #line 10 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoDiv.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(BodyContentReferences.RelatedContentTag(DbEntry.ContentId, "").Result));

            #line default
            #line hidden
            this.Write("\r\n</div>\r\n");
            return(this.GenerationEnvironment.ToString());
        }
Ejemplo n.º 4
0
        public List <List <PhotoDetails> > LoadPhotos()
        {
            List <List <PhotoDetails> > dictPhotoDetails = new List <List <PhotoDetails> >();
            List <PhotoDetails>         lstInfo          = new List <PhotoDetails>();

            using (DataSet ds = dataAccess.LoadPhotos())
            {
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    string preEvent = string.Empty;
                    foreach (DataRow dataRow in ds.Tables[0].Rows)
                    {
                        string currEvent = Helper.GetDbValue(dataRow["PhotoHeader"]);
                        if (string.IsNullOrEmpty(preEvent))
                        {
                            lstInfo = new List <PhotoDetails>();
                            PhotoDetails companyData = new PhotoDetails()
                            {
                                PhotoHeader  = Helper.GetDbValue(dataRow["PhotoHeader"]),
                                PhotoUrl     = Helper.GetDbValue(dataRow["PhotoUrl"]),
                                ThumbnailUrl = Helper.GetDbValue(dataRow["ThumbnailUrl"]),
                            };
                            lstInfo.Add(companyData);
                            preEvent = currEvent;
                            dictPhotoDetails.Add(lstInfo);
                        }
                        else if (preEvent.Equals(currEvent, StringComparison.OrdinalIgnoreCase))
                        {
                            PhotoDetails companyData = new PhotoDetails()
                            {
                                PhotoHeader  = Helper.GetDbValue(dataRow["PhotoHeader"]),
                                PhotoUrl     = Helper.GetDbValue(dataRow["PhotoUrl"]),
                                ThumbnailUrl = Helper.GetDbValue(dataRow["ThumbnailUrl"]),
                            };
                            lstInfo.Add(companyData);
                            preEvent = currEvent;
                        }
                        else
                        {
                            lstInfo = new List <PhotoDetails>();
                            PhotoDetails companyData = new PhotoDetails()
                            {
                                PhotoHeader  = Helper.GetDbValue(dataRow["PhotoHeader"]),
                                PhotoUrl     = Helper.GetDbValue(dataRow["PhotoUrl"]),
                                ThumbnailUrl = Helper.GetDbValue(dataRow["ThumbnailUrl"]),
                            };
                            preEvent = currEvent;
                            lstInfo.Add(companyData);
                            dictPhotoDetails.Add(lstInfo);
                        }
                    }
                }
            }

            return(dictPhotoDetails);
        }
Ejemplo n.º 5
0
 public string UpdatePhoto(PhotoDetails photoDetails)
 {
     try
     {
         Business business = new Business();
         return(business.UpdatePhoto(photoDetails));
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
Ejemplo n.º 6
0
        public static Uri PhotoFor(PhotoDetails details)
        {
            var photoUri = new Uri(Config.WebsiteAddress, "/profiles/" + details.ProfileId + "/photos/" + details.Id);

            var location = photoUri.ToString();

            if (string.IsNullOrEmpty(details.Hash) == false)
            {
                location += "?hash=" + details.Hash;
            }

            return(new Uri(location));
        }
Ejemplo n.º 7
0
        private async Task GetPhotoDetails(string id)
        {
            var photosresult = await _photosDataServices.GetPhotoDetailsResultAsync(id);

            if (photosresult.Successful)
            {
                PhotoDetails = photosresult.Content;
            }
            else
            {
                ShowError(photosresult.Message);
            }

            ProgressVisibility = false;
        }
        public ActionResult Create(PhotoDetails model)
        {
            try
            {
                UploadFile(HttpContext.Request, model);

                _photoDetailsService.Add(model);
                _photoDetailsService.Save();

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                ViewBag.Message = "File upload failed!!";
                return(View());
            }
        }
        public ActionResult EditPost(Guid id, PhotoDetails model)
        {
            try
            {
                var photoModel = _photoDetailsService.GetAll().Where(x => x.Id == id).SingleOrDefault();
                photoModel.Title       = model.Title;
                photoModel.Description = model.Description;
                photoModel.IsActive    = model.IsActive;

                _photoDetailsService.Edit(photoModel);
                _photoDetailsService.Save();

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                return(View());
            }
        }
        private void UploadFile(HttpRequestBase request, PhotoDetails model)
        {
            if (request.Files.AllKeys.Any())
            {
                // Get the uploaded image from the Files collection
                var httpPostedFile = request.Files[0];

                var fileName = httpPostedFile.FileName;

                if (httpPostedFile != null)
                {
                    // Validate the uploaded image(optional)

                    // Get the complete file path
                    var fileSavePath = (HttpContext.Server.MapPath("~/GalleryPhotos/") + model.Id + fileName.Substring(fileName.LastIndexOf('.')));

                    // Save the uploaded file to "UploadedFiles" folder
                    httpPostedFile.SaveAs(fileSavePath);
                    model.ImageUrl = fileSavePath;
                }
            }
        }
Ejemplo n.º 11
0
        private void btnPreviewNSave_Click(object sender, EventArgs e)
        {
            Person oPerson = null;

            if (validateControls())
            {
                oPerson                  = new Person();
                oPerson.PersonID         = 0;
                oPerson.PersonCode       = "";
                oPerson.PersonFirstName  = txtPersonFName.Text.Trim();
                oPerson.PersonMiddleName = txtPersonMName.Text.Trim();
                oPerson.PersonLastName   = txtPersonLName.Text.Trim();
                oPerson.OrganizationName = "";
                oPerson.PersonDOB        = Convert.ToDateTime(mskPersonDOB.Text.Trim());
                int nGender = -1;
                if (rdPersonMale.Checked)
                {
                    nGender = 1;
                }
                else if (rdPersonFemale.Checked)
                {
                    nGender = 2;
                }
                else if (rdPersonOthers.Checked)
                {
                    nGender = 0;
                }
                oPerson.PersonEntityTypeCode = eGlobal.EntityType.Individual.GetHashCode();
                oPerson.PersonEntityTypeDesc = eGlobal.EntityType.Individual.ToString();

                oPerson.PersonGender   = nGender;
                oPerson.PersonTypeCode = PersonType.GetHashCode();
                oPerson.personTypeDesc = PersonType.ToString();

                AddressDetails oAddress = new AddressDetails();
                oAddress.AddressID    = 0;
                oAddress.PersonID     = 0;
                oAddress.AddressType  = 1;
                oAddress.AddressLine1 = txtAddressLine1.Text.Trim();
                oAddress.AddressLine2 = txtAddressLine2.Text.Trim();
                oAddress.City         = txtArea.Text.Trim();
                oAddress.Taluka       = txtTaluka.Text.Trim();
                oAddress.District     = txtDistrict.Text.Trim();
                oAddress.State        = txtState.Text.Trim();
                oAddress.ZipCode      = txtPincode.Text.Trim();

                //oPerson.AddressDetails = oAddress;

                List <ContactDetails> lstContactDetails = new List <ContactDetails>();
                ContactDetails        oContact          = new ContactDetails();
                oContact.ContactID       = 0;
                oContact.PersonID        = 0;
                oContact.ContactNo       = txtMobileNo.Text.Trim();
                oContact.ContactTypeCode = eGlobal.ContactType.MobileNo.GetHashCode().ToString();
                oContact.ContactTypeDesc = eGlobal.ContactType.MobileNo.ToString();// "MobileNo";
                //oPerson.ContactDetails.Add(oContact);
                lstContactDetails.Add(oContact);
                oContact = null;

                oContact                 = new ContactDetails();
                oContact.ContactID       = 0;
                oContact.PersonID        = 0;
                oContact.ContactNo       = txtFaxNo.Text.Trim();
                oContact.ContactTypeCode = eGlobal.ContactType.FaxNo.GetHashCode().ToString();
                oContact.ContactTypeDesc = eGlobal.ContactType.FaxNo.ToString();// "FaxNo";
                //oPerson.ContactDetails.Add(oContact);
                lstContactDetails.Add(oContact);
                oContact = null;

                oContact                 = new ContactDetails();
                oContact.ContactID       = 0;
                oContact.PersonID        = 0;
                oContact.ContactNo       = txtEmail.Text.Trim();
                oContact.ContactTypeCode = eGlobal.ContactType.EmailID.GetHashCode().ToString();
                oContact.ContactTypeDesc = eGlobal.ContactType.EmailID.ToString();// "EmailID";
                //oPerson.ContactDetails.Add(oContact);
                lstContactDetails.Add(oContact);

                //oPerson.ContactDetails = lstContactDetails;

                VerificationDetails oVerification = new VerificationDetails();
                oVerification.PersonID                = 0;
                oVerification.AadhaarCardNo           = txtAadhaarNo.Text.Trim();
                oVerification.DrivingLicenceNo        = txtDrivingLicenceNo.Text.Trim();
                oVerification.PANCardNo               = txtPANNo.Text.Trim();
                oVerification.OtherIdCardDocumentNo   = txtOtherDocumentID.Text.Trim();
                oVerification.OtherIdCardDocumentName = txtOtherDocumentName.Text.Trim();
                oVerification.AadhaarCardID           = 0;
                oVerification.DrivingLicenceID        = 0;
                oVerification.PANID = 0;
                oVerification.OtherIdCardDocumentID = 0;

                //oPerson.VerificationDetails = oVerification;

                PhotoDetails oPhotoDetails = new PhotoDetails();
                if (PersonPhotoExtention != null)
                {
                    oPhotoDetails.PhotoID       = 0;
                    oPhotoDetails.PersonID      = 0;
                    oPhotoDetails.iPhoto        = File.ReadAllBytes(PersonPhotoLocation);
                    oPhotoDetails.FileExtension = PersonPhotoExtention;
                    oPhotoDetails.MIMEType      = "";
                    oPhotoDetails.FileSize      = PersonPhotoSize;
                    oPhotoDetails.Width         = PersonPhotoWidth;
                    oPhotoDetails.Height        = PersonPhotoHeight;
                    oPhotoDetails.Thumbnail     = File.ReadAllBytes(PersonThumbImagePath);
                }

                //oPerson.PhotoDetails = oPhotoDetails;

                DataTable dtContactDetails = eGlobal.CreateDataTable <ContactDetails>(lstContactDetails);
                //oPerson.ContactDetails = dtContactDetails;


                List <CardDetails> lstCardDetails = new List <CardDetails>();
                CardDetails        oCardDetails   = new CardDetails();

                oCardDetails                   = new CardDetails();
                oCardDetails.CardID            = 0;
                oCardDetails.PersonID          = 0;
                oCardDetails.ReferenceID       = oVerification.AadhaarCardID;
                oCardDetails.IDTypeCode        = eGlobal.CardType.AadhaarCard.GetHashCode();
                oCardDetails.IDTypeDescription = eGlobal.CardType.AadhaarCard.ToString();
                oCardDetails.iPhoto            = null;
                lstCardDetails.Add(oCardDetails);
                oCardDetails = null;

                oCardDetails                   = new CardDetails();
                oCardDetails.CardID            = 0;
                oCardDetails.PersonID          = 0;
                oCardDetails.ReferenceID       = oVerification.PANID;
                oCardDetails.IDTypeCode        = eGlobal.CardType.PanCard.GetHashCode();
                oCardDetails.IDTypeDescription = eGlobal.CardType.PanCard.ToString();
                oCardDetails.iPhoto            = null;
                lstCardDetails.Add(oCardDetails);
                oCardDetails = null;

                oCardDetails                   = new CardDetails();
                oCardDetails.CardID            = 0;
                oCardDetails.PersonID          = 0;
                oCardDetails.ReferenceID       = oVerification.DrivingLicenceID;
                oCardDetails.IDTypeCode        = eGlobal.CardType.DrivingLicenceID.GetHashCode();
                oCardDetails.IDTypeDescription = eGlobal.CardType.DrivingLicenceID.ToString();
                oCardDetails.iPhoto            = null;
                lstCardDetails.Add(oCardDetails);
                oCardDetails = null;

                oCardDetails                   = new CardDetails();
                oCardDetails.CardID            = 0;
                oCardDetails.PersonID          = 0;
                oCardDetails.ReferenceID       = oVerification.OtherIdCardDocumentID;
                oCardDetails.IDTypeCode        = eGlobal.CardType.OtherIDCard.GetHashCode();
                oCardDetails.IDTypeDescription = eGlobal.CardType.OtherIDCard.ToString();
                oCardDetails.iPhoto            = null;
                lstCardDetails.Add(oCardDetails);
                oCardDetails = null;

                DataTable dtCardDetails = eGlobal.CreateDataTable <CardDetails>(lstCardDetails);
                //oPerson.CardDetails = dtCardDetails;
                //oPerson.iPhoto=
                if (oPerson != null)
                {
                    frmViewPersonDetails_Confirm ofrmViewPersonDetails = new frmViewPersonDetails_Confirm();
                    ofrmViewPersonDetails.PersonType    = PersonType;
                    ofrmViewPersonDetails.PersonDetails = oPerson;
                    ofrmViewPersonDetails.oAddress      = oAddress;
                    ofrmViewPersonDetails.lstCard       = lstCardDetails;
                    ofrmViewPersonDetails.lstContact    = lstContactDetails;
                    ofrmViewPersonDetails.oPhoto        = oPhotoDetails;
                    ofrmViewPersonDetails.oVerification = oVerification;
                    ofrmViewPersonDetails.ShowDialog(this);
                    ofrmViewPersonDetails.Dispose();
                    ofrmViewPersonDetails = null;
                }
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"utf-8\">\r\n    <title" +
                       ">");

            #line 7 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.Title.HtmlEncode()));

            #line default
            #line hidden
            this.Write("</title>\r\n    <meta name=\"description\" content=\"");

            #line 8 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.Summary.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\">\r\n    <meta name=\"author\" content=\"");

            #line 9 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.CreatedBy.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\">\r\n    <meta name=\"keywords\" content=\"");

            #line 10 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.Tags.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\" >\r\n\r\n    <meta property=\"og:site_name\" content=\"");

            #line 12 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SiteName.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\" />\r\n    <meta property=\"og:url\" content=\"https:");

            #line 13 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(PageUrl));

            #line default
            #line hidden
            this.Write("\" />\r\n    <meta property=\"og:type\" content=\"article\" />\r\n    <meta property=\"og:t" +
                       "itle\" content=\"");

            #line 15 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.Title.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\" />\r\n    <meta property=\"og:description\" content=\"");

            #line 16 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.Summary.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\" />\r\n\r\n    ");

            #line 18 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.OpenGraphImageMetaTags(PictureInformation)));

            #line default
            #line hidden
            this.Write("\r\n\r\n    <link rel = \"schema.DC\" href = \"http://purl.org/DC/elements/1.0/\">\r\n    <" +
                       "meta name=\"DC.Title\" content=\"");

            #line 22 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.Title.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\">\r\n    <meta name =\"DC.Creator\" content=\"");

            #line 23 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.CreatedBy.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\">\r\n    <meta name =\"DC.Publisher\" content=\"");

            #line 24 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SiteName.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\">\r\n    <meta name=\"DC.Description\" content=\"");

            #line 25 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.Summary.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\">\r\n    <meta name=\"DC.Date\" content=\"");

            #line 26 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.CreatedOn.ToString("yyyy-MM-dd").HtmlEncode()));

            #line default
            #line hidden
            this.Write("\">\r\n    <meta name=\"DC.Format\" content=\"text/html\">\r\n    <meta name=\"DC.Language\"" +
                       " content=\"en-US\">\r\n\r\n    <link rel=\"alternate\" type=\"application/rss+xml\" \r\n    " +
                       "  title=\"");

            #line 32 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture($"RSS Feed for {UserSettingsSingleton.CurrentSettings().SiteName} - Photos".HtmlEncode()));

            #line default
            #line hidden
            this.Write("\"\r\n      href=\"https:");

            #line 34 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(UserSettingsSingleton.CurrentSettings().PhotoRssUrl()));

            #line default
            #line hidden
            this.Write("\" />\r\n\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"" +
                       ">\r\n\r\n    ");

            #line 39 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.CssStyleFileString()));

            #line default
            #line hidden
            this.Write("\r\n    ");

            #line 40 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.FavIconFileString()));

            #line default
            #line hidden
            this.Write("\r\n\r\n</head>\r\n\r\n<body class=\"single-photo-body\">\r\n    ");

            #line 45 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(PictureInformation.PictureFigureWithTitleCaptionTag("100vw")));

            #line default
            #line hidden
            this.Write("\r\n    <div class=\"information-section\">\r\n        ");

            #line 48 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(PhotoDetails.PhotoDetailsDiv(DbEntry).ToString()));

            #line default
            #line hidden
            this.Write("\r\n        ");

            #line 50 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.PostBodyDiv(DbEntry).ToString()));

            #line default
            #line hidden
            this.Write("\r\n        ");

            #line 51 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.TagList(DbEntry).ToString()));

            #line default
            #line hidden
            this.Write("\r\n        ");

            #line 52 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(BodyContentReferences.RelatedContentTag(DbEntry.ContentId, "").Result));

            #line default
            #line hidden
            this.Write("\r\n        ");

            #line 54 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.CreatedByAndUpdatedOnDiv(DbEntry).ToString()));

            #line default
            #line hidden
            this.Write("\r\n        ");

            #line 56 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.UpdateNotesDiv(DbEntry).ToString()));

            #line default
            #line hidden
            this.Write("\r\n    </div>\r\n    ");

            #line 58 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(HorizontalRule.StandardRule()));

            #line default
            #line hidden
            this.Write("\r\n    ");

            #line 59 "C:\Code\PointlessWaymarksCmsSpatiaLite\PointlessWaymarksCmsData\Html\PhotoHtml\SinglePhotoPage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Footer.StandardFooterDiv()));

            #line default
            #line hidden
            this.Write("\r\n</body>\r\n\r\n</html>");
            return(this.GenerationEnvironment.ToString());
        }
Ejemplo n.º 13
0
        private void btnDetails_Click(object sender, EventArgs e)
        {
            if (dgvPersonList != null)
            {
                int rowindex = dgvPersonList.CurrentCell.RowIndex;
                int colindex = 0;

                Int64   PersonID = Convert.ToInt64(dgvPersonList.Rows[rowindex].Cells[colindex].Value);
                DataSet ds       = GetPersonDetails(PersonID);

                if (ds != null && ds.Tables.Count > 0)
                {
                    AddressDetails        oAddress      = new AddressDetails();
                    Person                oPerson       = new Person();
                    PhotoDetails          oPhoto        = new PhotoDetails();
                    VerificationDetails   oVerification = new VerificationDetails();
                    List <ContactDetails> lstContact    = new List <ContactDetails>();

                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        oAddress.AddressID    = Convert.ToInt64(dr["AddressId"]);
                        oAddress.AddressType  = Convert.ToInt16(dr["AddressType"]);
                        oAddress.AddressLine1 = Convert.ToString(dr["AddressLine1"]);
                        oAddress.AddressLine2 = Convert.ToString(dr["AddressLine2"]);
                        oAddress.City         = Convert.ToString(dr["City"]);
                        oAddress.Taluka       = Convert.ToString(dr["Taluka"]);
                        oAddress.District     = Convert.ToString(dr["District"]);
                        oAddress.State        = Convert.ToString(dr["State"]);
                        oAddress.ZipCode      = Convert.ToString(dr["ZipCode"]);
                    }

                    foreach (DataRow dr in ds.Tables[1].Rows)
                    {
                        ContactDetails oContact = new ContactDetails();
                        oContact.ContactID       = Convert.ToInt64(dr["ContactId"]);
                        oContact.ContactNo       = Convert.ToString(dr["ContactNo"]);
                        oContact.ContactTypeCode = Convert.ToString(dr["ContactTypeCode"]);
                        oContact.ContactTypeDesc = Convert.ToString(dr["ContactTypeDesc"]);

                        lstContact.Add(oContact);
                        oContact = null;
                    }

                    foreach (DataRow dr in ds.Tables[2].Rows)
                    {
                        oPhoto.PhotoID = Convert.ToInt64(dr["PhotoID"]);
                        //oPhoto.iPhoto = Convert.(dr[""]);
                        oPhoto.FileExtension = Convert.ToString(dr["FileExtension"]);
                        oPhoto.MIMEType      = Convert.ToString(dr["MIMEType"]);
                        oPhoto.FileSize      = Convert.ToInt64(dr["FileSize"]);
                        oPhoto.Width         = Convert.ToInt16(dr["Width"]);
                        oPhoto.Height        = Convert.ToInt16(dr["Height"]);
                        //oPhoto.Thumbnail = Convert.(dr[""]);
                    }

                    foreach (DataRow dr in ds.Tables[3].Rows)
                    {
                        switch (Convert.ToString(dr["TypeCode"]))
                        {
                        case "0":
                        {
                            oVerification.AadhaarCardID = Convert.ToInt64(dr["ID"]);
                            oVerification.AadhaarCardNo = Convert.ToString(dr["No"]);
                        }
                        break;

                        case "1":
                        {
                            oVerification.PANID     = Convert.ToInt64(dr["ID"]);
                            oVerification.PANCardNo = Convert.ToString(dr["No"]);
                        }
                        break;

                        case "2":
                        {
                            oVerification.DrivingLicenceID = Convert.ToInt64(dr["ID"]);
                            oVerification.DrivingLicenceNo = Convert.ToString(dr["No"]);
                        }
                        break;

                        case "3":
                        {
                            oVerification.OtherIdCardDocumentID   = Convert.ToInt64(dr["ID"]);
                            oVerification.OtherIdCardDocumentNo   = Convert.ToString(dr["No"]);
                            oVerification.OtherIdCardDocumentName = Convert.ToString(dr["Name"]);
                        }
                        break;
                        }
                    }

                    foreach (DataRow dr in ds.Tables[4].Rows)
                    {
                        oPerson.PersonID             = Convert.ToInt64(dr["PersonID"]);;
                        oPerson.PersonCode           = Convert.ToString(dr["Code"]);
                        oPerson.PersonFirstName      = Convert.ToString(dr["FirstName"]);
                        oPerson.PersonMiddleName     = Convert.ToString(dr["MiddleName"]);
                        oPerson.PersonLastName       = Convert.ToString(dr["LastName"]);
                        oPerson.OrganizationName     = Convert.ToString(dr["OrganizationName"]);
                        oPerson.PersonDOB            = Convert.ToDateTime(dr["DOB"]);
                        oPerson.PersonEntityTypeCode = Convert.ToInt32(dr["EntityTypeCode"]);;
                        oPerson.PersonEntityTypeDesc = Convert.ToString(dr["EntityTypeDesc"]);
                        oPerson.PersonGender         = Convert.ToInt32(dr["Gender"]);
                        oPerson.PersonTypeCode       = Convert.ToInt32(dr["PersonTypeCode"]);
                        oPerson.personTypeDesc       = Convert.ToString(dr["personTypeDesc"]);
                    }

                    frmViewPersonDetails_Confirm ofrmViewPersonDetails_Confirm = new frmViewPersonDetails_Confirm();
                    //ofrmViewPersonDetails_Confirm.PersonType = PersonType;
                    ofrmViewPersonDetails_Confirm.PersonDetails   = oPerson;
                    ofrmViewPersonDetails_Confirm.oAddress        = oAddress;
                    ofrmViewPersonDetails_Confirm.lstCard         = new List <CardDetails>();
                    ofrmViewPersonDetails_Confirm.lstContact      = lstContact;
                    ofrmViewPersonDetails_Confirm.oPhoto          = oPhoto;
                    ofrmViewPersonDetails_Confirm.oVerification   = oVerification;
                    ofrmViewPersonDetails_Confirm.btnSave.Visible = false;
                    ofrmViewPersonDetails_Confirm.ShowDialog(this);
                    ofrmViewPersonDetails_Confirm.Dispose();
                    ofrmViewPersonDetails_Confirm = null;
                }
            }
        }
Ejemplo n.º 14
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="photosDataServices"></param>
 public DetailsPageViewModel(IPhotosDataServices photosDataServices)
 {
     _photosDataServices = photosDataServices;
     PhotoDetails        = new PhotoDetails();
     ProgressVisibility  = true;
 }
Ejemplo n.º 15
0
 public string UpdatePhoto(PhotoDetails photoDetails)
 {
     dataAccess.UpdatePhoto(photoDetails);
     return("OK");
 }
Ejemplo n.º 16
0
        public async Task <PhotoDetails> StorePhoto(Photo photo, CancellationToken cancellationToken)
        {
            Ensure.Any.IsNotNull(photo, nameof(photo));

            var blobReference = GetBlobReference(photo);

            var client = GetClient();

            var container = client.GetContainerReference(ContainerName);

            var blockBlob = container.GetBlockBlobReference(blobReference);

            photo.Data.Position = 0;

            var buffer = new byte[photo.Data.Length];

            await photo.Data.ReadAsync(buffer, 0, buffer.Length, cancellationToken).ConfigureAwait(false);

            var hash = GetBlobHash(buffer);

            blockBlob.Metadata[nameof(Photo.ContentType)] = photo.ContentType;
            blockBlob.Metadata[nameof(Photo.Hash)]        = hash;
            photo.Hash = hash;

            try
            {
                await blockBlob.UploadFromByteArrayAsync(buffer, 0, buffer.Length, null, null, null, cancellationToken)
                .ConfigureAwait(false);
            }
            catch (StorageException ex)
            {
                if (ex.RequestInformation.HttpStatusCode != 404)
                {
                    throw;
                }

                // Check if this 404 is because of the container not existing
                if (ex.RequestInformation.ExtendedErrorInformation.ErrorCode == "ContainerNotFound")
                {
                    await container.CreateAsync(BlobContainerPublicAccessType.Container, null, null, cancellationToken)
                    .ConfigureAwait(false);

                    await blockBlob
                    .UploadFromByteArrayAsync(buffer, 0, buffer.Length, null, null, null, cancellationToken)
                    .ConfigureAwait(false);
                }
                else
                {
                    // This is an unknown failure scenario
                    throw;
                }
            }

            var details = new PhotoDetails
            {
                Id        = photo.Id,
                ProfileId = photo.ProfileId,
                Hash      = photo.Hash
            };

            return(details);
        }