Exemplo n.º 1
0
        public Collection<CAS_FeedbackDataVM> ConvertToFeedBackDataVM(CAS_ProductInfo model)
        {
            _cAS_FeedbackDataVMList = new Collection<CAS_FeedbackDataVM>();
            _cAS_FeedbackDataVM = new CAS_FeedbackDataVM();
            try
            {
                foreach (var item in model.CAS_FeedbackData)
                {
                    _cAS_FeedbackDataVM.Additional_Comments_Issues_Concerns_Suggestions = item.Additional_Comments_Issues_Concerns_Suggestions;
                    _cAS_FeedbackDataVM.Adherence_To_Schedule = item.Adherence_To_Schedule;
                    _cAS_FeedbackDataVM.Alternate_Solutions_Value_addition = item.Alternate_Solutions_Value_addition;
                    _cAS_FeedbackDataVM.CAS_ProdInfo_FK = item.CAS_ProdInfo_FK;
                    _cAS_FeedbackDataVM.CAS_ProductInfo = item.CAS_ProductInfo;
                    _cAS_FeedbackDataVM.CreatedAt = item.CreatedAt;
                    _cAS_FeedbackDataVM.CreatedBy = item.CreatedBy;
                    _cAS_FeedbackDataVM.Effectiveness_of_Communication = item.Effectiveness_of_Communication;
                    _cAS_FeedbackDataVM.Id = item.Id;
                    _cAS_FeedbackDataVM.Independent_project_execution_Customers_Efforts = item.Independent_project_execution_Customers_Efforts;
                    _cAS_FeedbackDataVM.IsActive = item.IsActive;
                    _cAS_FeedbackDataVM.IsDeleted = item.IsDeleted;
                    _cAS_FeedbackDataVM.Overall_Satisfaction = item.Overall_Satisfaction;
                    _cAS_FeedbackDataVM.Quality = item.Quality;
                    _cAS_FeedbackDataVM.Status = item.Status;
                    _cAS_FeedbackDataVM.UpdatedAt = item.UpdatedAt;
                    _cAS_FeedbackDataVM.UpdatedBy = item.UpdatedBy;

                    _cAS_FeedbackDataVMList.Add(_cAS_FeedbackDataVM);
                }
            }
            catch (Exception ex)
            {
                return _cAS_FeedbackDataVMList;
            }
            return _cAS_FeedbackDataVMList;
        }
Exemplo n.º 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public CAS_ProductInfoVM CreateProductData(CAS_ProductInfoVM model)
        {
            try
            {
                using (_db = new CFT_DBEntities())
                {
                    _cAS_ProductInfoVM = new CAS_ProductInfoVM();
                    CAS_ProductInfo productInfo = new CAS_ProductInfo();

                    productInfo.CAS_ProductId = model.CAS_ProductId;
                    productInfo.Business_Unit = model.Business_Unit;
                    productInfo.Project_Name = model.Project_Name;
                    productInfo.Customer_Name = model.Customer_Name;
                    productInfo.Customer_Email = model.Customer_Email;
                    productInfo.Customer_Phone = model.Customer_Phone;
                    productInfo.IEC_Contact = model.IEC_Contact;
                    productInfo.Project_Team = model.Project_Team;
                    productInfo.Function = model.Function;
                    productInfo.CreatedAt = model.CreatedAt;
                    productInfo.CreatedBy = model.CreatedBy;
                    productInfo.UpdateAt = model.UpdateAt;
                    productInfo.UpdateBy = model.UpdateBy;
                    productInfo.IsActive = model.IsActive;
                    productInfo.ISDeleted = model.ISDeleted;

                    productInfo.CAS_FeedbackData = GetCAS_FeedbackData(model);

                    _db.CAS_ProductInfo.Add(productInfo);
                    _db.SaveChanges();

                    _cAS_ProductInfoVM.Id = productInfo.Id;
                    return _cAS_ProductInfoVM;
                }
            }
            catch (Exception ex)
            {
                return _cAS_ProductInfoVM;
            }
        }