private void SetInfo(Foresight.DataAccess.ServiceType data) { this.IsDisableTime = data.IsDisableTime ? 1 : 0; this.tdServiceTypeName.Value = data.ServiceTypeName; this.tdPaiDanTime.Value = data.PaiDanTime > 0 ? data.PaiDanTime.ToString() : ""; this.tdResponseTime.Value = data.ResponseTime > 0 ? data.ResponseTime.ToString() : ""; this.tdCheckTime.Value = data.CheckTime > 0 ? data.CheckTime.ToString() : ""; this.tdChuliTime.Value = data.ChuliTime > 0 ? data.ChuliTime.ToString() : ""; this.tdBanJieTime.Value = data.BanJieTime > 0 ? data.BanJieTime.ToString() : ""; this.tdHuiFangTime.Value = data.HuiFangTime > 0 ? data.HuiFangTime.ToString() : ""; this.tdGuanDanTime.Value = data.GuanDanTime > 0 ? data.GuanDanTime.ToString() : ""; this.tdSortOrder.Value = data.SortOrder > int.MinValue ? data.SortOrder.ToString() : ""; this.ParentID = data.ParentID; this.tdDisableSend.Value = data.DisableSend ? "1" : "0"; this.tdDisableProcee.Value = data.DisableProcee ? "1" : "0"; this.tdDisableCompelte.Value = data.DisableCompelte ? "1" : "0"; this.tdDisableCallback.Value = data.DisableCallback ? "1" : "0"; this.tdDisableShenJi.Value = data.DisableShenJi ? "1" : "0"; this.tdCloseServiceType.Value = data.CloseServiceType.ToString(); this.tdGongDanType.Value = data.GongDanType > 0 ? data.GongDanType.ToString() : ""; this.tdCallBackServiceType.Value = data.CallBackServiceType > 0 ? data.CallBackServiceType.ToString() : ""; this.tdBanJieServiceType.Value = data.BanJieServiceType > 0 ? data.BanJieServiceType.ToString() : ""; this.tdDisableHolidayTime.Value = data.DisableHolidayTime ? "1" : "0"; this.tdStartHour.Value = string.IsNullOrEmpty(data.StartHour) ? "08:00" : data.StartHour; this.tdEndHour.Value = string.IsNullOrEmpty(data.EndHour) ? "18:00" : data.EndHour; this.tdDisableWorkOffTime.Value = data.DisableWorkOffTime ? "1" : "0"; }
/// <summary> /// /// </summary> /// <param name="myServiceType2List"></param> /// <param name="myServiceType3List"></param> /// <param name="myServiceType"></param> /// <param name="type">1-派单 2-回复 3-核查 4-处理 5-办结 6-回访 7-关单 8-下单</param> /// <returns></returns> public static ServiceType GetAvailableServiceType(ServiceType[] myServiceType2List, ServiceType[] myServiceType3List, ServiceType myServiceType, int typeid = 1) { ServiceType myServiceTypeItem = null; ServiceType[] myServiceTypeList = new ServiceType[] { }; if (myServiceTypeItem == null && myServiceType3List.Length > 0) { myServiceTypeList = myServiceType3List.Where(p => p.PaiDanTime > 0 || p.ResponseTime > 0 || p.CheckTime > 0 || p.ChuliTime > 0 || p.BanJieTime > 0 || p.HuiFangTime > 0 || p.GuanDanTime > 0).ToArray(); } if (myServiceTypeList.Length == 0 && myServiceType2List.Length > 0) { myServiceTypeList = myServiceType2List.Where(p => p.PaiDanTime > 0 || p.ResponseTime > 0 || p.CheckTime > 0 || p.ChuliTime > 0 || p.BanJieTime > 0 || p.HuiFangTime > 0 || p.GuanDanTime > 0).ToArray(); } if (myServiceTypeList.Length == 0) { return(myServiceType); } if (typeid == 1) { myServiceTypeItem = myServiceTypeList.OrderByDescending(p => p.PaiDanTime).FirstOrDefault(); } else if (typeid == 2) { myServiceTypeItem = myServiceTypeList.OrderByDescending(p => p.ResponseTime).FirstOrDefault(); } else if (typeid == 3) { myServiceTypeItem = myServiceTypeList.OrderByDescending(p => p.CheckTime).FirstOrDefault(); } else if (typeid == 4) { myServiceTypeItem = myServiceTypeList.OrderByDescending(p => p.ChuliTime).FirstOrDefault(); } else if (typeid == 5) { myServiceTypeItem = myServiceTypeList.OrderByDescending(p => p.BanJieTime).FirstOrDefault(); } else if (typeid == 6) { myServiceTypeItem = myServiceTypeList.OrderByDescending(p => p.HuiFangTime).FirstOrDefault(); } else if (typeid == 7) { myServiceTypeItem = myServiceTypeList.OrderByDescending(p => p.GuanDanTime).FirstOrDefault(); } //if (myServiceTypeItem == null && myServiceType2List.Length > 0) //{ // if (typeid == 1) // { // myServiceTypeItem = myServiceType2List.Where(p => p.PaiDanTime > 0).OrderByDescending(p => p.PaiDanTime).FirstOrDefault(); // } // else if (typeid == 2) // { // myServiceTypeItem = myServiceType2List.Where(p => p.ResponseTime > 0).OrderByDescending(p => p.ResponseTime).FirstOrDefault(); // } // else if (typeid == 3) // { // myServiceTypeItem = myServiceType2List.Where(p => p.CheckTime > 0).OrderByDescending(p => p.CheckTime).FirstOrDefault(); // } // else if (typeid == 4) // { // myServiceTypeItem = myServiceType2List.Where(p => p.ChuliTime > 0).OrderByDescending(p => p.ChuliTime).FirstOrDefault(); // } // else if (typeid == 5) // { // myServiceTypeItem = myServiceType2List.Where(p => p.BanJieTime > 0).OrderByDescending(p => p.BanJieTime).FirstOrDefault(); // } // else if (typeid == 6) // { // myServiceTypeItem = myServiceType2List.Where(p => p.HuiFangTime > 0).OrderByDescending(p => p.HuiFangTime).FirstOrDefault(); // } // else if (typeid == 7) // { // myServiceTypeItem = myServiceType2List.Where(p => p.GuanDanTime > 0).OrderByDescending(p => p.GuanDanTime).FirstOrDefault(); // } //} if (myServiceTypeItem == null) { myServiceTypeItem = myServiceType; } return(myServiceTypeItem); }
public static ServiceType GetImportServiceType() { var list = SysConfig.GetSysConfigListByType("ServiceType"); if (list.Length == 0) { return(null); } var data = new ServiceType(); decimal decimalValue = 0; var name = Foresight.DataAccess.SysConfigNameDefine.ServiceTypePaiDanTime; var value = SysConfig.GetSysConfigValueByName(list, name); if (!string.IsNullOrEmpty(value)) { decimal.TryParse(value, out decimalValue); data.PaiDanTime = decimalValue; } name = Foresight.DataAccess.SysConfigNameDefine.ServiceTypeCheckTime; value = Foresight.DataAccess.SysConfig.GetSysConfigValueByName(list, name); if (!string.IsNullOrEmpty(value)) { decimal.TryParse(value, out decimalValue); data.CheckTime = decimalValue; } name = Foresight.DataAccess.SysConfigNameDefine.ServiceTypeBanJieTime; value = Foresight.DataAccess.SysConfig.GetSysConfigValueByName(list, name); if (!string.IsNullOrEmpty(value)) { decimal.TryParse(value, out decimalValue); data.BanJieTime = decimalValue; } name = Foresight.DataAccess.SysConfigNameDefine.ServiceTypeResponseTime; value = Foresight.DataAccess.SysConfig.GetSysConfigValueByName(list, name); if (!string.IsNullOrEmpty(value)) { decimal.TryParse(value, out decimalValue); data.ResponseTime = decimalValue; } name = Foresight.DataAccess.SysConfigNameDefine.ServiceTypeChuliTime; value = Foresight.DataAccess.SysConfig.GetSysConfigValueByName(list, name); if (!string.IsNullOrEmpty(value)) { decimal.TryParse(value, out decimalValue); data.ChuliTime = decimalValue; } name = Foresight.DataAccess.SysConfigNameDefine.ServiceTypeGuanDanTime; value = Foresight.DataAccess.SysConfig.GetSysConfigValueByName(list, name); if (!string.IsNullOrEmpty(value)) { decimal.TryParse(value, out decimalValue); data.GuanDanTime = decimalValue; } name = Foresight.DataAccess.SysConfigNameDefine.ServiceTypeHuiFangTime; value = Foresight.DataAccess.SysConfig.GetSysConfigValueByName(list, name); if (!string.IsNullOrEmpty(value)) { decimal.TryParse(value, out decimalValue); data.HuiFangTime = decimalValue; } name = Foresight.DataAccess.SysConfigNameDefine.ServiceTypeDisableHolidayTime; value = Foresight.DataAccess.SysConfig.GetSysConfigValueByName(list, name); if (!string.IsNullOrEmpty(value)) { int intValue = 0; int.TryParse(value, out intValue); data.DisableHolidayTime = intValue == 1; } name = Foresight.DataAccess.SysConfigNameDefine.ServiceTypeStartHour; value = Foresight.DataAccess.SysConfig.GetSysConfigValueByName(list, name); data.StartHour = value; name = Foresight.DataAccess.SysConfigNameDefine.ServiceTypeEndHour; value = Foresight.DataAccess.SysConfig.GetSysConfigValueByName(list, name); data.EndHour = value; return(data); }
public static User[] GetAccpetUserListByServiceProjectID(int ProjectID, bool IsAccpetUser = false, bool IsProcessUser = false, int ServerTypeID = 0) { if (ProjectID <= 0) { return(new User[] { }); } List <SqlParameter> parameters = new List <SqlParameter>(); List <string> conditions = new List <string>(); conditions.Add("([Type]=@Type or [IsAllowAPPUserLogin]=1)"); parameters.Add(new SqlParameter("@Type", UserTypeDefine.APPUser.ToString())); if (IsAccpetUser) { ServiceType typeData = null; if (ServerTypeID > 0) { typeData = ServiceType.GetServiceType(ServerTypeID); } bool isAllowLianJie = false; bool isAllowBiaoYang = false; bool isAllowGuiHua = false; if (typeData != null) { isAllowLianJie = !typeData.DisableShenJi; } if (typeData != null && typeData.ServiceTypeName.Equals("建议表扬")) { isAllowBiaoYang = true; } if (typeData != null && typeData.ServiceTypeName.Equals("规划设计")) { isAllowGuiHua = true; } if (isAllowBiaoYang) { conditions.Add("(PositionName='内业' or [PositionName]='客服')"); } else if (isAllowGuiHua) { conditions.Add("([PositionName]='客服')"); } else { string ModuleCode = "1101172"; if (isAllowLianJie) { ModuleCode = "1101171"; } conditions.Add("exists(select 1 from [RoleModule] where ([UserID]=[User].[UserID] or exists(select 1 from [UserRoles] where [RoleID]=[RoleModule].RoleID and [UserID]=[User].[UserID])) and exists(select 1 from [SysMenu] where ID=[RoleModule].[ModuleId] and [ModuleCode]=@ModuleCode))"); parameters.Add(new SqlParameter("@ModuleCode", ModuleCode)); } } if (IsProcessUser) { conditions.Add("exists(select 1 from [RoleModule] where ([UserID]=[User].[UserID] or exists(select 1 from [UserRoles] where [RoleID]=[RoleModule].RoleID and [UserID]=[User].[UserID])) and exists(select 1 from [SysMenu] where ID=[RoleModule].[ModuleId] and [ModuleCode]='1101160'))"); } var allProjectList = new Project[] { }; if (ProjectID > 0) { List <int> ProjectIDList = new List <int>(); ProjectIDList.Add(ProjectID); List <string> cmdlist = new List <string>(); var myProjectIDList = Project.GetProjectIDListbyIDList(ProjectIDList: ProjectIDList); if (myProjectIDList.Length > 0) { conditions.Add("exists(select 1 from [RoleProject] where [ProjectID] in (" + string.Join(",", myProjectIDList) + ") and ([UserID]=[User].UserID or [RoleID] in (select RoleID from [UserRoles] where [UserID]=[User].UserID)))"); } } if (ServerTypeID > 0) { conditions.Add("exists(select 1 from [UserServiceType] where [ServiceTypeID]=@ServiceTypeID and (UserID=[User].[UserID] or exists(select 1 from [UserRoles] where [RoleID]=[UserServiceType].RoleID and [UserID]=[User].UserID)))"); parameters.Add(new SqlParameter("@ServiceTypeID", ServerTypeID)); } conditions.Add("[PositionName]!='400专员'"); string sqlText = "select * from [User] where " + string.Join(" and ", conditions.ToArray()); //Utility.LogHelper.WriteDebug("GetAccpetUserListByServiceProjectID.sqlText", sqlText); return(GetList <User>(sqlText, parameters).ToArray()); }