Ejemplo n.º 1
0
        public ActionResult Edit(string ddlShift, string chkSun, string chkMon, string chkTue, string chkWed, string chkThur, string chkFri, string chkSat)
        {
            if (ModelState.IsValid)
            {
                if (!string.IsNullOrEmpty(Request.Form["vAgentID"]))
                {
                }
                string weekDays = "";
                if (!string.IsNullOrEmpty(chkSun))
                {
                    weekDays += "," + chkSun;
                }
                if (!string.IsNullOrEmpty(chkMon))
                {
                    weekDays += "," + chkMon;
                }
                if (!string.IsNullOrEmpty(chkTue))
                {
                    weekDays += "," + chkTue;
                }
                if (!string.IsNullOrEmpty(chkWed))
                {
                    weekDays += "," + chkWed;
                }
                if (!string.IsNullOrEmpty(chkThur))
                {
                    weekDays += "," + chkThur;
                }
                if (!string.IsNullOrEmpty(chkFri))
                {
                    weekDays += "," + chkFri;
                }
                if (!string.IsNullOrEmpty(chkSat))
                {
                    weekDays += "," + chkSat;
                }
                if (!string.IsNullOrEmpty(weekDays))
                {
                    weekDays = weekDays.Substring(1);
                }

                string agentIDs = Request.Form["vAgentID"];
                //int index = 0;
                //while (agentIDs.Length>2000)
                //{
                //    string insertAgentIDs = agentIDs.Substring(index * 2000, 2000);
                using (WFMDBDataContext db = new WFMDBDataContext())
                {
                    db.uspWFMUpdateShiftAgentWeek(agentIDs, weekDays, int.Parse(ddlShift));
                }
                //}
            }
            return(RedirectToAction("index"));
        }
Ejemplo n.º 2
0
        public ActionResult Edit(string ddlShift, string chkSun, string chkMon, string chkTue, string chkWed, string chkThur, string chkFri, string chkSat)
        {
            if (ModelState.IsValid)
            {
                if (!string.IsNullOrEmpty(Request.Form["vAgentID"]))
                {

                }
                string weekDays = "";
                if (!string.IsNullOrEmpty(chkSun))
                    weekDays += "," + chkSun;
                if (!string.IsNullOrEmpty(chkMon))
                    weekDays += "," + chkMon;
                if (!string.IsNullOrEmpty(chkTue))
                    weekDays += "," + chkTue;
                if (!string.IsNullOrEmpty(chkWed))
                    weekDays += "," + chkWed;
                if (!string.IsNullOrEmpty(chkThur))
                    weekDays += "," + chkThur;
                if (!string.IsNullOrEmpty(chkFri))
                    weekDays += "," + chkFri;
                if (!string.IsNullOrEmpty(chkSat))
                    weekDays += "," + chkSat;
                if (!string.IsNullOrEmpty(weekDays))
                {
                    weekDays = weekDays.Substring(1);
                }

                string agentIDs = Request.Form["vAgentID"];
                //int index = 0;
                //while (agentIDs.Length>2000)
                //{
                //    string insertAgentIDs = agentIDs.Substring(index * 2000, 2000);
                using (WFMDBDataContext db = new WFMDBDataContext())
                {
                    db.uspWFMUpdateShiftAgentWeek(agentIDs, weekDays, int.Parse(ddlShift));
                }
                //}

            }
            return RedirectToAction("index");
        }