public CustomerFeedbackRes(CustomerFeedback entity, Customer customer)
 {
     Customer   = customer;
     Content    = entity.Content;
     CreatedAt  = entity.CreatedAt;
     CreatedBy  = entity.CreatedBy;
     Id         = entity.Id;
     IdCustomer = entity.IdCustomer;
     Rating     = entity.Rating;
     UpdatedAt  = entity.UpdatedAt;
     UpdatedBy  = entity.UpdatedBy;
 }
        public override List <BaseEntity> PopulateBusinessObjectFromReader(IDataReader dataReader)
        {
            var list = new List <BaseEntity>();

            _dicIndex = new Dictionary <string, int>();
            while (dataReader.Read())
            {
                var businessObject = new CustomerFeedback();
                PopulateBusinessObjectFromReader(businessObject, dataReader);
                list.Add(businessObject);
            }

            return(list);
        }
        //This method is used to get details of feedback
        // GET: CustomerFeedbacks/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CustomerFeedback customerFeedback = db.CustomerFeedbacks.Find(id);

            if (customerFeedback == null)
            {
                return(HttpNotFound());
            }
            return(View(customerFeedback));
        }
示例#4
0
        public async Task <IHttpActionResult> Post([FromBody] CustomerFeedback req)
        {
            try
            {
                string errorMessage = "UnknowError";
                string errorCode    = ErrorCodeEnum.UnknownError.ToString();


                #region Validate
                if (!Validate(req, out errorCode, out errorMessage))
                {
                    return(Ok(new RequestErrorCode(false, errorCode, errorMessage)));
                }
                #endregion

                #region Tạo key
                var oldKey = Memory.Memory.GetMaxKey(req.GetName());
                int newKey = oldKey + 1;
                // set key
                req.Id = newKey;
                #endregion

                #region Process
                req.CreatedAt = DateTime.Now;
                req.CreatedBy = 0;
                req.IsDeleted = 0;
                UpdateEntitySql updateEntitySql = new UpdateEntitySql();
                var             lstCommand      = new List <EntityCommand>();
                lstCommand.Add(new EntityCommand {
                    BaseEntity = new Entity.Entity(req), EntityAction = EntityAction.Insert
                });
                bool isOkDone = updateEntitySql.UpdateDefault(lstCommand);
                if (!isOkDone)
                {
                    return(Ok(new RequestErrorCode(false, errorCode, errorMessage)));
                }
                #endregion
                // update memory
                MemorySet.UpdateAndInsertEntity(req);
                var result = new RequestErrorCode(true);
                result.DataResult = req;
                return(Ok(result));
            }
            catch (Exception ex)
            {
                Logger.Write(ex.ToString());
            }
            return(BadRequest("Unknow"));
        }
        // GET: CustomerFeedbacks/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CustomerFeedback customerFeedback = db.CustomerFeedbacks.Find(id);

            if (customerFeedback == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CustomerID = new SelectList(db.Customers, "ID", "CustomerName", customerFeedback.CustomerID);
            return(View(customerFeedback));
        }
        internal static void SetMemory(CustomerFeedback objectValue)
        {
            string entityName = objectValue.GetName();

// chua co thi khoi tao
            if (!DicMaxKeyEntity.ContainsKey(entityName))
            {
                DicMaxKeyEntity[entityName] = 0;
            }
// co roi thi so sanh roi set max key vao dic
            if (DicMaxKeyEntity[entityName] < objectValue.Id)
            {
                DicMaxKeyEntity[entityName] = objectValue.Id;
            }
            DicCustomerFeedback[objectValue.Id] = objectValue;
        }
    protected void btnFeedback_Click(object sender, EventArgs e)
    {
        ////Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            int userid = Convert.ToInt32(Request.QueryString[0]);
            ObjCustomerfeedback = ObjCustomerfeedback.Get_By_Incidentid(userid);

            if (satisfiedrdbutton.Checked == true)
            {

                Feedback = "Satisfied";

            }
            if (verysatisfied.Checked == true)
            {
                Feedback = "Very Satisfied";
            }
            if (Rddisatisfied.Checked == true)
            {
                Feedback = "Dissatisfied";
            }
            if (Rdverydissatisfied.Checked == true)
            {
                Feedback = "Very Dissatisfied";
            }
            if (ObjCustomerfeedback.Id == 0)
            {
                ObjCustomerfeedback.Id = Convert.ToInt32(Request.QueryString[0]);
                ObjCustomerfeedback.Feedback = Feedback;
                ObjCustomerfeedback.Insert();
            }

            string myScript;
            myScript = "<script language=javascript></script>";
            myScript = "<script language=javascript>CloseWindow();</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            //ScriptManager.RegisterStartupScript(this, this.GetType(), "refreshParent();", "refreshParent();", true);
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
 public Customer_CustomerFeedbackDTO(CustomerFeedback CustomerFeedback)
 {
     this.Id = CustomerFeedback.Id;
     this.IsSystemCustomer       = CustomerFeedback.IsSystemCustomer;
     this.CustomerId             = CustomerFeedback.CustomerId;
     this.FullName               = CustomerFeedback.FullName;
     this.Email                  = CustomerFeedback.Email;
     this.PhoneNumber            = CustomerFeedback.PhoneNumber;
     this.CustomerFeedbackTypeId = CustomerFeedback.CustomerFeedbackTypeId;
     this.Title                  = CustomerFeedback.Title;
     this.SendDate               = CustomerFeedback.SendDate;
     this.Content                = CustomerFeedback.Content;
     this.StatusId               = CustomerFeedback.StatusId;
     this.CustomerFeedbackType   = CustomerFeedback.CustomerFeedbackType == null ? null : new Customer_CustomerFeedbackTypeDTO(CustomerFeedback.CustomerFeedbackType);
     this.Status                 = CustomerFeedback.Status == null ? null : new Customer_StatusDTO(CustomerFeedback.Status);
     this.Errors                 = CustomerFeedback.Errors;
 }
        public ActionResult Create([Bind(Include = "Id,CustomerName,CustomerImage,CustomerInfo,Feedback,ThuTu,IsActive,Created,LastModify")] CustomerFeedback customerFeedback, HttpPostedFileBase HinhAnh)
        {
            if (ModelState.IsValid)
            {
                var allowedExtensions = new[] {
                    ".Jpg", ".png", ".jpg", "jpeg"
                };
                if (HinhAnh == null)
                {
                    customerFeedback.CustomerImage = "NoImage.png";
                }
                else
                {
                    var fileName = Path.GetFileName(HinhAnh.FileName);

                    var ext = Path.GetExtension(HinhAnh.FileName);
                    if (allowedExtensions.Contains(ext))                             //check what type of extension
                    {
                        string name   = Path.GetFileNameWithoutExtension(fileName);  //getting file name without extension
                        string myfile = name + "_" + DateTime.Now.Millisecond + ext; //appending the name with id
                                                                                     // store the file inside ~/project folder(Img)

                        var path = Path.Combine(Server.MapPath(WebConstants.imgCusFeedback), myfile);
                        //var dir = Directory.CreateDirectory(path);
                        //HinhAnh.SaveAs(Path.Combine(path, myfile));

                        customerFeedback.CustomerImage = myfile;
                        HinhAnh.SaveAs(path);
                    }
                    else
                    {
                        ViewBag.message = "Please choose only Image file";
                    }
                }
                customerFeedback.Created    = DateTime.Now;
                customerFeedback.LastModify = DateTime.Now;
                db.CustomerFeedbacks.Add(customerFeedback);
                db.SaveChanges();
                Success(string.Format("Thêm mới Phản hồi thành công.", ""), true);
                return(RedirectToAction("Index", "CustomerFeedbacks"));
            }

            return(View(customerFeedback));
        }
    protected void btnFeedback_Click(object sender, EventArgs e)
    {////Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            int userid = Convert.ToInt32(Request.QueryString[0]);
            ObjCustomerfeedback = ObjCustomerfeedback.Get_By_Incidentid(userid);

            if (satisfiedrdbutton.Checked == true)
            {
                Feedback = "Satisfied";
            }
            if (verysatisfied.Checked == true)
            {
                Feedback = "Very Satisfied";
            }
            if (Rddisatisfied.Checked == true)
            {
                Feedback = "Dissatisfied";
            }
            if (Rdverydissatisfied.Checked == true)
            {
                Feedback = "Very Dissatisfied";
            }
            if (ObjCustomerfeedback.Id == 0)
            {
                ObjCustomerfeedback.Id       = Convert.ToInt32(Request.QueryString[0]);
                ObjCustomerfeedback.Feedback = Feedback;
                ObjCustomerfeedback.Insert();
            }

            string myScript;
            myScript = "<script language=javascript></script>";
            myScript = "<script language=javascript>CloseWindow();</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            //ScriptManager.RegisterStartupScript(this, this.GetType(), "refreshParent();", "refreshParent();", true);
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
示例#11
0
        public IActionResult OnGet(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Branch = _context.Branch.Find(id);

            if (Branch == null)
            {
                return(NotFound());
            }
            ViewData["OwnerId"]      = new SelectList(_context.Customer, "ID", "Customer_Name");
            FeedbackForm             = new CustomerFeedback();
            FeedbackForm.Branch_Name = Branch.Branch_Name;
            FeedbackForm.BranchId    = Branch.ID;
            return(Page());
        }
示例#12
0
        public async Task <ActionResult <CustomerFeedback_CustomerFeedbackDTO> > Get([FromBody] CustomerFeedback_CustomerFeedbackDTO CustomerFeedback_CustomerFeedbackDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            if (!await HasPermission(CustomerFeedback_CustomerFeedbackDTO.Id))
            {
                return(Forbid());
            }

            CustomerFeedback CustomerFeedback = await CustomerFeedbackService.Get(CustomerFeedback_CustomerFeedbackDTO.Id);

            return(new CustomerFeedback_CustomerFeedbackDTO(CustomerFeedback));
        }
        public async Task <bool> ValidateId(CustomerFeedback CustomerFeedback)
        {
            CustomerFeedbackFilter CustomerFeedbackFilter = new CustomerFeedbackFilter
            {
                Skip = 0,
                Take = 10,
                Id   = new IdFilter {
                    Equal = CustomerFeedback.Id
                },
                Selects = CustomerFeedbackSelect.Id
            };

            int count = await UOW.CustomerFeedbackRepository.Count(CustomerFeedbackFilter);

            if (count == 0)
            {
                CustomerFeedback.AddError(nameof(CustomerFeedbackValidator), nameof(CustomerFeedback.Id), ErrorCode.IdNotExisted);
            }
            return(count == 1);
        }
示例#14
0
        public async Task <CustomerFeedback> Delete(CustomerFeedback CustomerFeedback)
        {
            if (!await CustomerFeedbackValidator.Delete(CustomerFeedback))
            {
                return(CustomerFeedback);
            }

            try
            {
                await UOW.CustomerFeedbackRepository.Delete(CustomerFeedback);

                await Logging.CreateAuditLog(new { }, CustomerFeedback, nameof(CustomerFeedbackService));

                return(CustomerFeedback);
            }
            catch (Exception ex)
            {
                await Logging.CreateSystemLog(ex, nameof(CustomerFeedbackService));
            }
            return(null);
        }
示例#15
0
        public async Task <CustomerFeedback> Update(CustomerFeedback CustomerFeedback)
        {
            if (!await CustomerFeedbackValidator.Update(CustomerFeedback))
            {
                return(CustomerFeedback);
            }
            try
            {
                var oldData = await UOW.CustomerFeedbackRepository.Get(CustomerFeedback.Id);

                await UOW.CustomerFeedbackRepository.Update(CustomerFeedback);

                CustomerFeedback = await UOW.CustomerFeedbackRepository.Get(CustomerFeedback.Id);

                await Logging.CreateAuditLog(CustomerFeedback, oldData, nameof(CustomerFeedbackService));

                return(CustomerFeedback);
            }
            catch (Exception ex)
            {
                await Logging.CreateSystemLog(ex, nameof(CustomerFeedbackService));
            }
            return(null);
        }
示例#16
0
        private CustomerFeedback ConvertDTOToEntity(CustomerFeedback_CustomerFeedbackDTO CustomerFeedback_CustomerFeedbackDTO)
        {
            CustomerFeedback CustomerFeedback = new CustomerFeedback();

            CustomerFeedback.Id = CustomerFeedback_CustomerFeedbackDTO.Id;
            CustomerFeedback.IsSystemCustomer       = CustomerFeedback_CustomerFeedbackDTO.IsSystemCustomer;
            CustomerFeedback.CustomerId             = CustomerFeedback_CustomerFeedbackDTO.CustomerId;
            CustomerFeedback.FullName               = CustomerFeedback_CustomerFeedbackDTO.FullName;
            CustomerFeedback.Email                  = CustomerFeedback_CustomerFeedbackDTO.Email;
            CustomerFeedback.PhoneNumber            = CustomerFeedback_CustomerFeedbackDTO.PhoneNumber;
            CustomerFeedback.CustomerFeedbackTypeId = CustomerFeedback_CustomerFeedbackDTO.CustomerFeedbackTypeId;
            CustomerFeedback.Title                  = CustomerFeedback_CustomerFeedbackDTO.Title;
            CustomerFeedback.SendDate               = CustomerFeedback_CustomerFeedbackDTO.SendDate;
            CustomerFeedback.Content                = CustomerFeedback_CustomerFeedbackDTO.Content;
            CustomerFeedback.StatusId               = CustomerFeedback_CustomerFeedbackDTO.StatusId;
            CustomerFeedback.Customer               = CustomerFeedback_CustomerFeedbackDTO.Customer == null ? null : new Customer
            {
                Id                 = CustomerFeedback_CustomerFeedbackDTO.Customer.Id,
                Code               = CustomerFeedback_CustomerFeedbackDTO.Customer.Code,
                Name               = CustomerFeedback_CustomerFeedbackDTO.Customer.Name,
                Phone              = CustomerFeedback_CustomerFeedbackDTO.Customer.Phone,
                Address            = CustomerFeedback_CustomerFeedbackDTO.Customer.Address,
                NationId           = CustomerFeedback_CustomerFeedbackDTO.Customer.NationId,
                ProvinceId         = CustomerFeedback_CustomerFeedbackDTO.Customer.ProvinceId,
                DistrictId         = CustomerFeedback_CustomerFeedbackDTO.Customer.DistrictId,
                WardId             = CustomerFeedback_CustomerFeedbackDTO.Customer.WardId,
                CustomerTypeId     = CustomerFeedback_CustomerFeedbackDTO.Customer.CustomerTypeId,
                Birthday           = CustomerFeedback_CustomerFeedbackDTO.Customer.Birthday,
                Email              = CustomerFeedback_CustomerFeedbackDTO.Customer.Email,
                ProfessionId       = CustomerFeedback_CustomerFeedbackDTO.Customer.ProfessionId,
                CustomerResourceId = CustomerFeedback_CustomerFeedbackDTO.Customer.CustomerResourceId,
                SexId              = CustomerFeedback_CustomerFeedbackDTO.Customer.SexId,
                StatusId           = CustomerFeedback_CustomerFeedbackDTO.Customer.StatusId,
                CompanyId          = CustomerFeedback_CustomerFeedbackDTO.Customer.CompanyId,
                ParentCompanyId    = CustomerFeedback_CustomerFeedbackDTO.Customer.ParentCompanyId,
                TaxCode            = CustomerFeedback_CustomerFeedbackDTO.Customer.TaxCode,
                Fax                = CustomerFeedback_CustomerFeedbackDTO.Customer.Fax,
                Website            = CustomerFeedback_CustomerFeedbackDTO.Customer.Website,
                NumberOfEmployee   = CustomerFeedback_CustomerFeedbackDTO.Customer.NumberOfEmployee,
                BusinessTypeId     = CustomerFeedback_CustomerFeedbackDTO.Customer.BusinessTypeId,
                Investment         = CustomerFeedback_CustomerFeedbackDTO.Customer.Investment,
                RevenueAnnual      = CustomerFeedback_CustomerFeedbackDTO.Customer.RevenueAnnual,
                IsSupplier         = CustomerFeedback_CustomerFeedbackDTO.Customer.IsSupplier,
                Descreption        = CustomerFeedback_CustomerFeedbackDTO.Customer.Descreption,
                Used               = CustomerFeedback_CustomerFeedbackDTO.Customer.Used,
                RowId              = CustomerFeedback_CustomerFeedbackDTO.Customer.RowId,
            };
            CustomerFeedback.CustomerFeedbackType = CustomerFeedback_CustomerFeedbackDTO.CustomerFeedbackType == null ? null : new CustomerFeedbackType
            {
                Id   = CustomerFeedback_CustomerFeedbackDTO.CustomerFeedbackType.Id,
                Code = CustomerFeedback_CustomerFeedbackDTO.CustomerFeedbackType.Code,
                Name = CustomerFeedback_CustomerFeedbackDTO.CustomerFeedbackType.Name,
            };
            CustomerFeedback.Status = CustomerFeedback_CustomerFeedbackDTO.Status == null ? null : new Status
            {
                Id   = CustomerFeedback_CustomerFeedbackDTO.Status.Id,
                Code = CustomerFeedback_CustomerFeedbackDTO.Status.Code,
                Name = CustomerFeedback_CustomerFeedbackDTO.Status.Name,
            };
            CustomerFeedback.BaseLanguage = CurrentContext.Language;
            return(CustomerFeedback);
        }
示例#17
0
        public async Task <ActionResult> Import(IFormFile file)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }
            CustomerFilter CustomerFilter = new CustomerFilter
            {
                Skip    = 0,
                Take    = int.MaxValue,
                Selects = CustomerSelect.ALL
            };
            List <Customer> Customers = await CustomerService.List(CustomerFilter);

            CustomerFeedbackTypeFilter CustomerFeedbackTypeFilter = new CustomerFeedbackTypeFilter
            {
                Skip    = 0,
                Take    = int.MaxValue,
                Selects = CustomerFeedbackTypeSelect.ALL
            };
            List <CustomerFeedbackType> CustomerFeedbackTypes = await CustomerFeedbackTypeService.List(CustomerFeedbackTypeFilter);

            StatusFilter StatusFilter = new StatusFilter
            {
                Skip    = 0,
                Take    = int.MaxValue,
                Selects = StatusSelect.ALL
            };
            List <Status> Statuses = await StatusService.List(StatusFilter);

            List <CustomerFeedback> CustomerFeedbacks = new List <CustomerFeedback>();

            using (ExcelPackage excelPackage = new ExcelPackage(file.OpenReadStream()))
            {
                ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets.FirstOrDefault();
                if (worksheet == null)
                {
                    return(Ok(CustomerFeedbacks));
                }
                int StartColumn                  = 1;
                int StartRow                     = 1;
                int IdColumn                     = 0 + StartColumn;
                int IsSystemCustomerColumn       = 1 + StartColumn;
                int CustomerIdColumn             = 2 + StartColumn;
                int FullNameColumn               = 3 + StartColumn;
                int EmailColumn                  = 4 + StartColumn;
                int PhoneNumberColumn            = 5 + StartColumn;
                int CustomerFeedbackTypeIdColumn = 6 + StartColumn;
                int TitleColumn                  = 7 + StartColumn;
                int SendDateColumn               = 8 + StartColumn;
                int ContentColumn                = 9 + StartColumn;
                int StatusIdColumn               = 10 + StartColumn;

                for (int i = StartRow; i <= worksheet.Dimension.End.Row; i++)
                {
                    if (string.IsNullOrEmpty(worksheet.Cells[i + StartRow, StartColumn].Value?.ToString()))
                    {
                        break;
                    }
                    string IdValue = worksheet.Cells[i + StartRow, IdColumn].Value?.ToString();
                    string IsSystemCustomerValue       = worksheet.Cells[i + StartRow, IsSystemCustomerColumn].Value?.ToString();
                    string CustomerIdValue             = worksheet.Cells[i + StartRow, CustomerIdColumn].Value?.ToString();
                    string FullNameValue               = worksheet.Cells[i + StartRow, FullNameColumn].Value?.ToString();
                    string EmailValue                  = worksheet.Cells[i + StartRow, EmailColumn].Value?.ToString();
                    string PhoneNumberValue            = worksheet.Cells[i + StartRow, PhoneNumberColumn].Value?.ToString();
                    string CustomerFeedbackTypeIdValue = worksheet.Cells[i + StartRow, CustomerFeedbackTypeIdColumn].Value?.ToString();
                    string TitleValue                  = worksheet.Cells[i + StartRow, TitleColumn].Value?.ToString();
                    string SendDateValue               = worksheet.Cells[i + StartRow, SendDateColumn].Value?.ToString();
                    string ContentValue                = worksheet.Cells[i + StartRow, ContentColumn].Value?.ToString();
                    string StatusIdValue               = worksheet.Cells[i + StartRow, StatusIdColumn].Value?.ToString();

                    CustomerFeedback CustomerFeedback = new CustomerFeedback();
                    CustomerFeedback.FullName    = FullNameValue;
                    CustomerFeedback.Email       = EmailValue;
                    CustomerFeedback.PhoneNumber = PhoneNumberValue;
                    CustomerFeedback.Title       = TitleValue;
                    CustomerFeedback.SendDate    = DateTime.TryParse(SendDateValue, out DateTime SendDate) ? SendDate : DateTime.Now;
                    CustomerFeedback.Content     = ContentValue;
                    Customer Customer = Customers.Where(x => x.Id.ToString() == CustomerIdValue).FirstOrDefault();
                    CustomerFeedback.CustomerId = Customer == null ? 0 : Customer.Id;
                    CustomerFeedback.Customer   = Customer;
                    CustomerFeedbackType CustomerFeedbackType = CustomerFeedbackTypes.Where(x => x.Id.ToString() == CustomerFeedbackTypeIdValue).FirstOrDefault();
                    CustomerFeedback.CustomerFeedbackTypeId = CustomerFeedbackType == null ? 0 : CustomerFeedbackType.Id;
                    CustomerFeedback.CustomerFeedbackType   = CustomerFeedbackType;
                    Status Status = Statuses.Where(x => x.Id.ToString() == StatusIdValue).FirstOrDefault();
                    CustomerFeedback.StatusId = Status == null ? 0 : Status.Id;
                    CustomerFeedback.Status   = Status;

                    CustomerFeedbacks.Add(CustomerFeedback);
                }
            }
            CustomerFeedbacks = await CustomerFeedbackService.Import(CustomerFeedbacks);

            if (CustomerFeedbacks.All(x => x.IsValidated))
            {
                return(Ok(true));
            }
            else
            {
                List <string> Errors = new List <string>();
                for (int i = 0; i < CustomerFeedbacks.Count; i++)
                {
                    CustomerFeedback CustomerFeedback = CustomerFeedbacks[i];
                    if (!CustomerFeedback.IsValidated)
                    {
                        string Error = $"Dòng {i + 2} có lỗi:";
                        if (CustomerFeedback.Errors.ContainsKey(nameof(CustomerFeedback.Id)))
                        {
                            Error += CustomerFeedback.Errors[nameof(CustomerFeedback.Id)];
                        }
                        if (CustomerFeedback.Errors.ContainsKey(nameof(CustomerFeedback.IsSystemCustomer)))
                        {
                            Error += CustomerFeedback.Errors[nameof(CustomerFeedback.IsSystemCustomer)];
                        }
                        if (CustomerFeedback.Errors.ContainsKey(nameof(CustomerFeedback.CustomerId)))
                        {
                            Error += CustomerFeedback.Errors[nameof(CustomerFeedback.CustomerId)];
                        }
                        if (CustomerFeedback.Errors.ContainsKey(nameof(CustomerFeedback.FullName)))
                        {
                            Error += CustomerFeedback.Errors[nameof(CustomerFeedback.FullName)];
                        }
                        if (CustomerFeedback.Errors.ContainsKey(nameof(CustomerFeedback.Email)))
                        {
                            Error += CustomerFeedback.Errors[nameof(CustomerFeedback.Email)];
                        }
                        if (CustomerFeedback.Errors.ContainsKey(nameof(CustomerFeedback.PhoneNumber)))
                        {
                            Error += CustomerFeedback.Errors[nameof(CustomerFeedback.PhoneNumber)];
                        }
                        if (CustomerFeedback.Errors.ContainsKey(nameof(CustomerFeedback.CustomerFeedbackTypeId)))
                        {
                            Error += CustomerFeedback.Errors[nameof(CustomerFeedback.CustomerFeedbackTypeId)];
                        }
                        if (CustomerFeedback.Errors.ContainsKey(nameof(CustomerFeedback.Title)))
                        {
                            Error += CustomerFeedback.Errors[nameof(CustomerFeedback.Title)];
                        }
                        if (CustomerFeedback.Errors.ContainsKey(nameof(CustomerFeedback.SendDate)))
                        {
                            Error += CustomerFeedback.Errors[nameof(CustomerFeedback.SendDate)];
                        }
                        if (CustomerFeedback.Errors.ContainsKey(nameof(CustomerFeedback.Content)))
                        {
                            Error += CustomerFeedback.Errors[nameof(CustomerFeedback.Content)];
                        }
                        if (CustomerFeedback.Errors.ContainsKey(nameof(CustomerFeedback.StatusId)))
                        {
                            Error += CustomerFeedback.Errors[nameof(CustomerFeedback.StatusId)];
                        }
                        Errors.Add(Error);
                    }
                }
                return(BadRequest(Errors));
            }
        }
    protected void btnFeedback_Click(object sender, EventArgs e)
    {
        if (satisfiedrdbutton.Checked == false && verysatisfied.Checked == false && Rddisatisfied.Checked == false && Rdverydissatisfied.Checked == false)
        {
            Lblmsg.Visible = true;
            Lblmsg.Text = "Please select your feedback";
            return;
        }

        //if (satisfiedrdbutton.Checked == true && verysatisfied.Checked == true && Rddisatisfied.Checked == true && Rdverydissatisfied.Checked == true)
        //{
        //    Lblmsg0.Visible = true;
        //    Lblmsg0.Text = "Your feedback has been saved";
        //    return;
        //}

        int userid = Convert.ToInt16(Request.QueryString["userid"]);
        //////////////Added by lalit. capture querystring of callid in case when user gives
        //feedback by call
        if (Request.QueryString["Clid"] != null)
        {
            int callid = Convert.ToInt16(Request.QueryString["Clid"]);
            ObjCustomerfeedback = ObjCustomerfeedback.Get_By_Userid_ByIncidentId(userid, callid);
        }
        else
        {
            ObjCustomerfeedback = ObjCustomerfeedback.Get_By_Incidentid(userid);
        }

        if (satisfiedrdbutton.Checked == true)
        {
            Feedback = "Good";

        }
        if (verysatisfied.Checked == true)
        {
            Feedback = "Very Good";
        }
        if (Rddisatisfied.Checked == true)
        {
            Feedback = "Average";
        }
        if (Rdverydissatisfied.Checked == true)
        {
            Feedback = "Poor";
        }

        if (ObjCustomerfeedback.Id == 0)
        {
            ObjCustomerfeedback.Id = Convert.ToInt16(Request.QueryString["userid"]);
            ObjCustomerfeedback.Feedback = Feedback;
            if (Request.QueryString["Clid"] != null)
            {
                ObjCustomerfeedback.IncidentId = Convert.ToInt16(Request.QueryString["Clid"]);
                ObjCustomerfeedback.FeedbackType = "CallWise";
                ObjCustomerfeedback.Remark = TextRmk.Text;
                ObjCustomerfeedback.Insert_CallWise();

                Lblmsg0.Visible = true;
                Lblmsg0.Text = "Your Feedback Has Been Submitted";

                btnFeedback.Visible = false;
                satisfiedrdbutton.Visible = false;
                verysatisfied.Visible = false;
                Rddisatisfied.Visible = false;
                Rdverydissatisfied.Visible = false;
                TextRmk.Visible = false;
                labGood.Visible = false;
                labVeryGood.Visible = false;
                labAverage.Visible = false;
                labPoor.Visible = false;
                lblApproved.Visible = false;
                lblRemark.Visible = false;
            }
            else
            {
                ObjCustomerfeedback.FeedbackType = "Default";
                ObjCustomerfeedback.Remark = "Default";
                ObjCustomerfeedback.Insert();
            }
        }
        string myScript;
        myScript = "<script language=javascript></script>";
        myScript = "<script language=javascript>CloseWindow();</script>";
        Page.RegisterClientScriptBlock("MyScript", myScript);
        //ScriptManager.RegisterStartupScript(this, this.GetType(), "refreshParent();", "refreshParent();", true);
    }
示例#19
0
        public EntityBaseSql GetMyEntity(string entityName)
        {
            #region GetMyEntity
            if (entityName.Equals(Area.EntityName()))
            {
                return(new AreaSql());
            }
            if (entityName.Equals(Connection.EntityName()))
            {
                return(new ConnectionSql());
            }
            if (entityName.Equals(ConnectionStatus.EntityName()))
            {
                return(new ConnectionStatusSql());
            }
            if (entityName.Equals(ConnectionType.EntityName()))
            {
                return(new ConnectionTypeSql());
            }
            if (entityName.Equals(Contract.EntityName()))
            {
                return(new ContractSql());
            }
            if (entityName.Equals(ContractStatus.EntityName()))
            {
                return(new ContractStatusSql());
            }
            if (entityName.Equals(Customer.EntityName()))
            {
                return(new CustomerSql());
            }
            if (entityName.Equals(CustomerFeedback.EntityName()))
            {
                return(new CustomerFeedbackSql());
            }
            if (entityName.Equals(DetailImportReceipt.EntityName()))
            {
                return(new DetailImportReceiptSql());
            }
            if (entityName.Equals(Device.EntityName()))
            {
                return(new DeviceSql());
            }
            if (entityName.Equals(DeviceType.EntityName()))
            {
                return(new DeviceTypeSql());
            }
            if (entityName.Equals(Employee.EntityName()))
            {
                return(new EmployeeSql());
            }
            if (entityName.Equals(Fee.EntityName()))
            {
                return(new FeeSql());
            }
            if (entityName.Equals(Image.EntityName()))
            {
                return(new ImageSql());
            }
            if (entityName.Equals(ImportReceipt.EntityName()))
            {
                return(new ImportReceiptSql());
            }
            if (entityName.Equals(Manufacturer.EntityName()))
            {
                return(new ManufacturerSql());
            }
            if (entityName.Equals(Payment.EntityName()))
            {
                return(new PaymentSql());
            }
            if (entityName.Equals(PaymentFee.EntityName()))
            {
                return(new PaymentFeeSql());
            }
            if (entityName.Equals(Provider.EntityName()))
            {
                return(new ProviderSql());
            }
            if (entityName.Equals(ServiceForm.EntityName()))
            {
                return(new ServiceFormSql());
            }
            if (entityName.Equals(ServiceFormStatus.EntityName()))
            {
                return(new ServiceFormStatusSql());
            }
            if (entityName.Equals(ServicePack.EntityName()))
            {
                return(new ServicePackSql());
            }
            if (entityName.Equals(ServicePackFee.EntityName()))
            {
                return(new ServicePackFeeSql());
            }
            if (entityName.Equals(Store.EntityName()))
            {
                return(new StoreSql());
            }

            #endregion

            Console.WriteLine(entityName);

            return(null);
        }
示例#20
0
        public async Task <IHttpActionResult> Put(int id, [FromBody] CustomerFeedback req)
        {
            try
            {
                string errorMessage = "UnknowError";
                string errorCode    = ErrorCodeEnum.UnknownError.ToString();
                #region token
                var header = Request.Headers;
                if (header.Authorization == null)
                {
                    return(StatusCode(HttpStatusCode.Unauthorized));
                }
                var      token = header.Authorization.Parameter;
                Employee employee;
                if (string.IsNullOrWhiteSpace(token) || !TokenManager.ValidateToken(token, out employee))
                {
                    return(StatusCode(HttpStatusCode.Unauthorized));
                }
                #endregion
                if (!Operator.IsAdmin(employee))
                {
                    return(Ok(new RequestErrorCode(false, ErrorCodeEnum.Error_NotHavePermision.ToString(), "Khong co quyen")));
                }

                #region Validate
                if (!ValidateUpdate(req, out errorCode, out errorMessage))
                {
                    return(Ok(new RequestErrorCode(false, errorCode, errorMessage)));
                }
                #endregion

                #region Check exist
                var obj = MemoryInfo.GetCustomerFeedback(id);
                if (obj == null)
                {
                    return(Ok(new RequestErrorCode(false, ErrorCodeEnum.DataNotExist.ToString(), "Khong ton tai")));
                }
                #endregion
                req.Id = obj.Id;                 // gan lai id de update
                #region Process
                req.UpdatedAt = DateTime.Now;
                req.UpdatedBy = employee.Id;
                UpdateEntitySql updateEntitySql = new UpdateEntitySql();
                var             lstCommand      = new List <EntityCommand>();
                lstCommand.Add(new EntityCommand {
                    BaseEntity = new Entity.Entity(req), EntityAction = EntityAction.Update
                });
                bool isOkDone = updateEntitySql.UpdateDefault(lstCommand);
                if (!isOkDone)
                {
                    return(Ok(new RequestErrorCode(false, errorCode, errorMessage)));
                }
                #endregion
                // update memory
                MemorySet.UpdateAndInsertEntity(req);
                var result = new RequestErrorCode(true);
                result.DataResult = req;
                return(Ok(result));
            }
            catch (Exception ex)
            {
                Logger.Write(ex.ToString());
            }
            return(BadRequest("Unknow"));
        }
        internal void PopulateBusinessObjectFromReader(CustomerFeedback businessObject, IDataReader dataReader)
        {
            if (_dicIndex.Count == 0)
            {
                FillDicIndex(dataReader);
            }

            if (GetIndex(CustomerFeedback.CustomerFeedbackFields.Content.ToString()) != -1)
            {
                businessObject.Content = dataReader.GetString(GetIndex(CustomerFeedback.CustomerFeedbackFields.Content.ToString()));
            }

            if (GetIndex(CustomerFeedback.CustomerFeedbackFields.CreatedAt.ToString()) != -1)
            {
                if (!dataReader.IsDBNull(GetIndex(CustomerFeedback.CustomerFeedbackFields.CreatedAt.ToString())))
                {
                    businessObject.CreatedAt = dataReader.GetDateTime(GetIndex(CustomerFeedback.CustomerFeedbackFields.CreatedAt.ToString()));
                }
            }

            if (GetIndex(CustomerFeedback.CustomerFeedbackFields.CreatedBy.ToString()) != -1)
            {
                if (!dataReader.IsDBNull(GetIndex(CustomerFeedback.CustomerFeedbackFields.CreatedBy.ToString())))
                {
                    businessObject.CreatedBy = dataReader.GetInt32(GetIndex(CustomerFeedback.CustomerFeedbackFields.CreatedBy.ToString()));
                }
            }

            businessObject.Id = dataReader.GetInt32(GetIndex(CustomerFeedback.CustomerFeedbackFields.Id.ToString()));

            if (GetIndex(CustomerFeedback.CustomerFeedbackFields.IdCustomer.ToString()) != -1)
            {
                businessObject.IdCustomer = dataReader.GetInt32(GetIndex(CustomerFeedback.CustomerFeedbackFields.IdCustomer.ToString()));
            }

            if (GetIndex(CustomerFeedback.CustomerFeedbackFields.IsDeleted.ToString()) != -1)
            {
                if (!dataReader.IsDBNull(GetIndex(CustomerFeedback.CustomerFeedbackFields.IsDeleted.ToString())))
                {
                    businessObject.IsDeleted = dataReader.GetInt32(GetIndex(CustomerFeedback.CustomerFeedbackFields.IsDeleted.ToString()));
                }
            }

            if (GetIndex(CustomerFeedback.CustomerFeedbackFields.Rating.ToString()) != -1)
            {
                if (!dataReader.IsDBNull(GetIndex(CustomerFeedback.CustomerFeedbackFields.Rating.ToString())))
                {
                    businessObject.Rating = dataReader.GetInt32(GetIndex(CustomerFeedback.CustomerFeedbackFields.Rating.ToString()));
                }
            }

            if (GetIndex(CustomerFeedback.CustomerFeedbackFields.UpdatedAt.ToString()) != -1)
            {
                if (!dataReader.IsDBNull(GetIndex(CustomerFeedback.CustomerFeedbackFields.UpdatedAt.ToString())))
                {
                    businessObject.UpdatedAt = dataReader.GetDateTime(GetIndex(CustomerFeedback.CustomerFeedbackFields.UpdatedAt.ToString()));
                }
            }

            if (GetIndex(CustomerFeedback.CustomerFeedbackFields.UpdatedBy.ToString()) != -1)
            {
                if (!dataReader.IsDBNull(GetIndex(CustomerFeedback.CustomerFeedbackFields.UpdatedBy.ToString())))
                {
                    businessObject.UpdatedBy = dataReader.GetInt32(GetIndex(CustomerFeedback.CustomerFeedbackFields.UpdatedBy.ToString()));
                }
            }
        }
示例#22
0
        public string UpdateCustomerFeedback([FromBody] CustomerFeedback feedback)
        {
            CustOrderDAL orderDAL = new CustOrderDAL();

            return(orderDAL.UpdateCustomerFeedback(feedback));
        }
 protected void GetRemark(int userID, int IncidentID)
 {
     CustomerFeedback ObjCustomerfeedback = new CustomerFeedback();
     ObjCustomerfeedback = ObjCustomerfeedback.Get_By_Userid_ByIncidentId(userID, IncidentID);
     TextRmk.Text=ObjCustomerfeedback.Remark;
     if (TextRmk.Text != "")
     {
         Rmk.Visible = true;
     }
     string Feedback = ObjCustomerfeedback.Feedback;
     if (Feedback == "Good")
     {
         satisfiedrdbutton.Checked = true;
     }
     else if (Feedback == "Very Good")
     {
         verysatisfied.Checked = true;
     }
     else if (Feedback == "Average")
     {
         Rddisatisfied.Checked = true;
     }
     else if (Feedback == "Poor")
     {
         Rdverydissatisfied.Checked = true;
     }
 }
 private async Task SaveReference(CustomerFeedback CustomerFeedback)
 {
 }
 //added by lalit
 public int Insert_CustomerFeedback_mst_callwise(CustomerFeedback ObjCustomerFeedback)
 {
     return (int)ExecuteNonQuery(Sp_CustomerFeedback_Insert_mst_callwise, new object[] { ObjCustomerFeedback.Id, ObjCustomerFeedback.Feedback, ObjCustomerFeedback.IncidentId, ObjCustomerFeedback.Remark, ObjCustomerFeedback.FeedbackType });
 }
 public int Insert_CustomerFeedback_mst(CustomerFeedback ObjCustomerFeedback)
 {
     return (int)ExecuteNonQuery(Sp_CustomerFeedback_Insert, new object[] { ObjCustomerFeedback.Id, ObjCustomerFeedback.Feedback });
 }
 public object GenerateCustomerFeedback_incidentid_mstObject_Usermst(ref IDataReader returnData)
 {
     CustomerFeedback Obj = new CustomerFeedback();
     while (returnData.Read())
     {
         Obj.Id = (int)returnData["ID"];
         Obj.Feedback = (string)returnData["Feedback"];
         Obj.IncidentId = (int)returnData["incidentid"];
         Obj.Remark = (string)returnData["Remark"];
        }
     returnData.Close();
     returnData.Dispose();
     return Obj;
 }
示例#28
0
        public async Task <Warranty> GetComplaintById(string complaintId)
        {
            var resultSet = await this._newWarranty.GetComplaintById(complaintId);

            Warranty warranty = new Warranty();

            try
            {
                if (resultSet != null && resultSet[0] != null)
                {
                    foreach (var result in resultSet[0])
                    {
                        warranty.StatusReportID = result.Status_Report_ID;
                        ContactDetails contactDetails = new ContactDetails();
                        contactDetails.Title      = result.Contact_Person_Honourific;
                        contactDetails.FirstName  = result.Contact_Person_First_Name;
                        contactDetails.LastName   = result.Contact_Person_Surname;
                        contactDetails.JobTitle   = result.Contact_Person_Job_Title;
                        contactDetails.TelNo      = result.Telephone_No;
                        contactDetails.MobNo      = result.Mobile_No;
                        contactDetails.Ext        = result.Extension;
                        contactDetails.Email      = result.Email_Address;
                        contactDetails.Department = result.Department;

                        ReceiptDetails receiptDetails = new ReceiptDetails();
                        receiptDetails.DateOfEvent  = result.Event_Date == null ? string.Empty : result.Event_Date.ToString("MM/dd/yyyy");
                        receiptDetails.DateReceived = result.Received_Date == null ? string.Empty : result.Received_Date.ToString("MM/dd/yyyy");
                        //receiptDetails.DateClosed =
                        receiptDetails.DateLogged      = result.Logged_Date == null ? string.Empty : result.Logged_Date.ToString("MM/dd/yyyy");
                        receiptDetails.TimeLogged      = result.Logged_Time == null ? string.Empty : Convert.ToString(result.Logged_Time);
                        receiptDetails.RecipientID     = result.Recipient_Employee_ID;
                        receiptDetails.LoggedByID      = result.Logged_Employee_ID;
                        receiptDetails.ManagerID       = result.Manager_Employee_ID;
                        receiptDetails.AccountName     = result.Account_Name;
                        receiptDetails.AccountSAP      = result.Account_Ref;
                        receiptDetails.Opera           = result.Opera_Code;
                        receiptDetails.AccountAddress1 = result.Account_Address_1;
                        receiptDetails.AccountAddress2 = result.Account_Address_2;
                        receiptDetails.City            = result.Town_City;
                        receiptDetails.Postal          = result.Post_Code;

                        WarrantyComplaint warrantyComplaint = new WarrantyComplaint();
                        warrantyComplaint.Email       = result.Format_Complaint_Email_Flag == null ? false : Convert.ToBoolean(result.Format_Complaint_Email_Flag);
                        warrantyComplaint.Phone       = result.Format_Complaint_Phone_Flag == null ? false : Convert.ToBoolean(result.Format_Complaint_Phone_Flag);
                        warrantyComplaint.Postal      = result.Format_Complaint_Postal_Flag == null ? false : Convert.ToBoolean(result.Format_Complaint_Postal_Flag);
                        warrantyComplaint.InPerson    = result.Format_Complaint_Person_Flag == null ? false : Convert.ToBoolean(result.Format_Complaint_Person_Flag);
                        warrantyComplaint.SocialMedia = result.Format_Complaint_Social_Media_Flag == null ? false : Convert.ToBoolean(result.Format_Complaint_Social_Media_Flag);
                        warrantyComplaint.WCC         = result.Complaint_Category_ID;
                        warrantyComplaint.IWRT        = result.Warranty_Return_Transfer_Flag == null ? false : Convert.ToBoolean(result.Warranty_Return_Transfer_Flag);
                        warrantyComplaint.Identity    = result.Product_Identity_Flag == null ? false : Convert.ToBoolean(result.Product_Identity_Flag);
                        warrantyComplaint.Quality     = result.Product_Quality_Flag == null ? false : Convert.ToBoolean(result.Product_Quality_Flag);
                        warrantyComplaint.Durability  = result.Product_Durability_Flag == null ? false : Convert.ToBoolean(result.Product_Durability_Flag);
                        warrantyComplaint.Reliability = result.Product_Reliability_Flag == null ? false : Convert.ToBoolean(result.Product_Reliability_Flag);
                        warrantyComplaint.Usability   = result.Product_Usability_Flag == null ? false : Convert.ToBoolean(result.Product_Usability_Flag);
                        warrantyComplaint.Safety      = result.Product_Safety_Flag == null ? false : Convert.ToBoolean(result.Product_Safety_Flag);
                        warrantyComplaint.Performance = result.Product_Performance_Flag == null ? false : Convert.ToBoolean(result.Product_Performance_Flag);
                        warrantyComplaint.DWC         = result.Summary_Complaint;
                        warrantyComplaint.Human       = result.Account_Type_Human_Flag == null ? false : Convert.ToBoolean(result.Account_Type_Human_Flag);
                        warrantyComplaint.Industrial  = result.Account_Type_Industrial_Flag == null ? false : Convert.ToBoolean(result.Account_Type_Industrial_Flag);
                        warrantyComplaint.Vet         = result.Account_Type_Veterinary_Flag;
                        warrantyComplaint.OPS         = result.Other_Please_Specify;
                        warrantyComplaint.WRTF        = result.Warranty_Return_Transfer_Yes;

                        warranty.ItemReceived           = result.Item_Received_Flag == null ? false : Convert.ToBoolean(result.Item_Received_Flag);
                        warranty.ItemRetainedByCustomer = result.Item_Retained_Flag == null ? false : Convert.ToBoolean(result.Item_Retained_Flag);
                        warranty.RepairReplaceFOC       = result.Repair_Replace_FOC_Flag == null ? false : Convert.ToBoolean(result.Repair_Replace_FOC_Flag);
                        warranty.ReportRequested        = result.Report_Flag == null ? false : Convert.ToBoolean(result.Report_Flag);


                        warranty.contactDetails    = contactDetails;
                        warranty.receiptDetails    = receiptDetails;
                        warranty.warrantyComplaint = warrantyComplaint;
                    }
                }

                if (resultSet != null && resultSet.Count >= 1 && resultSet[1] != null)
                {
                    var result = resultSet[1];

                    warranty.productDetails = new List <ProductDetails>();
                    foreach (var data in result)
                    {
                        ProductDetails productDetails = new ProductDetails();
                        productDetails.ProdID             = data.Item_Detail_ID;
                        productDetails.OurRef             = data.Our_Ref_No;
                        productDetails.OurPONo            = data.Our_PO_No;
                        productDetails.MFGComplaintID     = data.MFG_Complaint;
                        productDetails.DeviceProductCode  = data.Device_Product_Code;
                        productDetails.Description        = data.Description;
                        productDetails.Quantity           = Convert.ToString(data.Quantity);
                        productDetails.SerialNo           = data.Serial_No;
                        productDetails.LotNo              = data.Batch_No;
                        productDetails.ManufacturerStatus = data.Outcome;
                        productDetails.Cost        = Convert.ToString(data.Cost_GBP);
                        productDetails.Loan        = data.Loan_Issued_Flag;
                        productDetails.ResultUK    = data.Granted_Resut;
                        productDetails.Category    = data.Category;
                        productDetails.Discipline  = data.Discipline;
                        productDetails.SubCategory = data.Sub_Category;
                        warranty.productDetails.Add(productDetails);
                    }
                    //warranty.productDetails.Add(listProductDetails);
                }
                if (resultSet != null && resultSet.Count >= 2 && resultSet[2] != null)
                {
                    var result = resultSet[2];

                    warranty.componentDetails = new List <ComponentDetails>();
                    foreach (var data in result)
                    {
                        ComponentDetails componentDetails = new ComponentDetails();
                        componentDetails.ComponentID = data.Component_Detail_ID;
                        componentDetails.ComponentNo = data.Component_No;
                        componentDetails.Unit        = Convert.ToString(data.Unit);
                        componentDetails.DChl        = data.SAP_Distribution_Channel;
                        componentDetails.GBP         = Convert.ToString(data.Cost_GBP);
                        componentDetails.MainSFC     = data.Main_SFC;
                        componentDetails.Description = data.Description;
                        warranty.componentDetails.Add(componentDetails);
                    }
                }
                if (resultSet != null && resultSet.Count >= 3 && resultSet[3] != null)
                {
                    foreach (var result in resultSet[3])
                    {
                        AdverseIncident adverseIncident = new AdverseIncident();
                        adverseIncident.AIStatus         = Convert.ToString(result.Status_Report_ID);
                        adverseIncident.MHRAID           = Convert.ToString(result.MHRA_ID);
                        adverseIncident.AIDateOfEvent    = result.Event_Date == null ? null : result.Event_Date.ToString("MM/dd/yyyy");
                        adverseIncident.AIDateReceived   = result.Received_Date == null ? null : result.Received_Date.ToString("MM/dd/yyyy");
                        adverseIncident.HAEO             = result.Has_Event_Occurred_Flag == null ? false : Convert.ToBoolean(result.Has_Event_Occurred_Flag);
                        adverseIncident.HSER15           = result.Death_Injury_Flag == null ? false : Convert.ToBoolean(result.Death_Injury_Flag);
                        adverseIncident.AIDateToReportBy = Convert.ToString(result.Days_Event_Report);
                        adverseIncident.HSER10           = result.Could_Death_Injury_Flag == null ? false : Convert.ToBoolean(result.Could_Death_Injury_Flag);
                        adverseIncident.DID               = result.Details_Death_Injury;
                        adverseIncident.IDS               = result.Karl_Storz_Device_Flag == null ? false : Convert.ToBoolean(result.Karl_Storz_Device_Flag);
                        adverseIncident.DMITE             = result.Incident_Email_Date == null ? null : result.Incident_Email_Date.ToString("MM/dd/yyyy");
                        adverseIncident.MfgComplaintID    = result.KST_Complaint;
                        adverseIncident.Manugacturer      = result.Manufacturer_ID;
                        adverseIncident.AICM              = result.Criteria_Met_Flag == null ? false : Convert.ToBoolean(result.Criteria_Met_Flag);
                        adverseIncident.WIRBYUM           = result.Reported_MHRA_User_Flag == null ? false : Convert.ToBoolean(result.Reported_MHRA_User_Flag);
                        adverseIncident.DURTM             = result.MHRA_Reported_User_Date == null ? null : result.MHRA_Reported_User_Date.ToString("MM/dd/yyyy");
                        adverseIncident.WIRBKTMNo         = result.Reported_MHRA_KSEUK_No_Flag == null ? false : Convert.ToBoolean(result.Reported_MHRA_KSEUK_No_Flag);
                        adverseIncident.WIRBKTMYes        = result.Reported_MHRA_KSEUK_Flag == null ? false : Convert.ToBoolean(result.Reported_MHRA_KSEUK_Flag);
                        adverseIncident.DKRTMHRA          = result.MHRA_Reported_Date == null ? null : result.MHRA_Reported_Date.ToString("MM/dd/yyyy");
                        adverseIncident.KSEUKMHRARef      = result.MHRA_Ref;
                        adverseIncident.CustomerMHRARef   = result.Customer_MHRA_Ref;
                        adverseIncident.DateAckSentToMHRA = result.KSEUK_Ack_MHRA_Date == null ? null : result.KSEUK_Ack_MHRA_Date.ToString("MM/dd/yyyy");
                        adverseIncident.DateNextReportDue = result.Report_Received_KST_Date == null ? null : result.Report_Received_KST_Date.ToString("MM/dd/yyyy");
                        adverseIncident.MRtoMHRA          = result.Mfg_Report_MHRA_Flag == null ? false : Convert.ToBoolean(result.Mfg_Report_MHRA_Flag);
                        adverseIncident.NtbRtMHRA         = result.Mfg_Not_Report_MHRA_Flag == null ? false : Convert.ToBoolean(result.Mfg_Not_Report_MHRA_Flag);
                        adverseIncident.InvestOutcome     = result.Investigation_Outcome;
                        adverseIncident.AIComments        = result.MHRA_Comments;
                        adverseIncident.DateRepSentToMHRA = result.Report_Sent_MHRA_Date == null ? null : result.Report_Sent_MHRA_Date.ToString("MM/dd/yyyy");
                        adverseIncident.DCLRFMHRA         = result.Closing_Letter_Received_MHRA_Date == null ? null : result.Closing_Letter_Received_MHRA_Date.ToString("MM/dd/yyyy");
                        adverseIncident.NotMHRA           = result.Mfg_NoMHRA_Report_Why;
                        adverseIncident.DateFMRR          = result.Next_Report_MFG_Date == null ? null : result.Next_Report_MFG_Date.ToString("MM/dd/yyyy");
                        warranty.adverseIncident          = adverseIncident;
                    }
                }
                if (resultSet != null && resultSet.Count >= 4 && resultSet[4] != null)
                {
                    foreach (var result in resultSet[4])
                    {
                        Acknowledgement acknowledgement = new Acknowledgement();
                        acknowledgement.AckStatus         = Convert.ToString(result.Status_Report_ID);
                        acknowledgement.DCReceived        = result.Received_Date == null ? null : result.Received_Date.ToString("MM/dd/yyyy");
                        acknowledgement.DASTC             = result.Customer_Acknowledgement_Date == null ? null : result.Customer_Acknowledgement_Date.ToString("MM/dd/yyyy");
                        acknowledgement.MethodOfAck       = Convert.ToString(result.Acknowledgement_Method_ID);
                        acknowledgement.AckBy             = Convert.ToString(result.Ack_Sent_By_ID);
                        acknowledgement.WrittenAck        = result.Written_Acknowledgement_Flag == null ? false : Convert.ToBoolean(result.Written_Acknowledgement_Flag);
                        acknowledgement.DWAS              = result.Acknowledgement_Sent_Date == null ? null : result.Acknowledgement_Sent_Date.ToString("MM/dd/yyyy");
                        acknowledgement.AckAAR            = result.Action_Required;
                        acknowledgement.AcknowledgementID = Convert.ToString(result.Acknowledgement_ID);
                        warranty.acknowledgement          = acknowledgement;
                    }
                }
                if (resultSet != null && resultSet.Count >= 5 && resultSet[5] != null)
                {
                    foreach (var result in resultSet[5])
                    {
                        InvestigateNEvaluate investigateNEvaluate = new InvestigateNEvaluate();
                        investigateNEvaluate.IEID        = result.Investigation_Evaluation_ID;
                        investigateNEvaluate.ComplaintID = Convert.ToString(result.Complaint_ID);
                        investigateNEvaluate.SCOTC       = result.Suspected_Cause;
                        investigateNEvaluate.KSEUK       = result.KSEUK_Investigation_Flag;
                        investigateNEvaluate.InvestigationManufacturer = result.Manufacturer_Investigation_Flag;
                        investigateNEvaluate.InvestOther                  = result.Other_Investigation_Flag;
                        investigateNEvaluate.IDDesc                       = result.Investigation_Required;
                        investigateNEvaluate.RRFOC                        = result.Repair_Replace_FOC_Flag;
                        investigateNEvaluate.ReportRequest                = result.Report_Requested_Flag;
                        investigateNEvaluate.OtherProvideDetails          = result.Other_Investigation_Results_Flag;
                        investigateNEvaluate.IRDesc                       = result.Investigation_Results;
                        investigateNEvaluate.WarrantyAccepted             = result.Warranty_Accepted_Flag;
                        investigateNEvaluate.WarrantyRejected             = result.Warranty_Rejected_Quote_Flag;
                        investigateNEvaluate.WarrantyRejectedFairtrade    = result.Warranty_Rejected_Fairtrade_Flag;
                        investigateNEvaluate.EP1AuditOff                  = result.EP1_Audit_Offered_Flag;
                        investigateNEvaluate.TrainingOffered              = result.Training_Offered_Flag;
                        investigateNEvaluate.TrainingOffered              = result.Advise_IFUS_Website_Flag;
                        investigateNEvaluate.IEOtherProvideDetails        = result.Solution_Other_Flag;
                        investigateNEvaluate.SSDesc                       = result.Other_Solution;
                        investigateNEvaluate.CEDesc                       = result.Customer_Expectations;
                        investigateNEvaluate.CustomerSolution             = result.Stakeholder_Customer_Flag;
                        investigateNEvaluate.KSEUKSolution                = result.Stakeholder_KSEUK_Flag;
                        investigateNEvaluate.ManufacturerSolution         = result.Stakeholder_Manufacturer_Flag;
                        investigateNEvaluate.RegulatoryComplianceSolution = result.Regulatory_Compliance_Flag;
                        investigateNEvaluate.CAPARequired                 = result.CAPA_Required_Flag;
                        investigateNEvaluate.IEStatus                     = Convert.ToString(result.Status_Report_ID);
                        investigateNEvaluate.DateQuote                    = result.Quote_Issued_Date == null ? null : result.Quote_Issued_Date.ToString("MM/dd/yyyy");
                        investigateNEvaluate.SAPRef                       = result.SAP_Quote_Ref;
                        warranty.investigateNEvaluate                     = investigateNEvaluate;
                    }
                }
                if (resultSet != null && resultSet.Count >= 6 && resultSet[6] != null)
                {
                    foreach (var result in resultSet[6])
                    {
                        RiskAssessment riskAssessment = new RiskAssessment();
                        riskAssessment.RAID                      = result.Risk_Assessment_ID;
                        riskAssessment.RAStatus                  = Convert.ToString(result.Status_Report_ID);
                        riskAssessment.DateofRiskAssess          = result.RA_Completed_Date == null ? null : result.RA_Completed_Date.ToString("MM/dd/yyyy");
                        riskAssessment.RiskAssessmentCompletedBy = Convert.ToString(result.RA_Completed_By_ID);
                        riskAssessment.RiskAssessmentMatrix      = Convert.ToString(result.Risk_Assessment_Matrix);
                        riskAssessment.Severity                  = Convert.ToString(result.Probability_Number);
                        riskAssessment.Occurrence                = Convert.ToString(result.Consequence_Number);
                        riskAssessment.Detection                 = Convert.ToString(result.Detection_Number);
                        riskAssessment.Score                     = Convert.ToString(result.Risk_Assessment_Score);
                        riskAssessment.RiskAssessmentColor       = result.RA_Colour;
                        riskAssessment.RAJ      = result.RA_Justification;
                        warranty.riskAssessment = riskAssessment;
                    }
                }
                if (resultSet != null && resultSet.Count >= 7 && resultSet[7] != null)
                {
                    foreach (var result in resultSet[7])
                    {
                        ComplaintRespToCustomer complaintRespToCustomer = new ComplaintRespToCustomer();
                        complaintRespToCustomer.RespondID           = result.Respond_ID;
                        complaintRespToCustomer.CRTCStatus          = Convert.ToString(result.Status_Report_ID);
                        complaintRespToCustomer.DateResponded       = result.Responded_Date == null ? null : result.Responded_Date.ToString("MM/dd/yyyy");;
                        complaintRespToCustomer.PersonResponding    = Convert.ToString(result.Response_Person_Who_ID);
                        complaintRespToCustomer.WarrantyLetter      = result.Responding_Warranty_Letter_Flag;
                        complaintRespToCustomer.CustomerExplanation = result.Customer_Explanation;
                        warranty.complaintRespToCustomer            = complaintRespToCustomer;
                    }
                }
                if (resultSet != null && resultSet.Count >= 8 && resultSet[8] != null)
                {
                    foreach (var result in resultSet[8])
                    {
                        ComplaintClosure complaintClosure = new ComplaintClosure();
                        complaintClosure.CCID               = result.Customer_Closure_ID;
                        complaintClosure.CCStatus           = Convert.ToString(result.Status_Report_ID);
                        complaintClosure.CustomerClosure    = result.Closure_Customer_Flag;
                        complaintClosure.DateOfClosure      = result.Closure_Method_Date == null ? null : result.Closure_Method_Date.ToString("MM/dd/yyyy");
                        complaintClosure.MethodClosureEmail = Convert.ToString(result.Closure_Method_ID);
                        complaintClosure.KSEUKClosure       = result.Closure_KSEUK_Flag;
                        complaintClosure.MHRAClosure        = result.Closure_MHRA_Flag;
                        complaintClosure.FADR               = result.Any_Other_Docs;
                        complaintClosure.AFR = result.Any_Followup_Required;
                        complaintClosure.DateComplaintReviewed      = result.Reviewed_Date == null ? null : result.Reviewed_Date.ToString("MM/dd/yyyy");
                        complaintClosure.ComplaintReviewedBy        = Convert.ToString(result.Complaint_Reviewer_ID);
                        complaintClosure.ComplaintReviewedCompleted = result.Complaint_Reviewed_Flag;
                        complaintClosure.DateComplaintClosed        = result.CClosed_Date == null ? null : result.CClosed_Date.ToString("MM/dd/yyyy");
                        complaintClosure.ComplaintClosedBy          = Convert.ToString(result.Person_Closed_Complaint_ID);
                        complaintClosure.ComplaintClosed            = result.Lock_Stage_Closure_Flag;
                        warranty.complaintClosure = complaintClosure;
                    }
                }
                if (resultSet != null && resultSet.Count >= 9 && resultSet[9] != null)
                {
                    foreach (var result in resultSet[9])
                    {
                        CustomerFeedback customerFeedback = new CustomerFeedback();
                        customerFeedback.CFID                 = result.Customer_Follow_Up_ID;
                        customerFeedback.CFStatus             = Convert.ToString(result.Status_Report_ID);
                        customerFeedback.FollowupDueDate      = result.Follow_Up_Due_Date == null ? null : result.Follow_Up_Due_Date.ToString("MM/dd/yyyy");
                        customerFeedback.MethodofFollowUp     = Convert.ToString(result.Method_Follow_Up_ID);
                        customerFeedback.FollowupConductedBy  = Convert.ToString(result.Followup_Conducted_By_ID);
                        customerFeedback.DateReceivedFeedback = result.Received_Feedback_Date == null ? null : result.Received_Feedback_Date.ToString("MM/dd/yyyy");
                        customerFeedback.DescFeedback         = result.Description_Feedback;
                        customerFeedback.AARequired           = result.Additional_Action_Required_Flag;
                        customerFeedback.AAIfRequired         = result.Additional_Action;
                        customerFeedback.DateActionCompleted  = result.Closing_Date == null ? null : result.Closing_Date.ToString("MM/dd/yyyy");
                        customerFeedback.ActionCompletedBy    = Convert.ToString(result.Closed_By_ID);
                        warranty.customerFeedback             = customerFeedback;
                    }
                }

                if (resultSet != null && resultSet.Count >= 10 && resultSet[10] != null)
                {
                    foreach (var result in resultSet[10])
                    {
                        warranty.communicationLog                = new CommunicationLog();
                        warranty.communicationLog.CLID           = result.Comms_Log_ID;
                        warranty.communicationLog.CLStatus       = Convert.ToString(result.Status_Report_ID);
                        warranty.communicationLog.SummaryComm    = result.Summary_Comms;
                        warranty.communicationLog.CDID           = result.ComplaintDocumentationID;
                        warranty.communicationLog.OpenSharedPath = result.ComplaintDocumentationLinks;
                    }
                }
                //var response = Tuple.Create(new
                //{
                //    status = true,
                //    result = warranty
                //}, warranty);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            //return new
            //{
            //    status = true,
            //    result = warranty
            //};
            return(warranty);
        }
 public async Task <bool> Create(CustomerFeedback CustomerFeedback)
 {
     return(CustomerFeedback.IsValidated);
 }
    protected void btnFeedback_Click(object sender, EventArgs e)
    {
        if (satisfiedrdbutton.Checked == false && verysatisfied.Checked == false && Rddisatisfied.Checked == false && Rdverydissatisfied.Checked == false)
        {
            Lblmsg.Visible = true;
            Lblmsg.Text    = "Please select your feedback";
            return;
        }

        //if (satisfiedrdbutton.Checked == true && verysatisfied.Checked == true && Rddisatisfied.Checked == true && Rdverydissatisfied.Checked == true)
        //{
        //    Lblmsg0.Visible = true;
        //    Lblmsg0.Text = "Your feedback has been saved";
        //    return;
        //}

        int userid = Convert.ToInt16(Request.QueryString["userid"]);

        //////////////Added by lalit. capture querystring of callid in case when user gives
        //feedback by call
        if (Request.QueryString["Clid"] != null)
        {
            int callid = Convert.ToInt16(Request.QueryString["Clid"]);
            ObjCustomerfeedback = ObjCustomerfeedback.Get_By_Userid_ByIncidentId(userid, callid);
        }
        else
        {
            ObjCustomerfeedback = ObjCustomerfeedback.Get_By_Incidentid(userid);
        }


        if (satisfiedrdbutton.Checked == true)
        {
            Feedback = "Good";
        }
        if (verysatisfied.Checked == true)
        {
            Feedback = "Very Good";
        }
        if (Rddisatisfied.Checked == true)
        {
            Feedback = "Average";
        }
        if (Rdverydissatisfied.Checked == true)
        {
            Feedback = "Poor";
        }

        if (ObjCustomerfeedback.Id == 0)
        {
            ObjCustomerfeedback.Id       = Convert.ToInt16(Request.QueryString["userid"]);
            ObjCustomerfeedback.Feedback = Feedback;
            if (Request.QueryString["Clid"] != null)
            {
                ObjCustomerfeedback.IncidentId   = Convert.ToInt16(Request.QueryString["Clid"]);
                ObjCustomerfeedback.FeedbackType = "CallWise";
                ObjCustomerfeedback.Remark       = TextRmk.Text;
                ObjCustomerfeedback.Insert_CallWise();

                Lblmsg0.Visible = true;
                Lblmsg0.Text    = "Your Feedback Has Been Submitted";

                btnFeedback.Visible        = false;
                satisfiedrdbutton.Visible  = false;
                verysatisfied.Visible      = false;
                Rddisatisfied.Visible      = false;
                Rdverydissatisfied.Visible = false;
                TextRmk.Visible            = false;
                labGood.Visible            = false;
                labVeryGood.Visible        = false;
                labAverage.Visible         = false;
                labPoor.Visible            = false;
                lblApproved.Visible        = false;
                lblRemark.Visible          = false;
            }
            else
            {
                ObjCustomerfeedback.FeedbackType = "Default";
                ObjCustomerfeedback.Remark       = "Default";
                ObjCustomerfeedback.Insert();
            }
        }
        string myScript;

        myScript = "<script language=javascript></script>";
        myScript = "<script language=javascript>CloseWindow();</script>";
        Page.RegisterClientScriptBlock("MyScript", myScript);
        //ScriptManager.RegisterStartupScript(this, this.GetType(), "refreshParent();", "refreshParent();", true);
    }
示例#31
0
 private void Start()
 {
     Instance = this;
     gameObject.SetActive(false);
 }
        public async Task <CustomerFeedback> Get(long Id)
        {
            CustomerFeedback CustomerFeedback = await DataContext.CustomerFeedback.AsNoTracking()
                                                .Where(x => x.Id == Id)
                                                .Where(x => x.DeletedAt == null)
                                                .Select(x => new CustomerFeedback()
            {
                CreatedAt              = x.CreatedAt,
                UpdatedAt              = x.UpdatedAt,
                Id                     = x.Id,
                IsSystemCustomer       = x.IsSystemCustomer,
                CustomerId             = x.CustomerId,
                FullName               = x.FullName,
                Email                  = x.Email,
                PhoneNumber            = x.PhoneNumber,
                CustomerFeedbackTypeId = x.CustomerFeedbackTypeId,
                Title                  = x.Title,
                SendDate               = x.SendDate,
                Content                = x.Content,
                StatusId               = x.StatusId,
                Customer               = x.Customer == null ? null : new Customer
                {
                    Id                 = x.Customer.Id,
                    Code               = x.Customer.Code,
                    Name               = x.Customer.Name,
                    Phone              = x.Customer.Phone,
                    Address            = x.Customer.Address,
                    NationId           = x.Customer.NationId,
                    ProvinceId         = x.Customer.ProvinceId,
                    DistrictId         = x.Customer.DistrictId,
                    WardId             = x.Customer.WardId,
                    CustomerTypeId     = x.Customer.CustomerTypeId,
                    Birthday           = x.Customer.Birthday,
                    Email              = x.Customer.Email,
                    ProfessionId       = x.Customer.ProfessionId,
                    CustomerResourceId = x.Customer.CustomerResourceId,
                    SexId              = x.Customer.SexId,
                    StatusId           = x.Customer.StatusId,
                    CompanyId          = x.Customer.CompanyId,
                    ParentCompanyId    = x.Customer.ParentCompanyId,
                    TaxCode            = x.Customer.TaxCode,
                    Fax                = x.Customer.Fax,
                    Website            = x.Customer.Website,
                    NumberOfEmployee   = x.Customer.NumberOfEmployee,
                    BusinessTypeId     = x.Customer.BusinessTypeId,
                    Investment         = x.Customer.Investment,
                    RevenueAnnual      = x.Customer.RevenueAnnual,
                    IsSupplier         = x.Customer.IsSupplier,
                    Descreption        = x.Customer.Descreption,
                    Used               = x.Customer.Used,
                    RowId              = x.Customer.RowId,
                },
                CustomerFeedbackType = x.CustomerFeedbackType == null ? null : new CustomerFeedbackType
                {
                    Id   = x.CustomerFeedbackType.Id,
                    Code = x.CustomerFeedbackType.Code,
                    Name = x.CustomerFeedbackType.Name,
                },
                Status = x.Status == null ? null : new Status
                {
                    Id   = x.Status.Id,
                    Code = x.Status.Code,
                    Name = x.Status.Name,
                },
            }).FirstOrDefaultAsync();

            if (CustomerFeedback == null)
            {
                return(null);
            }

            return(CustomerFeedback);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
           if (Request.QueryString["userid"] != null)
            {
                int userid = Convert.ToInt16(Request.QueryString[0]);
                if (Request.QueryString["Clid"] != null)
                {

                    int callid = Convert.ToInt16(Request.QueryString["Clid"]);
                    ObjCustomerfeedback = ObjCustomerfeedback.Get_By_Userid_ByIncidentId(userid, callid);
                    GetRemark(userid, callid);
                }
                else
                {
                    ObjCustomerfeedback = ObjCustomerfeedback.Get_By_Incidentid(userid);
                }
            }

            if (ObjCustomerfeedback.Id != 0)
            {
                btnFeedback.Enabled = false;
                satisfiedrdbutton.Enabled = false;
                verysatisfied.Enabled = false;
                Rddisatisfied.Enabled = false;
                Rdverydissatisfied.Enabled = false;
                TextRmk.Enabled = false;
            }

        }
    }