Ejemplo n.º 1
0
        public ActionResult DayPlan(DayPlans dayView)
        {
            try
            {
                string   strReq = "";
                string[] arrMsgs;

                strReq = Request.Url.Query;
                strReq = strReq.Substring(strReq.IndexOf('?') + 1);
                if (strReq != null)
                {
                    arrMsgs = strReq.Split('?');
                }
                Session["Empcd"] = strReq;
                ListPlans lst = new ListPlans();
                dayView.Empcd = EncryDecry.Decrypt(Session["Empcd"].ToString()).Replace("Empcd=", "");
                dayView.Date  = DateTime.Today.ToString("dd/MM/yyyy");
                var Get_Plans = _WPO.GetDayPlanss(dayView);
                lst.DayPlan = Get_Plans;
                return(View(lst));
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
        public string ApplyGruid()
        {
            var guid = Guid.NewGuid().ToString();

            guid = guid.Replace("-", "");
            _redisOper.Set(guid, $"1999_{DateTime.Now}");//1999代表session

            var res = new EncryDecry().Md5Encrypt(guid);

            return(JsonConvert.SerializeObject(res));
        }
Ejemplo n.º 3
0
        public ActionResult DayPlansInsert(DayPlans obj, FormCollection frms)
        {
            obj.Date        = frms["date"];
            obj.Start       = frms["From"];
            obj.End         = frms["To"];
            obj.Description = frms["Description"];
            obj.Empcd       = EncryDecry.Decrypt(Session["Empcd"].ToString()).Replace("Empcd=", "");
            _WPO.DayPlanList(obj);
            //ViewBag.PopRecords = _WPO.GetPopupRecord(obj);

            //ListPlans lst1 = new ListPlans();
            return(Redirect("https://localhost:44382/DayWise/DayPlan?s2o+vZQxoM0UHPZVdQPaCA=="));
        }
Ejemplo n.º 4
0
        public JsonResult GetEvents()
        {
            string strReq = "";

            strReq = Session["Empcd"].ToString();
            string[] arrEmpcd;
            string[] arrBrcd;
            string[] arrMsgs;

            strReq = strReq.Replace("%2f", "/");
            strReq = strReq.Replace("%3F", "");
            strReq = strReq.Replace("%2F", "/");
            strReq = strReq.Replace("%2B", "+");
            strReq = EncryDecry.Decrypt(strReq);
            if (strReq != null)
            {
                arrMsgs = strReq.Split('&');
            }
            else
            {
                arrMsgs = null;
            }
            arrEmpcd = arrMsgs[0].Split('=');
            string emp = arrEmpcd[1].ToString().Trim();

            arrBrcd = arrMsgs[1].Split('=');
            string Brcd = arrBrcd[1].ToString().Trim();

            try
            {
                using (HRAlign_InlandEntities1 dc = new HRAlign_InlandEntities1())
                {
                    var events = dc.Events.Where(x => x.Empcd == emp & x.deleteActive == "Y").ToList();
                    return(new JsonResult {
                        Data = events, JsonRequestBehavior = JsonRequestBehavior.AllowGet
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 5
0
        public ActionResult DayPlan(DayPlans dayView, FormCollection frms)
        {
            try
            {
                string strReq = "";
                strReq = Session["Empcd"].ToString();
                string[] arrEmpcd;
                string[] arrMsgs;

                strReq = strReq.Replace("%2f", "/");
                strReq = strReq.Replace("%3F", "");
                strReq = strReq.Replace("%2F", "/");
                strReq = strReq.Replace("%2B", "+");
                strReq = EncryDecry.Decrypt(strReq);
                if (strReq != null)
                {
                    arrMsgs = strReq.Split('&');
                }
                else
                {
                    arrMsgs = null;
                }
                arrEmpcd = arrMsgs[0].Split('=');
                string emp = arrEmpcd[1].ToString().Trim();

                dayView.Start       = frms["From"];
                dayView.End         = frms["To"];
                dayView.Description = frms["Description"];
                dayView.Empcd       = emp;

                ListPlans lst1       = new ListPlans();
                var       Get_Plans1 = _WPO.DayPlanInsert(dayView);
                lst1.DayPlan = Get_Plans1;
                return(View(lst1));
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Ejemplo n.º 6
0
        public JsonResult SaveEvent(Event e)
        {
            string strReq = "";

            strReq = Session["Empcd"].ToString();
            string[] arrEmpcd;
            string[] arrMsgs;

            strReq = strReq.Replace("%2f", "/");
            strReq = strReq.Replace("%3F", "");
            strReq = strReq.Replace("%2F", "/");
            strReq = strReq.Replace("%2B", "+");
            strReq = EncryDecry.Decrypt(strReq);
            if (strReq != null)
            {
                arrMsgs = strReq.Split('&');
            }
            else
            {
                arrMsgs = null;
            }
            arrEmpcd = arrMsgs[0].Split('=');
            string emp = arrEmpcd[1].ToString().Trim();

            var status = false;

            try
            {
                using (HRAlign_InlandEntities1 dc = new HRAlign_InlandEntities1())
                {
                    if (e.EventID > 0)
                    {
                        //Update the event
                        var v = dc.Events.Where(a => a.EventID == e.EventID).FirstOrDefault();
                        if (v != null)
                        {
                            v.Subject      = e.Subject;
                            v.Start        = e.Start;
                            v.End          = e.End;
                            v.Description  = e.Description;
                            v.IsFullDay    = e.IsFullDay;
                            v.ThemeColor   = e.ThemeColor;
                            v.Empcd        = emp;
                            v.deleteActive = "Y";
                        }
                    }
                    else
                    {
                        e.deleteActive = "Y";
                        e.Empcd        = emp;
                        dc.Events.Add(e);
                    }
                    dc.SaveChanges();
                    status = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(new JsonResult {
                Data = new { status = status }
            });
        }