Пример #1
0
        private void UpdateCheckListFromModel(CheckListOfProperty target, CheckListOfPropertyModel source)
        {
            target.CheckListPropertyId = source.CheckListPropertyId;
            target.CheckListId         = source.CheckListId;
            target.PropertyCheckListId = source.PropertyCheckListId;
            target.Mandatory           = source.Mandatory;
            target.Delete = source.Delete;

            if (source.Documents == null)
            {
                return;
            }

            List <PropertyCheckListDocuments> docList = new List <PropertyCheckListDocuments>();

            foreach (var obj in source.Documents)
            {
                var doc = new PropertyCheckListDocuments();
                UpdateDocumentFromModel(doc, obj);
                docList.Add(doc);
            }
            target.Documents = docList;
        }
Пример #2
0
        private void UpdatePropertyCheckListFromModel(PropertyCheckList target, PropertyCheckListModel source)
        {
            target.PropertyCheckListId   = source.PropertyCheckListId;
            target.PropertyGuid          = source.PropertyGuid;
            target.PropertyName          = source.PropertyName;
            target.TalukId               = Convert.ToInt32(source.TalukId);
            target.HobliId               = Convert.ToInt32(source.HobliId);
            target.VillageId             = Convert.ToInt32(source.VillageId);
            target.DocumentTypeId        = Convert.ToInt32(source.DocumentTypeId);
            target.PropertyTypeId        = Convert.ToInt32(source.PropertyTypeId);
            target.SurveyNo              = source.SurveyNo;
            target.PropertyGMapLink      = source.PropertyGMapLink;
            target.LandAreaInputAcres    = Convert.ToDecimal(string.IsNullOrEmpty(source.LandAreaInputAcres) ? "0" : source.LandAreaInputAcres);
            target.LandAreaInputGuntas   = Convert.ToDecimal(string.IsNullOrEmpty(source.LandAreaInputGuntas) ? "0" : source.LandAreaInputGuntas);
            target.LandAreaInputAanas    = Convert.ToDecimal(string.IsNullOrEmpty(source.LandAreaInputAanas) ? "0" : source.LandAreaInputAanas);
            target.LandAreaInAcres       = Convert.ToDecimal(string.IsNullOrEmpty(source.LandAreaInAcres) ? "0" : source.LandAreaInAcres);
            target.LandAreaInGuntas      = Convert.ToDecimal(string.IsNullOrEmpty(source.LandAreaInGuntas) ? "0" : source.LandAreaInGuntas);
            target.LandAreaInSqMts       = Convert.ToDecimal(string.IsNullOrEmpty(source.LandAreaInSqMts) ? "0" : source.LandAreaInSqMts);
            target.LandAreaInSqft        = Convert.ToDecimal(string.IsNullOrEmpty(source.LandAreaInSqft) ? "0" : source.LandAreaInSqft);
            target.AKarabAreaInputAcres  = Convert.ToDecimal(string.IsNullOrEmpty(source.AKarabAreaInputAcres) ? "0" : source.AKarabAreaInputAcres);
            target.AKarabAreaInputGuntas = Convert.ToDecimal(string.IsNullOrEmpty(source.AKarabAreaInputGuntas) ? "0" : source.AKarabAreaInputGuntas);
            target.AKarabAreaInputAanas  = Convert.ToDecimal(string.IsNullOrEmpty(source.AKarabAreaInputAanas) ? "0" : source.AKarabAreaInputAanas);
            target.AKarabAreaInAcres     = Convert.ToDecimal(string.IsNullOrEmpty(source.AKarabAreaInAcres) ? "0" : source.AKarabAreaInAcres);
            target.AKarabAreaInGuntas    = Convert.ToDecimal(string.IsNullOrEmpty(source.AKarabAreaInGuntas) ? "0" : source.AKarabAreaInGuntas);
            target.AKarabAreaInSqMts     = Convert.ToDecimal(string.IsNullOrEmpty(source.AKarabAreaInSqft) ? "0" : source.AKarabAreaInSqft);
            target.AKarabAreaInSqft      = Convert.ToDecimal(string.IsNullOrEmpty(source.LandAreaInputAcres) ? "0" : source.LandAreaInputAcres);
            target.BKarabAreaInputAcres  = Convert.ToDecimal(string.IsNullOrEmpty(source.BKarabAreaInputAcres) ? "0" : source.BKarabAreaInputAcres);
            target.BKarabAreaInputGuntas = Convert.ToDecimal(string.IsNullOrEmpty(source.BKarabAreaInputGuntas) ? "0" : source.BKarabAreaInputGuntas);
            target.BKarabAreaInputAanas  = Convert.ToDecimal(string.IsNullOrEmpty(source.BKarabAreaInputAanas) ? "0" : source.BKarabAreaInputAanas);
            target.BKarabAreaInAcres     = Convert.ToDecimal(string.IsNullOrEmpty(source.BKarabAreaInAcres) ? "0" : source.BKarabAreaInAcres);
            target.BKarabAreaInGuntas    = Convert.ToDecimal(string.IsNullOrEmpty(source.BKarabAreaInGuntas) ? "0" : source.BKarabAreaInGuntas);
            target.BKarabAreaInSqMts     = Convert.ToDecimal(string.IsNullOrEmpty(source.BKarabAreaInSqMts) ? "0" : source.BKarabAreaInSqMts);
            target.BKarabAreaInSqft      = Convert.ToDecimal(string.IsNullOrEmpty(source.BKarabAreaInSqft) ? "0" : source.BKarabAreaInSqft);
            target.CompanyID             = Convert.ToInt32(source.CompanyID);
            target.PropertyDescription   = source.PropertyDescription;
            target.CheckListMaster       = source.CheckListMaster;

            //if (source.PropertyCheckListDocuments != null && source.PropertyCheckListDocuments.Count > 0)
            //{
            //    List<PropertyCheckListDocuments> docList = new List<PropertyCheckListDocuments>();
            //    foreach (var obj in source.PropertyCheckListDocuments)
            //    {
            //        var doc = new PropertyCheckListDocuments();
            //        UpdateDocumentFromModel(doc, obj);
            //        docList.Add(doc);
            //    }
            //    target.PropertyCheckListDocuments = docList;
            //}
            if (source.CheckListOfProperties != null && source.CheckListOfProperties.Count > 0)
            {
                List <CheckListOfProperty> checkList = new List <CheckListOfProperty>();
                foreach (var obj in source.CheckListOfProperties)
                {
                    var doc = new CheckListOfProperty();
                    UpdateCheckListFromModel(doc, obj);
                    checkList.Add(doc);
                }
                target.CheckListOfProperties = checkList;
            }

            if (source.PropertyCheckListVendors != null && source.PropertyCheckListVendors.Count > 0)
            {
                List <PropertyCheckListVendor> vendors = new List <PropertyCheckListVendor>();
                foreach (var obj in source.PropertyCheckListVendors)
                {
                    var doc = new PropertyCheckListVendor();
                    UpdateVendorFromModel(doc, obj);
                    vendors.Add(doc);
                }
                target.PropertyCheckListVendors = vendors;
            }
        }