Exemplo n.º 1
0
        public ActionResult AddRemarks(Remark remark)
        {
            if (HttpContext.User.IsInRole("Hr") == false)
            {
                return RedirectToAction("Login", "Account");
            }
            Dictionary<string, string> employeeDictionary = new Dictionary<string, string>();
            employeeDictionary = new Remark().ShowEmployee();
            List<SelectListItem> employeeDetails = new List<SelectListItem>();
            foreach (var dictionary in employeeDictionary)
            {
                employeeDetails.Add(new SelectListItem { Text = dictionary.Key, Value = dictionary.Value });

            }
            ViewData["Employee"] = employeeDetails;
            if (Request["SelectedIndex"]!=null)
            {
                string Id = Request["SelectedIndex"].ToString();
                remark.CreateTimeStamp = DateTime.UtcNow;
                var result = new Remark().Add(Convert.ToInt32(Id), remark);
                if (result.StatusCode != "200")
                {
                    ViewData["Label"] = "Error occurred while adding remark!!";
                    return View("AddRemark");
                }

                ViewData["Label"] = "Success!!";
                ModelState.Clear();
                return View("AddRemarks");
            }
            ViewData["Label"] = "";
            return View();
        }
Exemplo n.º 2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                Remark remark = new Remark();
                int employeeId = Convert.ToInt32(DropDownList1.SelectedValue);
                remark.Text = TextBox1.Text;
                remark.CreateTimeStamp = DateTime.UtcNow;

               var remarkResponse = remark.Add(employeeId, remark);
               if (remarkResponse.StatusCode != "200")
               {
                   Label2.Text = "Remark Not Added";
               }

                Label2.Text = "Successfull!!";
                TextBox1.Text = "";
                DropDownList1.SelectedIndex = -1;

            }
            catch (Exception)
            {

            }
        }
Exemplo n.º 3
0
        public Status Add(int employeeId,Remark remark)
        {
            HttpClient client = new HttpClient();
            var empRespone = client.UploadData<Remark, RemarkResponse>(_emsUri + "/employee/" + employeeId + "/remark", remark);

            return empRespone.Status;
        }
Exemplo n.º 4
0
        public Status Add(int employeeId, Remark remark)
        {
            string emsUri = ConfigurationManager.AppSettings["EMSUri"];

            HttpClient client = new HttpClient();
            var empRespone = client.UploadData<Remark, RemarkResponse>(emsUri + "/employee/" + employeeId + "/remark", remark);

            return empRespone.Status;
        }
Exemplo n.º 5
0
        public List<Remark> GetRemarks(string employeeId, int pageNumber)
        {
            Remark remark = new Remark();
            var response = remark.GetRemark(employeeId,pageNumber);
            List<Remark> remarklList = new List<Remark>();
            remarklList = response.Employee.Remarks;

            return remarklList;
        }
Exemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Remark remark = new Remark();
                var empRecord = remark.ShowEmployee();

                if (Page.IsPostBack == false)
                {

                    DropDownList1.DataTextField = "Key";
                    DropDownList1.DataValueField = "Value";
                    DropDownList1.DataSource = empRecord;
                    DropDownList1.DataBind();

                }
            }
            catch (Exception)
            {
                Response.Redirect("Login.aspx");
            }
        }