/// <summary> /// get all the skill group /// </summary> /// <param name="selectedGroupIDs">these group ids are seleted </param> protected void GetSkillGroupListNoWithSkillAgregationForDDL(string selectedGroupIDs, bool hasExtraHeader = false) { if (string.IsNullOrEmpty(selectedGroupIDs)) { selectedGroupIDs = "None"; } List <SelectListItem> lstItem = new List <SelectListItem>(); List <uspWFMGetSkillGroupResult> lstSkillGroup = new List <uspWFMGetSkillGroupResult>(); if (hasExtraHeader) { lstItem.Insert(0, new SelectListItem { Text = "指定なし", Value = "0" }); } using (WFMDBDataContext db = new WFMDBDataContext()) { lstSkillGroup = db.uspWFMGetSkillGroup(this.TenantID).ToList(); } foreach (var item in lstSkillGroup) { if (lstItem.Find(p => p.Value == item.iGroupProfileID.ToString()) != null) { continue; } lstItem.Add(new SelectListItem { Text = item.vCompany, Value = item.iGroupProfileID.ToString(), Selected = selectedGroupIDs.Contains(item.iGroupProfileID.ToString()) }); } ViewData["lstSkillGroup"] = lstItem; }
public ActionResult Delete_Ajax(string id) { WFMDBDataContext db = new WFMDBDataContext(); db.uspWFMDelSingleAggregation(int.Parse(id)); return Json(new { StatusCode = AppConst.Enum_JsonStatus.Remove }, JsonRequestBehavior.AllowGet); }
/// <summary> /// get agents show in dropdown list /// </summary> /// <param name="strAgentID">selected agentid</param> /// <param name="hasExtraHeader"> whether has 指定なし </param> /// <param name="isShowDisplayName">AgentID + Agent Display name</param> protected void GetAgentListForDDL(string strAgentID, bool hasExtraHeader, bool isShowDisplayName) { List <SelectListItem> lstItem = new List <SelectListItem>(); List <uspWFMGetAgentResult> lstAgent = new List <uspWFMGetAgentResult>(); if (hasExtraHeader) { lstItem.Insert(0, new SelectListItem { Text = "指定なし", Value = "" }); } using (WFMDBDataContext db = new WFMDBDataContext()) { lstAgent = db.uspWFMGetAgent(this.TenantID).ToList(); } foreach (var item in lstAgent) { if (!isShowDisplayName) { lstItem.Add(new SelectListItem { Text = item.vLogin, Value = item.vLogin, Selected = (item.vLogin.Equals(strAgentID)) }); } else { lstItem.Add(new SelectListItem { Text = item.vLogin + "_" + item.vDisplayName, Value = item.vLogin, Selected = (item.vLogin.Equals(strAgentID)) }); } } ViewData["lstAgent"] = lstItem; }
// GET: Shift public ActionResult Index() { WFMDBDataContext db = new WFMDBDataContext(); List <uspWFMGetShiftResult> lstShift = db.uspWFMGetShift(this.TenantID, null).ToList(); return(View(lstShift)); }
/// <summary> /// get skill agregation for list box control /// </summary> protected void GetSkillAgregationListForDDL(string selectedAgregationIDs, bool hasExtraHeader = false) { if (string.IsNullOrEmpty(selectedAgregationIDs)) { selectedAgregationIDs = "None"; } List <SelectListItem> lstItem = new List <SelectListItem>(); List <uspWFMGetAggregationResult> lstSkillAgregation = new List <uspWFMGetAggregationResult>(); if (hasExtraHeader) { lstItem.Insert(0, new SelectListItem { Text = "指定なし", Value = "0" }); } using (WFMDBDataContext db = new WFMDBDataContext()) { lstSkillAgregation = db.uspWFMGetAggregation(this.TenantID, this.TenantSpecialFlag).ToList(); } foreach (var item in lstSkillAgregation) { lstItem.Add(new SelectListItem { Text = item.vAggregationName, Value = item.iAggregationID.ToString(), Selected = selectedAgregationIDs.Contains(item.iAggregationID.ToString()) }); } ViewData["lstSkillAgregation"] = lstItem; }
/// <summary> /// get info from report.txt /// </summary> /// <returns></returns> public ActionResult UpdateReportFileInfo_Ajax() { try { string reportPath = "\\cte1repot\\Report.txt"; string[] lines = System.IO.File.ReadAllLines(Server.MapPath(reportPath)); using (WFMDBDataContext db = new WFMDBDataContext(System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString)) { foreach (var line in lines) { var report = line.Trim(); if (string.IsNullOrEmpty(report) || !report.Contains("=")) { continue; } var reportId = report.Split('=')[0]; var reportName = report.Split('=')[1]; } db.uspWFMDataSynchro(this.TenantID, null, null); } return(Json(new { StatusCode = AppConst.Enum_JsonStatus.Edit }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { AppLog.WriteLog("DataSynchroController:Update_Ajax system error:" + ex.Message + ex.StackTrace); return(Json(new { StatusCode = AppConst.Enum_JsonStatus.Error }, JsonRequestBehavior.AllowGet)); } }
protected void GetShiftDDList(string shiftID, bool hasExtraHeader, bool isShowTime) { List <SelectListItem> lstItem = new List <SelectListItem>(); List <uspWFMGetShiftResult> lstShift = new List <uspWFMGetShiftResult>(); if (hasExtraHeader) { lstItem.Insert(0, new SelectListItem { Text = "指定なし", Value = "" }); } using (WFMDBDataContext db = new WFMDBDataContext()) { lstShift = db.uspWFMGetShift(this.TenantID, this.TenantSpecialFlag).ToList(); } foreach (var item in lstShift) { if (!isShowTime) { lstItem.Add(new SelectListItem { Text = item.vShiftName, Value = item.iShiftID.ToString(), Selected = (item.iShiftID.ToString().Equals(shiftID)) }); } else { lstItem.Add(new SelectListItem { Text = item.vShiftName + " (" + item.vStartTime + "~" + item.vEndTime + ")", Value = item.iShiftID.ToString(), Selected = (item.iShiftID.ToString().Equals(shiftID)) }); } } ViewData["lstShift"] = lstItem; }
protected void Application_Error() { //String Errormsg = String.Empty; Exception unhandledException = Server.GetLastError(); //例外ログを記録する。 AppLog.TraceLog(unhandledException); //エラーメール try { WFMDBDataContext db = new WFMDBDataContext(); Guid? emailId = Guid.Empty; //db.InsertEmailReserve(ref emailId, AppFunction.GetSystemEmail(), string.Empty, string.Empty, "エラー", unhandledException.ToString(), User.Identity.Name); } catch { }; Response.Clear(); HttpException httpException = unhandledException as HttpException; if (httpException != null) { RouteData routeData = new RouteData(); routeData.Values.Add("controller", "Error"); switch (httpException.GetHttpCode()) { case 404: // page not found routeData.Values.Add("action", "Error404"); break; default: routeData.Values.Add("action", "General"); break; } // Pass exception details to the target error View. routeData.Values.Add("Error", unhandledException); // clear error on server Server.ClearError(); // Call target Controller and pass the routeData. IController errorController = new ErrorController(); errorController.Execute(new RequestContext( new HttpContextWrapper(Context), routeData)); } else { // clear error on server Server.ClearError(); RouteData routeData = new RouteData(); routeData.Values.Add("controller", "Error"); routeData.Values.Add("action", "General"); routeData.Values.Add("Error", unhandledException); // Call target Controller and pass the routeData. IController errorController = new ErrorController(); errorController.Execute(new RequestContext( new HttpContextWrapper(Context), routeData)); } }
//検索処理 private List <tblAgentAHT> SearchData(string pageIndex, string pageSize, string pageTotal, DateTime dtST, DateTime dtEnd, string vAgentID, bool isGroupBySkill) { AppLog.WriteLog("AHTController SearchData start"); List <tblAgentAHT> result = new List <tblAgentAHT>(); try { int currentPageIndex = m_CurPageIndex; int currentPageSize = m_CurrentPageSize; int.TryParse(pageIndex, out currentPageIndex); int.TryParse(pageSize, out currentPageSize); m_CurPageIndex = currentPageIndex; m_CurrentPageSize = currentPageSize; string strSortField = GetSortField(m_SortField); string strSort = AppFunction.GetSortDefine(m_Sort); ViewBag.vTenantID = this.TenantID; ViewBag.vTenantSpeciaFlag = this.TenantSpecialFlag; //ページを再計算する CalcPage(pageTotal); using (WFMDBDataContext db = new WFMDBDataContext()) { if (isGroupBySkill) { IMultipleResults results = db.uspWFMSearchAHTGroupBySkillPaged(m_CurPageIndex, m_CurrentPageSize, strSortField, strSort, this.TenantID, dtST, dtEnd, this.TenantSpecialFlag, vAgentID); result = results.GetResult <tblAgentAHT>().ToList(); tblDataPaged tblPage = results.GetResult <tblDataPaged>().FirstOrDefault(); m_TotalRowCount = tblPage.TotalRowCount; m_CurPageIndex = tblPage.CurPageIndex; m_TotlePageCount = tblPage.TotalPageCount; } else { IMultipleResults results = db.uspWFMSearchAHTGroupByAggregationPaged(m_CurPageIndex, m_CurrentPageSize, strSortField, strSort, this.TenantID, dtST, dtEnd, this.TenantSpecialFlag, vAgentID); result = results.GetResult <tblAgentAHT>().ToList(); tblDataPaged tblPage = results.GetResult <tblDataPaged>().FirstOrDefault(); m_TotalRowCount = tblPage.TotalRowCount; m_CurPageIndex = tblPage.CurPageIndex; m_TotlePageCount = tblPage.TotalPageCount; } } } catch (Exception ex) { AppLog.WriteLog("AHTController SearchData system error:" + ex.Message + ex.StackTrace); } return(result); }
public JsonResult DoCallPredict(string txtTargetDate, int dataSouceType, double factor1,double factor2) { using (WFMDBDataContext db = new WFMDBDataContext()) { db.uspWFMcreateCallPrediction(dataSouceType, this.TenantID, DateTime.Parse(txtTargetDate), factor1, factor2); } return this.Json(new { result = "ok" }, JsonRequestBehavior.AllowGet); }
public ActionResult Delete_Ajax(string id) { WFMDBDataContext db = new WFMDBDataContext(); db.uspWFMDelSingleAggregation(int.Parse(id)); return(Json(new { StatusCode = AppConst.Enum_JsonStatus.Remove }, JsonRequestBehavior.AllowGet)); }
public ActionResult Edit(string vAgentID, string dtStart, string dtEnd, string ddlShift) { using (WFMDBDataContext db = new WFMDBDataContext()) { db.uspWFMInsertOrUpdateShiftAgentSpecial(vAgentID, DateTime.Parse(dtStart), DateTime.Parse(dtEnd), int.Parse(ddlShift)); } return(RedirectToAction("index")); }
public JsonResult DoCallPredict(string txtTargetDate, int dataSouceType, double factor1, double factor2) { using (WFMDBDataContext db = new WFMDBDataContext()) { db.uspWFMcreateCallPrediction(dataSouceType, this.TenantID, DateTime.Parse(txtTargetDate), factor1, factor2); } return(this.Json(new { result = "ok" }, JsonRequestBehavior.AllowGet)); }
public JsonResult UpdateAgentShift(string txtTargetDate, int ddlShift, string agentShift) { using (WFMDBDataContext db = new WFMDBDataContext()) { db.uspWFMInsertOrUpdateShiftAgentSpecial(agentShift, DateTime.Parse(txtTargetDate), DateTime.Parse(txtTargetDate), ddlShift); } return(this.Json(new { status = "ok" }, JsonRequestBehavior.AllowGet)); }
public ActionResult GetSingleCallDetail(int? isessionprofileid, string vServerName) { ViewBag.iSessionID = isessionprofileid.Value; using (WFMDBDataContext db = new WFMDBDataContext(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer))) { ISingleResult<tblSingleCallDetail> results = db.uspWFMGetSingleCallDetail(isessionprofileid, vServerName); return PartialView("SignleCallDetail", results.ToList()); } }
// GET: SkillAgregation public ActionResult Index() { List<uspWFMGetAggregationResult> lstSkillAgregation = new List<uspWFMGetAggregationResult>(); using (WFMDBDataContext db = new WFMDBDataContext()) { lstSkillAgregation = db.uspWFMGetAggregation(this.TenantID, this.TenantSpecialFlag).ToList(); } return View(lstSkillAgregation); }
public ActionResult GetSingleCallDetail(int?isessionprofileid, string vServerName) { ViewBag.iSessionID = isessionprofileid.Value; using (WFMDBDataContext db = new WFMDBDataContext(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer))) { ISingleResult <tblSingleCallDetail> results = db.uspWFMGetSingleCallDetail(isessionprofileid, vServerName); return(PartialView("SignleCallDetail", results.ToList())); } }
public ActionResult Create(ShiftModel shift) { if (ModelState.IsValid) { WFMDBDataContext db = new WFMDBDataContext(); db.uspWFMInsertShift(shift.ShiftName, this.TenantID, shift.StartTime, shift.EndTime, this.TenantSpecialFlag); return(RedirectToAction("Index")); } return(View()); }
public ActionResult Create(ShiftModel shift) { if (ModelState.IsValid) { WFMDBDataContext db = new WFMDBDataContext(); db.uspWFMInsertShift(shift.ShiftName, this.TenantID, shift.StartTime, shift.EndTime, this.TenantSpecialFlag); return RedirectToAction("Index"); } return View(); }
// GET: SkillAgregation public ActionResult Index() { List <uspWFMGetAggregationResult> lstSkillAgregation = new List <uspWFMGetAggregationResult>(); using (WFMDBDataContext db = new WFMDBDataContext()) { lstSkillAgregation = db.uspWFMGetAggregation(this.TenantID, this.TenantSpecialFlag).ToList(); } return(View(lstSkillAgregation)); }
public ActionResult Create(string ddlShift, string chkSun, string chkMon, string chkTue, string chkWed, string chkThur, string chkFri, string chkSat) { if (ModelState.IsValid) { if (!string.IsNullOrEmpty(Request.Form["selectAgent"])) { } 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["selectAgent"]; //int index = 0; //while (agentIDs.Length>2000) //{ // string insertAgentIDs = agentIDs.Substring(index * 2000, 2000); using (WFMDBDataContext db = new WFMDBDataContext()) { db.uspWFMInsertShiftAgentWeek(agentIDs, weekDays, int.Parse(ddlShift)); } //} } return(RedirectToAction("index")); //return View("Index"); }
//public JsonResult LineChart(string txtTargetDate, int ddlShift, int Interval, int agentCount) //{ // WFMDBDataContext db = new WFMDBDataContext(); // List<tblChart> lstCalls = db.uspWFMGetMinInboundCallPrediction(this.TenantID, txtTargetDate, txtTargetDate, ddlShift, Interval, 0, 0).ToList(); // LineChart line = new LineChart(); // List<Dataset> datasets = new List<Dataset>(); // Dataset inCallDs = new Dataset(); // string lables = ""; // int[] datas = new int[lstCalls.Count]; // int index = 0; // foreach (var item in lstCalls) // { // lables += "," + item.dtCreatedCall.ToString("HH:mm"); // datas[index] = item.iCountOfInboundCall; // index++; // } // inCallDs.data = datas; // line.labels = lables.Substring(1).Split(','); // inCallDs.fillColor = "rgba(151,187,205,0.2)"; // inCallDs.strokeColor = "rgba(151,187,205,1)"; // inCallDs.pointColor = "rgba(151,187,205,1)"; // inCallDs.pointStrokeColor = "#fff"; // inCallDs.label = "予測着信数"; // datasets.Add(inCallDs); // line.datasets = datasets; // HttpRuntime.Cache.Insert("chatLine", lstCalls); // return this.Json(line, JsonRequestBehavior.AllowGet); //} public JsonResult LineChartForAgent(string txtTargetDate, int ddlShift, int Interval, int agentCount, bool needRefresh) { var cacheValue = HttpRuntime.Cache.Get("chatLine"); List <tblChart> lstCalls = null; if (cacheValue == null || needRefresh) { WFMDBDataContext db = new WFMDBDataContext(); lstCalls = db.uspWFMGetMinInboundCallPrediction(this.TenantID, txtTargetDate, txtTargetDate, ddlShift, Interval, 0, 0).ToList(); } else { lstCalls = cacheValue as List <tblChart>; } LineChart line = new LineChart(); List <Dataset> datasets = new List <Dataset>(); Dataset inCallDs = new Dataset(); Dataset zero = new Dataset(); string lables = ""; int[] datas = new int[lstCalls.Count]; int[] zeroDatas = new int[lstCalls.Count]; int index = 0; foreach (var item in lstCalls) { lables += "," + item.dtCreatedCall.ToString("HH:mm"); datas[index] = item.iCountOfInboundCall - agentCount; zeroDatas[index] = 0; index++; } inCallDs.data = datas; line.labels = lables.Substring(1).Split(','); inCallDs.fillColor = "rgba(151,187,205,0.2)"; inCallDs.strokeColor = "rgba(151,187,205,1)"; inCallDs.pointColor = "rgba(151,187,205,1)"; inCallDs.pointStrokeColor = "#fff"; inCallDs.label = "予測着信数"; zero.data = zeroDatas; zero.fillColor = "rgba(255,0,0,1)"; zero.strokeColor = "rgba(255,0,0,1)"; zero.pointColor = "rgba(255,0,0,1)"; zero.pointStrokeColor = "#FF0"; zero.label = "基准"; datasets.Add(inCallDs); datasets.Add(zero); line.datasets = datasets; HttpRuntime.Cache.Insert("chatLine", lstCalls); return(this.Json(line, JsonRequestBehavior.AllowGet)); }
public ActionResult ChangeTenant(string tenant) { Session["vTenantID"] = tenant; using (WFMDBDataContext db = new WFMDBDataContext()) { db.uspWFMCreateDefaultShift(tenant); var result = db.uspWFMGetDBServerByTenant(tenant); Session[AppConst.Const_Session_DBServer_Key] = result.FirstOrDefault().Column1; } return(RedirectToAction("index", "calldetail", new { area = "report" })); }
public ActionResult Edit(int id, ShiftModel shift) { if (ModelState.IsValid) { if (id != shift.ShiftID) { return RedirectToAction("Message", "Error", new { Error = "シフト在しません。" }); } } WFMDBDataContext db = new WFMDBDataContext(); db.uspWFMUpdateShift(id, shift.ShiftName, shift.StartTime, shift.EndTime); return RedirectToAction("Index"); }
//public JsonResult LineChart(string txtTargetDate, int ddlShift, int Interval, int agentCount) //{ // WFMDBDataContext db = new WFMDBDataContext(); // List<tblChart> lstCalls = db.uspWFMGetMinInboundCallPrediction(this.TenantID, txtTargetDate, txtTargetDate, ddlShift, Interval, 0, 0).ToList(); // LineChart line = new LineChart(); // List<Dataset> datasets = new List<Dataset>(); // Dataset inCallDs = new Dataset(); // string lables = ""; // int[] datas = new int[lstCalls.Count]; // int index = 0; // foreach (var item in lstCalls) // { // lables += "," + item.dtCreatedCall.ToString("HH:mm"); // datas[index] = item.iCountOfInboundCall; // index++; // } // inCallDs.data = datas; // line.labels = lables.Substring(1).Split(','); // inCallDs.fillColor = "rgba(151,187,205,0.2)"; // inCallDs.strokeColor = "rgba(151,187,205,1)"; // inCallDs.pointColor = "rgba(151,187,205,1)"; // inCallDs.pointStrokeColor = "#fff"; // inCallDs.label = "予測着信数"; // datasets.Add(inCallDs); // line.datasets = datasets; // HttpRuntime.Cache.Insert("chatLine", lstCalls); // return this.Json(line, JsonRequestBehavior.AllowGet); //} public JsonResult LineChartForAgent(string txtTargetDate, int ddlShift, int Interval, int agentCount,bool needRefresh) { var cacheValue = HttpRuntime.Cache.Get("chatLine"); List<tblChart> lstCalls = null; if (cacheValue == null || needRefresh) { WFMDBDataContext db = new WFMDBDataContext(); lstCalls = db.uspWFMGetMinInboundCallPrediction(this.TenantID, txtTargetDate, txtTargetDate, ddlShift, Interval, 0, 0).ToList(); } else { lstCalls = cacheValue as List<tblChart>; } LineChart line = new LineChart(); List<Dataset> datasets = new List<Dataset>(); Dataset inCallDs = new Dataset(); Dataset zero = new Dataset(); string lables = ""; int[] datas = new int[lstCalls.Count]; int[] zeroDatas = new int[lstCalls.Count]; int index = 0; foreach (var item in lstCalls) { lables += "," + item.dtCreatedCall.ToString("HH:mm"); datas[index] = item.iCountOfInboundCall - agentCount; zeroDatas[index] = 0; index++; } inCallDs.data = datas; line.labels = lables.Substring(1).Split(','); inCallDs.fillColor = "rgba(151,187,205,0.2)"; inCallDs.strokeColor = "rgba(151,187,205,1)"; inCallDs.pointColor = "rgba(151,187,205,1)"; inCallDs.pointStrokeColor = "#fff"; inCallDs.label = "予測着信数"; zero.data = zeroDatas; zero.fillColor = "rgba(255,0,0,1)"; zero.strokeColor = "rgba(255,0,0,1)"; zero.pointColor = "rgba(255,0,0,1)"; zero.pointStrokeColor = "#FF0"; zero.label = "基准"; datasets.Add(inCallDs); datasets.Add(zero); line.datasets = datasets; HttpRuntime.Cache.Insert("chatLine", lstCalls); return this.Json(line, JsonRequestBehavior.AllowGet); }
public ActionResult Edit(int id, SkillAgregationModel skillAgregation) { if (ModelState.IsValid) { if (id != skillAgregation.iAggregationID) { return RedirectToAction("Message", "Error", new { Error = "スキルアグリゲーション在しません。" }); } } string skillGroupIDs = Request.Form["selectSkillGroup"]; WFMDBDataContext db = new WFMDBDataContext(); db.uspWFMUpdateAggregation(id, skillAgregation.vAggregationName, skillGroupIDs); return RedirectToAction("Index"); }
public ActionResult Edit(int id, ShiftModel shift) { if (ModelState.IsValid) { if (id != shift.ShiftID) { return(RedirectToAction("Message", "Error", new { Error = "シフト在しません。" })); } } WFMDBDataContext db = new WFMDBDataContext(); db.uspWFMUpdateShift(id, shift.ShiftName, shift.StartTime, shift.EndTime); return(RedirectToAction("Index")); }
public ActionResult Create(string vAggregationName) { if (ModelState.IsValid) { string skillGroupIDs = Request.Form["selectSkillGroup"]; using (WFMDBDataContext db = new WFMDBDataContext()) { db.uspWFMInsertAggregation(vAggregationName, skillGroupIDs, this.TenantID, this.TenantSpecialFlag); } return(RedirectToAction("Index")); } return(View()); }
public static string GetUserName(string vTenantID) { string strRet = string.Empty; WFMDBDataContext db = new WFMDBDataContext(); List<uspWFMGetTenantNameResult> lstUsers = db.uspWFMGetTenantName(vTenantID).ToList(); if (lstUsers.Count > 0) { strRet = lstUsers[0].vDisplayName; } return strRet; }
public ActionResult Create(string vAggregationName) { if (ModelState.IsValid) { string skillGroupIDs = Request.Form["selectSkillGroup"]; using (WFMDBDataContext db = new WFMDBDataContext()) { db.uspWFMInsertAggregation(vAggregationName, skillGroupIDs, this.TenantID, this.TenantSpecialFlag); } return RedirectToAction("Index"); } return View(); }
//検索処理 private List <tblPedictionCall> SearchData(string pageIndex, string pageSize, string pageTotal, DateTime dtST, DateTime dtEnd, string dateType, string vSkillIDs, string vSkillAgregationIDs) { AppLog.WriteLog("CallReportController SearchData start"); List <tblPedictionCall> result = new List <tblPedictionCall>(); try { int currentPageIndex = m_CurPageIndex; int currentPageSize = m_CurrentPageSize; int.TryParse(pageIndex, out currentPageIndex); int.TryParse(pageSize, out currentPageSize); int isByAggregation = 0; m_CurPageIndex = currentPageIndex; m_CurrentPageSize = currentPageSize; string strSortField = GetSortField(m_SortField); string strSort = AppFunction.GetSortDefine(m_Sort); ViewBag.vTenantID = this.TenantID; ViewBag.vTenantSpeciaFlag = this.TenantSpecialFlag; if (ViewBag.RadioChecked == "byAgregation") { isByAggregation = 1; } //ページを再計算する CalcPage(pageTotal); AppLog.WriteLog("CallReportController SearchData db excute start"); using (WFMDBDataContext db = new WFMDBDataContext()) { IMultipleResults results = db.uspWFMRptOfRealAndPredictionInboundCall(m_CurPageIndex, m_CurrentPageSize, strSortField, strSort, this.TenantID, dtST, dtEnd, dateType, isByAggregation, vSkillIDs, vSkillAgregationIDs); result = results.GetResult <tblPedictionCall>().ToList(); tblDataPaged tblPage = results.GetResult <tblDataPaged>().FirstOrDefault(); m_TotalRowCount = tblPage.TotalRowCount; m_CurPageIndex = tblPage.CurPageIndex; m_TotlePageCount = tblPage.TotalPageCount; } } catch (Exception ex) { AppLog.WriteLog(ex.Message + ex.StackTrace); } return(result); }
public ActionResult Edit(int id, SkillAgregationModel skillAgregation) { if (ModelState.IsValid) { if (id != skillAgregation.iAggregationID) { return(RedirectToAction("Message", "Error", new { Error = "スキルアグリゲーション在しません。" })); } } string skillGroupIDs = Request.Form["selectSkillGroup"]; WFMDBDataContext db = new WFMDBDataContext(); db.uspWFMUpdateAggregation(id, skillAgregation.vAggregationName, skillGroupIDs); return(RedirectToAction("Index")); }
public JsonResult LineChart(string date, int shiftId, int skillGroupid, int skillAggregationId) { WFMDBDataContext db = new WFMDBDataContext(); List <tblChart> lstCalls = db.uspWFMGetPredictionAndActualInboundCallForChart(this.TenantID, date, shiftId, skillGroupid, skillAggregationId).ToList(); LineChart line = new LineChart(); List <Dataset> datasets = new List <Dataset>(); Dataset inCallDs = new Dataset(); Dataset inCompletedCallDs = new Dataset(); string lables = ""; int[] dataInCalls = new int[lstCalls.Count]; int[] dataCompleteds = new int[lstCalls.Count]; int index = 0; foreach (var item in lstCalls) { lables += "," + item.dtCreatedCall.ToString("HH:mm"); dataInCalls[index] = item.iCountOfInboundCall; dataCompleteds[index] = item.iCountOfCompletedInCall; index++; } if (!string.IsNullOrEmpty(lables)) { line.labels = lables.Substring(1).Split(','); } inCallDs.data = dataInCalls; inCallDs.fillColor = "rgba(151,187,205,0.2)"; inCallDs.strokeColor = "rgba(151,187,205,1)"; inCallDs.pointColor = "rgba(151,187,205,1)"; inCallDs.pointStrokeColor = "#fff"; inCallDs.label = "実績"; inCompletedCallDs.data = dataCompleteds; inCompletedCallDs.fillColor = "rgba(220,220,220,0.5)"; inCompletedCallDs.strokeColor = "rgba(220,220,220,1)"; inCompletedCallDs.pointColor = "rgba(220,220,220,1)"; inCompletedCallDs.pointStrokeColor = "#fff"; inCompletedCallDs.label = "予測"; datasets.Add(inCallDs); datasets.Add(inCompletedCallDs); line.datasets = datasets; return(this.Json(line, JsonRequestBehavior.AllowGet)); }
//private static CodeDescription[] codes = new CodeDescription[] //{ // new CodeDescription("M","Male","Gender"), // new CodeDescription("F","Female","Gender"), // new CodeDescription("S","Single","MaritalStatus"), // new CodeDescription("M","Married","MaritalStatus"), // new CodeDescription("CN","China","Country"), // new CodeDescription("US","Unite States","Country"), // new CodeDescription("UK","Britain","Country"), // new CodeDescription("SG","Singapore","Country") //}; public static Collection<CodeDescription> GetCodes(string category, string vTenantID, string vTenantFlag) { Collection<CodeDescription> codeCollection = new Collection<CodeDescription>(); WFMDBDataContext db = new WFMDBDataContext(); List<uspWFMGetShiftResult> lstShift = db.uspWFMGetShift(vTenantID, vTenantFlag).ToList(); foreach(var item in lstShift) { codeCollection.Add(new CodeDescription(item.iShiftID.ToString(), item.vShiftName, "Shift")); } //foreach(var code in codes.Where(code=>code.Category == category)) //{ // codeCollection.Add(code); //} return codeCollection; }
public JsonResult LineChart(string type) { //WFMDBDataContext db = new WFMDBDataContext(); WFMDBDataContext db = new WFMDBDataContext(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer)); List <tblChart> lstCalls = db.uspWFMGetHistoryInboundCallForChart(this.TenantID, type).ToList(); LineChart line = new LineChart(); List <Dataset> datasets = new List <Dataset>(); Dataset inCallDs = new Dataset(); Dataset inCompletedCallDs = new Dataset(); string lables = ""; int[] dataInCalls = new int[lstCalls.Count]; int[] dataCompleteds = new int[lstCalls.Count]; int index = 0; foreach (var item in lstCalls) { lables += "," + item.dtCreatedCall.ToString("MM/dd") + "(" + AppConst.Const_Weekday[Convert.ToInt16(item.dtCreatedCall.DayOfWeek)] + ")"; dataInCalls[index] = item.iCountOfInboundCall; dataCompleteds[index] = item.iCountOfCompletedInCall; index++; } line.labels = lables.Substring(1).Split(','); inCallDs.data = dataInCalls; inCallDs.fillColor = "rgba(151,187,205,0.2)"; inCallDs.strokeColor = "rgba(151,187,205,1)"; inCallDs.pointColor = "rgba(151,187,205,1)"; inCallDs.pointStrokeColor = "#fff"; inCallDs.label = "総着信"; inCompletedCallDs.data = dataCompleteds; inCompletedCallDs.fillColor = "rgba(220,220,220,0.5)"; inCompletedCallDs.strokeColor = "rgba(220,220,220,1)"; inCompletedCallDs.pointColor = "rgba(220,220,220,1)"; inCompletedCallDs.pointStrokeColor = "#fff"; inCompletedCallDs.label = "完了呼"; datasets.Add(inCallDs); datasets.Add(inCompletedCallDs); line.datasets = datasets; return(this.Json(line, JsonRequestBehavior.AllowGet)); }
public ActionResult Edit(int id) { uspWFMGetSingleAggregationResult result; using (WFMDBDataContext db = new WFMDBDataContext()) { result = db.uspWFMGetSingleAggregation(id).FirstOrDefault(); } GetSkillGroupListForDDL(id); if (result != null) { SkillAgregationModel model = new SkillAgregationModel() { iAggregationID = result.iAggregationID, vAggregationName = result.vAggregationName }; return View(model); } else { return RedirectToAction("Message", "Error", new { Error = "スキルアグリゲーション在しません。" }); } }
public ActionResult Edit(int id) { WFMDBDataContext db = new WFMDBDataContext(); List<uspWFMGetSingleShiftResult> lstShift = db.uspWFMGetSingleShift(id).ToList(); if (lstShift.Count > 0) { ShiftModel shift = new ShiftModel(); shift.ShiftID = lstShift[0].iShiftID; shift.ShiftName = lstShift[0].vShiftName; shift.StartTime = lstShift[0].vStartTime; shift.EndTime = lstShift[0].vEndTime; return View(shift); } else { return RedirectToAction("Message", "Error", new { Error = "シフト在しません。" }); } }
public ActionResult Edit(int id) { WFMDBDataContext db = new WFMDBDataContext(); List <uspWFMGetSingleShiftResult> lstShift = db.uspWFMGetSingleShift(id).ToList(); if (lstShift.Count > 0) { ShiftModel shift = new ShiftModel(); shift.ShiftID = lstShift[0].iShiftID; shift.ShiftName = lstShift[0].vShiftName; shift.StartTime = lstShift[0].vStartTime; shift.EndTime = lstShift[0].vEndTime; return(View(shift)); } else { return(RedirectToAction("Message", "Error", new { Error = "シフト在しません。" })); } }
public ActionResult Create(string ddlShift, string chkSun, string chkMon, string chkTue, string chkWed, string chkThur, string chkFri, string chkSat) { if (ModelState.IsValid) { if (!string.IsNullOrEmpty(Request.Form["selectAgent"])) { } 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["selectAgent"]; //int index = 0; //while (agentIDs.Length>2000) //{ // string insertAgentIDs = agentIDs.Substring(index * 2000, 2000); using (WFMDBDataContext db = new WFMDBDataContext()) { db.uspWFMInsertShiftAgentWeek(agentIDs, weekDays, int.Parse(ddlShift)); } //} } return RedirectToAction("index"); //return View("Index"); }
public JsonResult LineChart(string date,int shiftId,int skillGroupid,int skillAggregationId) { WFMDBDataContext db = new WFMDBDataContext(); List<tblChart> lstCalls = db.uspWFMGetPredictionAndActualInboundCallForChart(this.TenantID, date, shiftId, skillGroupid, skillAggregationId).ToList(); LineChart line = new LineChart(); List<Dataset> datasets = new List<Dataset>(); Dataset inCallDs = new Dataset(); Dataset inCompletedCallDs = new Dataset(); string lables = ""; int[] dataInCalls = new int[lstCalls.Count]; int[] dataCompleteds = new int[lstCalls.Count]; int index = 0; foreach (var item in lstCalls) { lables += "," + item.dtCreatedCall.ToString("HH:mm"); dataInCalls[index] = item.iCountOfInboundCall; dataCompleteds[index] = item.iCountOfCompletedInCall; index++; } if (!string.IsNullOrEmpty(lables)) line.labels = lables.Substring(1).Split(','); inCallDs.data = dataInCalls; inCallDs.fillColor = "rgba(151,187,205,0.2)"; inCallDs.strokeColor = "rgba(151,187,205,1)"; inCallDs.pointColor = "rgba(151,187,205,1)"; inCallDs.pointStrokeColor = "#fff"; inCallDs.label = "実績"; inCompletedCallDs.data = dataCompleteds; inCompletedCallDs.fillColor = "rgba(220,220,220,0.5)"; inCompletedCallDs.strokeColor = "rgba(220,220,220,1)"; inCompletedCallDs.pointColor = "rgba(220,220,220,1)"; inCompletedCallDs.pointStrokeColor = "#fff"; inCompletedCallDs.label = "予測"; datasets.Add(inCallDs); datasets.Add(inCompletedCallDs); line.datasets = datasets; return this.Json(line, JsonRequestBehavior.AllowGet); }
public JsonResult LineChart(string type) { //WFMDBDataContext db = new WFMDBDataContext(); WFMDBDataContext db = new WFMDBDataContext(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer)); List<tblChart> lstCalls = db.uspWFMGetHistoryInboundCallForChart(this.TenantID, type).ToList(); LineChart line = new LineChart(); List<Dataset> datasets = new List<Dataset>(); Dataset inCallDs = new Dataset(); Dataset inCompletedCallDs = new Dataset(); string lables = ""; int[] dataInCalls = new int[lstCalls.Count]; int[] dataCompleteds = new int[lstCalls.Count]; int index = 0; foreach (var item in lstCalls) { lables += "," + item.dtCreatedCall.ToString("MM/dd")+"("+AppConst.Const_Weekday[Convert.ToInt16(item.dtCreatedCall.DayOfWeek)]+")"; dataInCalls[index] = item.iCountOfInboundCall; dataCompleteds[index] = item.iCountOfCompletedInCall; index++; } line.labels = lables.Substring(1).Split(','); inCallDs.data = dataInCalls; inCallDs.fillColor = "rgba(151,187,205,0.2)"; inCallDs.strokeColor = "rgba(151,187,205,1)"; inCallDs.pointColor = "rgba(151,187,205,1)"; inCallDs.pointStrokeColor = "#fff"; inCallDs.label = "総着信"; inCompletedCallDs.data = dataCompleteds; inCompletedCallDs.fillColor = "rgba(220,220,220,0.5)"; inCompletedCallDs.strokeColor = "rgba(220,220,220,1)"; inCompletedCallDs.pointColor = "rgba(220,220,220,1)"; inCompletedCallDs.pointStrokeColor = "#fff"; inCompletedCallDs.label = "完了呼"; datasets.Add(inCallDs); datasets.Add(inCompletedCallDs); line.datasets = datasets; return this.Json(line, JsonRequestBehavior.AllowGet); }
public ActionResult Edit(string vAgentID, string vAgentName) { GetShiftDDList("-1", false, true); ViewBag.vAgentID = vAgentID; ViewBag.vAgentName = vAgentName; tblAgentWeekShift result = null; using (WFMDBDataContext db = new WFMDBDataContext()) { result = db.uspWFMSearchShiftAgentWeekByAgent(vAgentID).Single(); } if (result.monShift != 0) { ViewBag.shiftID = result.monShift; } else if (result.tueShift != 0) { ViewBag.shiftID = result.tueShift; } else if (result.wedShift != 0) { ViewBag.shiftID = result.wedShift; } else if (result.thurShift != 0) { ViewBag.shiftID = result.thurShift; } else if (result.friShift != 0) { ViewBag.shiftID = result.friShift; } else if (result.satShift != 0) { ViewBag.shiftID = result.satShift; } else if (result.sunShift != 0) { ViewBag.shiftID = result.sunShift; } return(View(result)); }
/// <summary> /// get data SynchroDate /// </summary> protected void GetDataSynchroDate() { AppLog.WriteLog("current connection:" + string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer)); string today = DateTime.Now.ToString(AppConst.Const_Format_YMD) + " 00:00:00"; string lastUpdatedTime = today; //using (WFMDBDataContext db = new WFMDBDataContext()) using (WFMDBDataContext db = new WFMDBDataContext(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer))) { List <uspWFMGetDataSynchroResult> lst = db.uspWFMGetDataSynchro(this.TenantID).ToList(); if (lst.Count > 0) { lastUpdatedTime = lst[0].dtUpdated.Value.ToString(AppConst.Const_Format_YMDHMS); if (string.Compare(today, lastUpdatedTime) > 0) { lastUpdatedTime = today; } } } ViewBag.UpdatedTime = lastUpdatedTime; }
public ActionResult Update_Ajax() { try { //using (WFMDBDataContext db = new WFMDBDataContext()) using (WFMDBDataContext db = new WFMDBDataContext(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer))) { db.uspWFMDataSynchro(this.TenantID, null, null); //db.uspRptForAgentDetailV3OneDay(this.TenantID, null, null); //db.uspRptForCallDetailV3OneDay(this.TenantID, null, null); //db.uspWFMUpdateOrInsertDataSynchro(this.TenantID); } return Json(new { StatusCode = AppConst.Enum_JsonStatus.Edit }, JsonRequestBehavior.AllowGet); } catch (Exception ex) { AppLog.WriteLog("DataSynchroController:Update_Ajax system error:"+ex.Message+ex.StackTrace); return Json(new { StatusCode = AppConst.Enum_JsonStatus.Error }, JsonRequestBehavior.AllowGet); } }
// GET: CallPrediction public ActionResult Index(int? currentShiftID) { if (currentShiftID.HasValue) { GetShiftDDList(currentShiftID.Value.ToString(), false, true); WFMDBDataContext db = new WFMDBDataContext(); List<uspWFMGetSingleShiftResult> lstShift = db.uspWFMGetSingleShift(currentShiftID.Value).ToList(); GetAgentListWithShiftNameForOneDay(DateTime.Parse(DateTime.Now.AddDays(1).ToString(AppConst.Const_Format_YMD)), lstShift[0].vShiftName, false, true); } else { GetShiftDDList("-1", false, true); var currentShiftId = int.Parse((ViewData["lstShift"] as List<SelectListItem>)[0].Value); WFMDBDataContext db = new WFMDBDataContext(); List<uspWFMGetSingleShiftResult> lstShift = db.uspWFMGetSingleShift(currentShiftId).ToList(); GetAgentListWithShiftNameForOneDay(DateTime.Parse(DateTime.Now.AddDays(1).ToString(AppConst.Const_Format_YMD)), lstShift[0].vShiftName, false, true); } //GetAgentListWithShiftName("-1", false, true); return View(); }
public ActionResult Update_Ajax() { try { //using (WFMDBDataContext db = new WFMDBDataContext()) using (WFMDBDataContext db = new WFMDBDataContext(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer))) { db.uspWFMDataSynchro(this.TenantID, null, null); //db.uspRptForAgentDetailV3OneDay(this.TenantID, null, null); //db.uspRptForCallDetailV3OneDay(this.TenantID, null, null); //db.uspWFMUpdateOrInsertDataSynchro(this.TenantID); } return(Json(new { StatusCode = AppConst.Enum_JsonStatus.Edit }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { AppLog.WriteLog("DataSynchroController:Update_Ajax system error:" + ex.Message + ex.StackTrace); return(Json(new { StatusCode = AppConst.Enum_JsonStatus.Error }, JsonRequestBehavior.AllowGet)); } }
public ActionResult Edit(int id) { uspWFMGetSingleAggregationResult result; using (WFMDBDataContext db = new WFMDBDataContext()) { result = db.uspWFMGetSingleAggregation(id).FirstOrDefault(); } GetSkillGroupListForDDL(id); if (result != null) { SkillAgregationModel model = new SkillAgregationModel() { iAggregationID = result.iAggregationID, vAggregationName = result.vAggregationName }; return(View(model)); } else { return(RedirectToAction("Message", "Error", new { Error = "スキルアグリゲーション在しません。" })); } }
//検索処理 private List <tblCallDetailV3> SearchData(string pageIndex, string pageSize, string pageTotal, DateTime dtST, DateTime dtEnd, string vCalleeid, string vCallerid, int skillID, int isessionprofileid, int iConntype, int iCompletedCall, int iQueCall, int iHasTransfer, int iHasACD, int iGroupID) { AppLog.WriteLog(string.Format("CallDetailController SearchData paramter is pageIndex:{0},pageSize:{1},pageTotal:{2},dtST:{3},dtEnd:{4},vCalleeid:{5},skillID:{6},groupid:{7}", pageIndex, pageSize, pageTotal, dtST.ToString(AppConst.Const_Format_YMDHMS) , dtEnd.ToString(AppConst.Const_Format_YMDHMS), vCalleeid, skillID.ToString(), iGroupID.ToString())); List <tblCallDetailV3> result = new List <tblCallDetailV3>(); int currentPageIndex = m_CurPageIndex; int currentPageSize = m_CurrentPageSize; int.TryParse(pageIndex, out currentPageIndex); int.TryParse(pageSize, out currentPageSize); m_CurPageIndex = currentPageIndex; m_CurrentPageSize = currentPageSize; string strSortField = GetSortField(m_SortField); string strSort = AppFunction.GetSortDefine(m_Sort); ViewBag.vTenantID = this.TenantID; ViewBag.vTenantSpeciaFlag = this.TenantSpecialFlag; //ページを再計算する CalcPage(pageTotal); using (WFMDBDataContext db = new WFMDBDataContext(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer))) { IMultipleResults results = db.uspWFMGetCallDetailV3(m_CurPageIndex, m_CurrentPageSize, strSortField, strSort, this.TenantID, dtST.ToString(AppConst.Const_Format_YMDHMS), dtEnd.ToString(AppConst.Const_Format_YMDHMS), skillID, vCalleeid, vCallerid, isessionprofileid, iConntype, iCompletedCall, iQueCall, iHasTransfer, iHasACD, iGroupID); result = results.GetResult <tblCallDetailV3>().ToList(); tblDataPaged tblPage = results.GetResult <tblDataPaged>().FirstOrDefault(); m_TotalRowCount = tblPage.TotalRowCount; m_CurPageIndex = tblPage.CurPageIndex; m_TotlePageCount = tblPage.TotalPageCount; } return(result); }
//検索処理 private List<tblPedictionCall> SearchData(string pageIndex, string pageSize, string pageTotal, DateTime dtST, DateTime dtEnd, string dateType, string vSkillIDs, string vSkillAgregationIDs) { AppLog.WriteLog("CallReportController SearchData start"); List<tblPedictionCall> result = new List<tblPedictionCall>(); try { int currentPageIndex = m_CurPageIndex; int currentPageSize = m_CurrentPageSize; int.TryParse(pageIndex, out currentPageIndex); int.TryParse(pageSize, out currentPageSize); int isByAggregation = 0; m_CurPageIndex = currentPageIndex; m_CurrentPageSize = currentPageSize; string strSortField = GetSortField(m_SortField); string strSort = AppFunction.GetSortDefine(m_Sort); ViewBag.vTenantID = this.TenantID; ViewBag.vTenantSpeciaFlag = this.TenantSpecialFlag; if (ViewBag.RadioChecked == "byAgregation") { isByAggregation = 1; } //ページを再計算する CalcPage(pageTotal); AppLog.WriteLog("CallReportController SearchData db excute start"); using (WFMDBDataContext db = new WFMDBDataContext()) { IMultipleResults results = db.uspWFMRptOfRealAndPredictionInboundCall(m_CurPageIndex, m_CurrentPageSize, strSortField, strSort, this.TenantID, dtST, dtEnd, dateType, isByAggregation, vSkillIDs, vSkillAgregationIDs); result = results.GetResult<tblPedictionCall>().ToList(); tblDataPaged tblPage = results.GetResult<tblDataPaged>().FirstOrDefault(); m_TotalRowCount = tblPage.TotalRowCount; m_CurPageIndex = tblPage.CurPageIndex; m_TotlePageCount = tblPage.TotalPageCount; } } catch(Exception ex) { AppLog.WriteLog(ex.Message + ex.StackTrace); } return result; }
/// <summary> /// get data SynchroDate /// </summary> protected void GetDataSynchroDate() { AppLog.WriteLog("current connection:" + string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer)); string today = DateTime.Now.ToString(AppConst.Const_Format_YMD) + " 00:00:00"; string lastUpdatedTime = today; //using (WFMDBDataContext db = new WFMDBDataContext()) using (WFMDBDataContext db = new WFMDBDataContext(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer))) { List<uspWFMGetDataSynchroResult> lst = db.uspWFMGetDataSynchro(this.TenantID).ToList(); if (lst.Count > 0) { lastUpdatedTime = lst[0].dtUpdated.Value.ToString(AppConst.Const_Format_YMDHMS); if (string.Compare(today, lastUpdatedTime) > 0) { lastUpdatedTime = today; } } } ViewBag.UpdatedTime = lastUpdatedTime; }
//検索処理 private List<tblAgentDetailV3> SearchData(string pageIndex, string pageSize, string pageTotal, DateTime dtST, DateTime dtEnd, string vLogin, int iAgentStatus) { List<tblAgentDetailV3> result = new List<tblAgentDetailV3>(); int currentPageIndex = m_CurPageIndex; int currentPageSize = m_CurrentPageSize; int.TryParse(pageIndex, out currentPageIndex); int.TryParse(pageSize, out currentPageSize); m_CurPageIndex = currentPageIndex; m_CurrentPageSize = currentPageSize; string strSortField = GetSortField(m_SortField); string strSort = AppFunction.GetSortDefine(m_Sort); ViewBag.vTenantID = this.TenantID; ViewBag.vTenantSpeciaFlag = this.TenantSpecialFlag; //ページを再計算する CalcPage(pageTotal); using (WFMDBDataContext db = new WFMDBDataContext(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer))) { IMultipleResults results = db.uspWFMGetAgentDetailV3(m_CurPageIndex, m_CurrentPageSize, strSortField, strSort, this.TenantID, dtST.ToString(AppConst.Const_Format_YMDHMS), dtEnd.ToString(AppConst.Const_Format_YMDHMS), vLogin, iAgentStatus); result = results.GetResult<tblAgentDetailV3>().ToList(); tblDataPaged tblPage = results.GetResult<tblDataPaged>().FirstOrDefault(); m_TotalRowCount = tblPage.TotalRowCount; m_CurPageIndex = tblPage.CurPageIndex; m_TotlePageCount = tblPage.TotalPageCount; } return result; }
protected void GetShiftDDList(string shiftID, bool hasExtraHeader, bool isShowTime) { List<SelectListItem> lstItem = new List<SelectListItem>(); List<uspWFMGetShiftResult> lstShift = new List<uspWFMGetShiftResult>(); if (hasExtraHeader) { lstItem.Insert(0, new SelectListItem { Text = "指定なし", Value = "" }); } using (WFMDBDataContext db = new WFMDBDataContext()) { lstShift = db.uspWFMGetShift(this.TenantID, this.TenantSpecialFlag).ToList(); } foreach (var item in lstShift) { if (!isShowTime) lstItem.Add(new SelectListItem { Text = item.vShiftName, Value = item.iShiftID.ToString(), Selected = (item.iShiftID.ToString().Equals(shiftID)) }); else lstItem.Add(new SelectListItem { Text = item.vShiftName + " (" + item.vStartTime + "~" + item.vEndTime + ")", Value = item.iShiftID.ToString(), Selected = (item.iShiftID.ToString().Equals(shiftID)) }); } ViewData["lstShift"] = lstItem; }
//検索処理 private List<tblCallDetailV3> SearchData(string pageIndex, string pageSize, string pageTotal, DateTime dtST, DateTime dtEnd, string vCalleeid, string vCallerid, int skillID, int isessionprofileid, int iConntype, int iCompletedCall, int iQueCall, int iHasTransfer, int iHasACD, int iGroupID) { AppLog.WriteLog(string.Format("CallDetailController SearchData paramter is pageIndex:{0},pageSize:{1},pageTotal:{2},dtST:{3},dtEnd:{4},vCalleeid:{5},skillID:{6},groupid:{7}", pageIndex, pageSize, pageTotal, dtST.ToString(AppConst.Const_Format_YMDHMS) , dtEnd.ToString(AppConst.Const_Format_YMDHMS), vCalleeid, skillID.ToString(),iGroupID.ToString())); List<tblCallDetailV3> result = new List<tblCallDetailV3>(); int currentPageIndex = m_CurPageIndex; int currentPageSize = m_CurrentPageSize; int.TryParse(pageIndex, out currentPageIndex); int.TryParse(pageSize, out currentPageSize); m_CurPageIndex = currentPageIndex; m_CurrentPageSize = currentPageSize; string strSortField = GetSortField(m_SortField); string strSort = AppFunction.GetSortDefine(m_Sort); ViewBag.vTenantID = this.TenantID; ViewBag.vTenantSpeciaFlag = this.TenantSpecialFlag; //ページを再計算する CalcPage(pageTotal); using (WFMDBDataContext db = new WFMDBDataContext(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString,DBServer))) { IMultipleResults results = db.uspWFMGetCallDetailV3(m_CurPageIndex, m_CurrentPageSize, strSortField, strSort, this.TenantID, dtST.ToString(AppConst.Const_Format_YMDHMS), dtEnd.ToString(AppConst.Const_Format_YMDHMS), skillID, vCalleeid, vCallerid, isessionprofileid, iConntype, iCompletedCall, iQueCall, iHasTransfer, iHasACD, iGroupID); result = results.GetResult<tblCallDetailV3>().ToList(); tblDataPaged tblPage = results.GetResult<tblDataPaged>().FirstOrDefault(); m_TotalRowCount = tblPage.TotalRowCount; m_CurPageIndex = tblPage.CurPageIndex; m_TotlePageCount = tblPage.TotalPageCount; } return result; }
//検索処理 private List<tblAgentWeekShift> SearchData(string pageIndex, string pageSize, string pageTotal, DateTime currentDate, string vAgentID) { List<tblAgentWeekShift> result = new List<tblAgentWeekShift>(); int currentPageIndex = m_CurPageIndex; int currentPageSize = m_CurrentPageSize; int.TryParse(pageIndex, out currentPageIndex); int.TryParse(pageSize, out currentPageSize); m_CurPageIndex = currentPageIndex; m_CurrentPageSize = currentPageSize; string strSortField = GetSortField(m_SortField); string strSort = AppFunction.GetSortDefine(m_Sort); ViewBag.vTenantID = this.TenantID; ViewBag.vTenantSpeciaFlag = this.TenantSpecialFlag; ViewBag.currentDate = currentDate.ToString(AppConst.Const_Format_YMD); //ページを再計算する CalcPage(pageTotal); using (WFMDBDataContext db = new WFMDBDataContext()) { IMultipleResults results = db.uspWFMSearchShiftAgentPaged(m_CurPageIndex, m_CurrentPageSize, strSortField, strSort, this.TenantID, currentDate, this.TenantSpecialFlag, vAgentID); result = results.GetResult<tblAgentWeekShift>().ToList(); tblDataPaged tblPage = results.GetResult<tblDataPaged>().FirstOrDefault(); m_TotalRowCount = tblPage.TotalRowCount; m_CurPageIndex = tblPage.CurPageIndex; m_TotlePageCount = tblPage.TotalPageCount; } return result; }
public ActionResult Edit(string vAgentID, string dtStart, string dtEnd, string ddlShift) { using (WFMDBDataContext db = new WFMDBDataContext()) { db.uspWFMInsertOrUpdateShiftAgentSpecial(vAgentID, DateTime.Parse(dtStart), DateTime.Parse(dtEnd), int.Parse(ddlShift)); } return RedirectToAction("index"); }
/// <summary> /// get skill agregation for list box control /// </summary> protected void GetSkillAgregationListForDDL(string selectedAgregationIDs, bool hasExtraHeader = false) { if (string.IsNullOrEmpty(selectedAgregationIDs)) selectedAgregationIDs = "None"; List<SelectListItem> lstItem = new List<SelectListItem>(); List<uspWFMGetAggregationResult> lstSkillAgregation = new List<uspWFMGetAggregationResult>(); if (hasExtraHeader) { lstItem.Insert(0, new SelectListItem { Text = "指定なし", Value = "0" }); } using (WFMDBDataContext db = new WFMDBDataContext()) { lstSkillAgregation = db.uspWFMGetAggregation(this.TenantID, this.TenantSpecialFlag).ToList(); } foreach (var item in lstSkillAgregation) { lstItem.Add(new SelectListItem { Text = item.vAggregationName, Value = item.iAggregationID.ToString(), Selected = selectedAgregationIDs.Contains(item.iAggregationID.ToString()) }); } ViewData["lstSkillAgregation"] = lstItem; }
public JsonResult UpdateAgentShift(string txtTargetDate, int ddlShift, string agentShift) { using (WFMDBDataContext db = new WFMDBDataContext()) { db.uspWFMInsertOrUpdateShiftAgentSpecial(agentShift, DateTime.Parse(txtTargetDate), DateTime.Parse(txtTargetDate), ddlShift); } return this.Json(new { status="ok"}, JsonRequestBehavior.AllowGet); }
/// <summary> /// get all the skill group /// </summary> /// <param name="selectedGroupIDs">these group ids are seleted </param> protected void GetSkillGroupListNoWithSkillAgregationForDDL(string selectedGroupIDs, bool hasExtraHeader = false) { if (string.IsNullOrEmpty(selectedGroupIDs)) selectedGroupIDs = "None"; List<SelectListItem> lstItem = new List<SelectListItem>(); List<uspWFMGetSkillGroupResult> lstSkillGroup = new List<uspWFMGetSkillGroupResult>(); if (hasExtraHeader) { lstItem.Insert(0, new SelectListItem { Text = "指定なし", Value = "0" }); } using (WFMDBDataContext db = new WFMDBDataContext()) { lstSkillGroup = db.uspWFMGetSkillGroup(this.TenantID).ToList(); } foreach (var item in lstSkillGroup) { if (lstItem.Find(p => p.Value == item.iGroupProfileID.ToString()) != null) continue; lstItem.Add(new SelectListItem { Text = item.vCompany, Value = item.iGroupProfileID.ToString(), Selected = selectedGroupIDs.Contains(item.iGroupProfileID.ToString()) }); } ViewData["lstSkillGroup"] = lstItem; }
/// <summary> /// get all the skill group /// </summary> /// <param name="skillAgregationID">skill group in current skill agregation </param> protected void GetSkillGroupListForDDL(int skillAgregationID, bool hasExtraHeader = false) { List<SelectListItem> lstItem = new List<SelectListItem>(); List<uspWFMGetSkillGroupResult> lstSkillGroup = new List<uspWFMGetSkillGroupResult>(); using (WFMDBDataContext db = new WFMDBDataContext()) { lstSkillGroup = db.uspWFMGetSkillGroup(this.TenantID).ToList(); } if (hasExtraHeader) { lstItem.Insert(0, new SelectListItem { Text = "指定なし", Value = "0" }); } foreach (var item in lstSkillGroup) { lstItem.Add(new SelectListItem { Text = item.vCompany, Value = item.iGroupProfileID.ToString(), Selected = (item.iAggregationID.Equals(skillAgregationID)) }); } ViewData["lstSkillGroup"] = lstItem; }