예제 #1
0
파일: Accident.cs 프로젝트: bertyang/Mobile
 public object GetAccident(int page, int rows, string order, string sort,
                           DateTime startTime, DateTime endTime,
                           string accidentName, string address, int?type, int?level,
                           Anchor.FA.Utility.ButtonPower p, C_WorkerDetail userDetail)
 {
     return(DAL.MajorAccident.Accident.GetAccident(page, rows, order, sort, startTime, endTime,
                                                   accidentName, address, type, level, p, userDetail));
 }
예제 #2
0
        public static List <TDesk> GetAllDesk(Anchor.FA.Utility.ButtonPower bp, C_WorkerDetail UserInfo)
        {
            using (MainDataContext dbContext = new MainDataContext(AppConfig.ConnectionStringDispatch))
            {
                switch (bp.GetGroupRangePower("searchBound"))
                {
                case "SearchAll":
                    return(dbContext.TDesk.Where(t => t.受理台类型编码 == 4 || t.受理台类型编码 == 17).ToList());

                case "SearchCenter":   //查找所属分中心
                    return(dbContext.TDesk.Where(t => (t.受理台类型编码 == 4 || t.受理台类型编码 == 17) && t.中心编码 == UserInfo.CenterCode).ToList());

                default:   //没有设置查询权限
                    return(null);
                    //break;
                }
            }
        }
예제 #3
0
 public object GetNoticeList(int page, int rows, string order, string sort, DateTime startTime, DateTime endTime,
                             int sendType, string station, string vehicle, Anchor.FA.Utility.ButtonPower bp, C_WorkerDetail UserInfo)
 {
     return(DAL.Notice.NoticeList.GetNoticeList(page, rows, order, sort, startTime, endTime,
                                                sendType, station, vehicle, bp, UserInfo));
 }
예제 #4
0
 //public object LoadAllTelLogByPage(DateTime begin, DateTime end, int page, int rows, string order, string sort)
 //{
 //    return DAL.BasicInfo.TelLog.LoadAllTelLogByPage(begin,end,page, rows, order, sort);
 //}
 public object TelLogSearch(DateTime begin, DateTime end, string tel, string rec, string op, string res, string des,
                            int page, int rows, string order, string sort, Anchor.FA.Utility.ButtonPower p, C_WorkerDetail userDetail)
 {
     return(DAL.BasicInfo.TelLog.Search(begin, end, tel, rec, op, res, des, page, rows, order, sort, p, userDetail));
 }
예제 #5
0
 public List <TStation> LoadAllStations(Anchor.FA.Utility.ButtonPower bp, C_WorkerDetail UserInfo)
 {
     return(DAL.BasicInfo.Ambulance.LoadAllStations(bp, UserInfo));
 }
예제 #6
0
파일: Task.cs 프로젝트: bertyang/Mobile
 public static string Update(TTask newEntity, string Driver, string Doctor, string Nurse, string Litter, string Salver, string AmbulanceStateTime1, string AmbulanceStateTime2, string AmbulanceStateTime3, string AmbulanceStateTime4, string AmbulanceStateTime5, string AmbulanceStateTime6, string AmbulanceStateTime7
                             , ButtonPower p, C_WorkerDetail UserInfo)
 {
     return(DAL.BasicInfo.Task.Update(newEntity, Driver, Doctor, Nurse, Salver, Litter, AmbulanceStateTime1, AmbulanceStateTime2, AmbulanceStateTime3, AmbulanceStateTime4, AmbulanceStateTime5, AmbulanceStateTime6, AmbulanceStateTime7
                                      , p, UserInfo));
 }
예제 #7
0
 public List <TPerson> LoadDis(Anchor.FA.Utility.ButtonPower p, C_WorkerDetail userDetail)
 {
     return(DAL.BasicInfo.AlarmEvent.LoadDis(p, userDetail));
 }
예제 #8
0
        public static string Update(TTask newEntity, string Driver, string Doctor, string Nurse, string Litter, string Salver, string AmbulanceStateTime1, string AmbulanceStateTime2, string AmbulanceStateTime3, string AmbulanceStateTime4, string AmbulanceStateTime5, string AmbulanceStateTime6, string AmbulanceStateTime7
                                    , ButtonPower p, C_WorkerDetail UserInfo)
        {
            int workID = UserInfo.W.ID;

            using (MainDataContext dbContext = new MainDataContext(AppConfig.ConnectionStringDispatch))
            {
                try
                {
                    TTask entity = dbContext.TTask.FirstOrDefault(t => t.任务编码 == newEntity.任务编码);
                    if (entity == null)
                    {
                        return("找不到该任务,无法修改!");
                    }
                    List <TTaskPersonLink> LtPersonLink = new List <TTaskPersonLink>();
                    TAmbulance             ambInfo      = Ambulance.GetAmbulanceInfo(newEntity.车辆编码);
                    newEntity.分站编码 = ambInfo.分站编码;

                    #region 所有对象处理 和List<TAmbulanceStateTime>对象新增
                    C_WorkerDetail       CWD        = Anchor.FA.DAL.Organize.Worker.GetWorkerDetailById(Convert.ToInt32(workID));
                    string               PersonCode = CWD.PersonCode.FirstOrDefault();
                    List <TModifyRecord> mriList    = new List <TModifyRecord>();

                    //如果 (车辆可编辑)
                    if (true)
                    {
                        Task.UpdateTaskAmb(entity, newEntity, PersonCode, mriList);
                    }
                    //如果 (人员可编辑)
                    if (true)
                    {
                        List <string> LtDriver;
                        if (Driver.Length == 0)
                        {
                            LtDriver = new List <string>();
                        }
                        else
                        {
                            LtDriver = Driver.Split(',').ToList();
                        }
                        List <string> LtDovtor;
                        if (Doctor.Length == 0)
                        {
                            LtDovtor = new List <string>();
                        }
                        else
                        {
                            LtDovtor = Doctor.Split(',').ToList();
                        }
                        List <string> LtNures;
                        if (Nurse.Length == 0)
                        {
                            LtNures = new List <string>();
                        }
                        else
                        {
                            LtNures = Nurse.Split(',').ToList();
                        }
                        List <string> LtLitter;
                        if (Litter.Length == 0)
                        {
                            LtLitter = new List <string>();
                        }
                        else
                        {
                            LtLitter = Litter.Split(',').ToList();
                        }
                        List <string> LtSalver;
                        if (Salver.Length == 0)
                        {
                            LtSalver = new List <string>();
                        }
                        else
                        {
                            LtSalver = Salver.Split(',').ToList();
                        }

                        Task.UpdateTaskPerson(entity, newEntity, PersonCode, mriList, LtPersonLink
                                              , LtDriver, LtDovtor, LtNures, LtLitter, LtSalver);

                        var lsPL = dbContext.TTaskPersonLink.Where(t => t.任务编码 == newEntity.任务编码);
                        if (lsPL.Any())
                        {
                            //Entity FrameWork 居然没有批量删除与新增 汗
                            //foreach (TTaskPersonLink pl in lsPL)
                            //{
                            //    dbContext.TTaskPersonLink.DeleteOnSubmit(pl);
                            //}
                            dbContext.TTaskPersonLink.DeleteAllOnSubmit(lsPL);
                        }
                        dbContext.TTaskPersonLink.InsertAllOnSubmit(LtPersonLink);
                        //foreach (TTaskPersonLink pl in LtPersonLink)
                        //{
                        //    dbContext.TTaskPersonLink.InsertOnSubmit(pl);
                        //}
                    }
                    //如果 EditTimeNode (各时间字段可编辑)
                    bool EditTimeNode = p.IsHaveRangePower("EditTimeNode");
                    List <TAmbulanceStateTime> LtAmbStateTime = new List <TAmbulanceStateTime>();
                    if (EditTimeNode)
                    {
                        int MaxTAmbulanceStateTimeID;
                        var query = from am in dbContext.TAmbulanceStateTime
                                    select am.编码;
                        if (query.Any())
                        {
                            MaxTAmbulanceStateTimeID = query.Max() + 1;
                        }
                        else
                        {
                            MaxTAmbulanceStateTimeID = 1;
                        }

                        //string OperatePersonCode = LoadWorkerRole(Convert.ToInt32(workID)).EmpNo;

                        Task.UpdateTaskStateTime(entity, newEntity, mriList, LtAmbStateTime, MaxTAmbulanceStateTimeID, ambInfo
                                                 , AmbulanceStateTime1
                                                 , AmbulanceStateTime2
                                                 , AmbulanceStateTime3
                                                 , AmbulanceStateTime4
                                                 , AmbulanceStateTime5
                                                 , AmbulanceStateTime6
                                                 , AmbulanceStateTime7
                                                 , PersonCode
                                                 );

                        //TAmbulanceStateTime 不删除只新增保留历史数据
                        //foreach (TAmbulanceStateTime AmbST in LtAmbStateTime)
                        //{
                        //    dbContext.TAmbulanceStateTime.InsertOnSubmit(AmbST);
                        //}
                        dbContext.TAmbulanceStateTime.InsertAllOnSubmit(LtAmbStateTime);
                    }
                    //如果 IsTaskAbdReasonEdit (是否正常结束,异常结束原因编码,备注可编辑)
                    if (true)
                    {
                        Task.UpdateTaskAbdReason(entity, newEntity, PersonCode, mriList);
                    }
                    #endregion
                    #region 数据修改

                    dbContext.TModifyRecord.InsertAllOnSubmit(mriList);
                    dbContext.SubmitChanges();
                    #endregion
                    return("");
                }
                catch (Exception ex)
                {
                    //Log4Net.LogError("", ex.ToString());
                    return(ex.ToString());
                }
            }
        }
예제 #9
0
        public static List <TAmbulance> GetAmbulanceByStationID(string id, Anchor.FA.Utility.ButtonPower bp, C_WorkerDetail UserInfo)
        {
            using (MainDataContext dbContext = new MainDataContext(AppConfig.ConnectionStringDispatch))
            {
                if (string.IsNullOrEmpty(id) || id == "--请选择--")
                {
                    switch (bp.GetGroupRangePower("searchBound"))
                    {
                    case "SearchAll":
                        return(dbContext.TAmbulance.Where(t => t.是否有效 == true).ToList());

                    case "SearchCenter":   //查找所属分中心
                        return((from p in dbContext.TAmbulance
                                join s in dbContext.TStation on p.分站编码 equals s.编码
                                where p.是否有效 == true && s.中心编码 == UserInfo.CenterCode
                                select p).ToList());

                    case "SearchOrganization":   //查找分站
                        return(dbContext.TAmbulance.Where(t => t.是否有效 == true && UserInfo.Sta.Contains(t.分站编码)).ToList());

                    default:   //没有设置查询权限
                        return(null);
                        //break;
                    }
                }
                return(dbContext.TAmbulance.Where(t => t.分站编码 == id && t.是否有效 == true).ToList());
            }
        }
예제 #10
0
파일: TelLog.cs 프로젝트: bertyang/Mobile
        //public static object LoadAllTelLogByPage(DateTime begin, DateTime end, int page, int rows, string order, string sort)
        //{
        //    using (MainDataContext dbContext = new MainDataContext())
        //    {
        //        var list = (from p in dbContext.TTelLog
        //                    join o in dbContext.TZTelLogRecordType on p.记录类型编码 equals o.编码
        //                    join o1 in dbContext.TDesk on p.台号 equals o1.台号
        //                    join o2 in dbContext.TPerson  on p.调度员工号 equals o2.编码
        //                    join o3 in dbContext.TZTelLogResult on p.结果编码 equals o3.编码
        //                    where p.产生时刻 > begin && p.产生时刻 < end
        //                    select new
        //                    {
        //                        ID = p.编码,
        //                        RecordStyle=o.名称,
        //                        Tel=p.对方电话,
        //                        RecordTime = p.产生时刻,
        //                        CallTime = p.通话时刻,
        //                        Desk=o1.显示名称,
        //                        Dispatcher=o2.姓名,
        //                        RecordCode=p.录音号,
        //                        Result=o3.名称,
        //                    }).Take(100);
        //        long total = list.LongCount();
        //        list = list.OrderByDescending(p => p.RecordTime);
        //        list = list.Skip((page - 1) * rows).Take(rows);
        //        var list2 = list.ToList().Select(o => new
        //        {
        //            ID = o.ID,
        //            RecordStyle = o.RecordStyle,
        //            Tel = o.Tel,
        //            RecordTime = o.RecordTime.ToString(),
        //            Desk = o.Desk,
        //            Dispatcher = o.Dispatcher,
        //            RecordCode = o.RecordCode,
        //            Result = o.Result,
        //            CallTime = o.CallTime.ToString()
        //        });
        //        var result = new { total = total, rows = list2.ToList() };

        //        return result;
        //    }

        //}
        public static object Search(DateTime begin, DateTime end, string tel, string rec, string op, string res, string des,
                                    int page, int rows, string order, string sort, Anchor.FA.Utility.ButtonPower b, C_WorkerDetail userDetail)
        {
            using (MainDataContext dbContext = new MainDataContext(AppConfig.ConnectionStringDispatch))
            {
                var list = (from p in dbContext.TTelLog
                            join o in dbContext.TZTelLogRecordType on p.记录类型编码 equals o.编码 into temp
                            from o in temp.DefaultIfEmpty()
                            join o1 in dbContext.TDesk on p.台号 equals o1.台号 into temp1
                            from o1 in temp1.DefaultIfEmpty()
                            join o2 in dbContext.TPerson on p.调度员工号 equals o2.编码 into temp2
                            from o2 in temp2.DefaultIfEmpty()
                            join o3 in dbContext.TZTelLogResult on p.结果编码 equals o3.编码 into temp3
                            from o3 in temp3.DefaultIfEmpty()
                            join o4 in dbContext.TZTelLogOperator on p.操作说明编码 equals o4.编码 into temp4
                            from o4 in temp4.DefaultIfEmpty()

                            where p.产生时刻 > begin && p.产生时刻 <end
                                                            orderby p.产生时刻 descending
                                                            where p.产生时刻> begin && p.产生时刻 < end
                            orderby p.产生时刻 descending
                            select new
                {
                    ID = p.编码,
                    RecordStyle = o.称,
                    Tel = p.对方电话,
                    RecordTime = p.产生时刻,
                    InhaleTime = p.呼入时刻,
                    FellInTime = p.排队时刻,
                    ShakeBellTime = p.震铃时刻,
                    CallTime = p.通话时刻,
                    MiddleHandleTime = p.中间操作时刻,
                    FinishTime = p.结束时刻,
                    Desk = o1.显示名称,
                    Dispatcher = o2.姓名,
                    RecordCode = p.录音号,
                    Result = o3.称,
                    OP = o4.称,
                    CenterCode = p.中心编码,
                });

                if (!string.IsNullOrEmpty(tel))
                {
                    list = list.Where(o => o.Tel.Contains(tel));
                }
                if (!string.IsNullOrEmpty(rec) && rec != "请选择")
                {
                    list = list.Where(o => o.RecordStyle == rec);
                }
                if (!string.IsNullOrEmpty(op) && op != "请选择")
                {
                    list = list.Where(o => o.OP == op);
                }
                if (!string.IsNullOrEmpty(res) && res != "请选择")
                {
                    list = list.Where(o => o.Result == res);
                }
                if (!string.IsNullOrEmpty(des) && des != "请选择")
                {
                    list = list.Where(o => o.Desk == des);
                }

                switch (b.GetGroupRangePower("searchBound"))
                {
                case "SearchAll":    //查找所属分中心
                    break;

                case "SearchCenter":    //查找所属分中心
                    list = list.Where(t => t.CenterCode == userDetail.CenterCode);
                    break;

                default:    //没有设置查询权限
                    return(null);
                }

                long total = list.LongCount();
                //list = list.OrderBy(p => p.ID);
                list = list.Skip((page - 1) * rows).Take(rows);
                var list2 = list.ToList().Select(o => new
                {
                    ID               = o.ID,
                    Num              = o.ID,
                    RecordStyle      = o.RecordStyle,                 //记录类型
                    Tel              = o.Tel,                         //对方编码
                    RecordTime       = o.RecordTime.ToString(),       //产生时刻
                    InhaleTime       = o.InhaleTime.ToString(),       //呼入时刻
                    FellInTime       = o.FellInTime.ToString(),       //排队时刻
                    ShakeBellTime    = o.ShakeBellTime.ToString(),    //振铃时刻
                    CallTime         = o.CallTime.ToString(),         //通话时刻
                    MiddleHandleTime = o.MiddleHandleTime.ToString(), //中间操作时刻
                    FinishTime       = o.FinishTime.ToString(),       //完成时刻
                    Desk             = o.Desk,                        //台号
                    Dispatcher       = o.Dispatcher,                  //调度员
                    RecordCode       = o.RecordCode,                  //录音号
                    Result           = o.Result,                      //结果
                    OP               = o.OP                           //操作说明
                });
                //var   list2  =(from p in list
                //               join o5 in dbContext.TAlarmCall on p.RecordCode equals o5.录音号 into temp5
                //                from o5 in temp5.DefaultIfEmpty()
                //               select new
                //                {
                //                    ID = p.ID,
                //                    RecordStyle = p.RecordStyle,
                //                    Tel = p.Tel,
                //                    RecordTime = p.RecordTime.ToString(),
                //                    Desk = p.Desk,
                //                    Dispatcher = p.Dispatcher,
                //                    RecordCode = p.RecordCode,
                //                    Result = p.Result,
                //                    CallTime = p.CallTime.ToString(),
                //                    AlarmEventCode = o5.事件编码,
                //                });
                var result = new { total = total, rows = list2.ToList() };

                return(result);
            }
        }
예제 #11
0
파일: Worker.cs 프로젝트: bertyang/Mobile
        public C_WorkerDetail GetWorkerDetailById(int userId)
        {
            C_WorkerDetail entity = DAL.Organize.Worker.GetWorkerDetailById(userId);

            return(entity);
        }
예제 #12
0
        public static List <TStation> LoadAllStations(Anchor.FA.Utility.ButtonPower bp, C_WorkerDetail UserInfo)
        {
            using (MainDataContext dbContext = new MainDataContext(AppConfig.ConnectionStringDispatch))
            {
                var list = dbContext.TStation.Where(s => s.是否有效 == true).OrderBy(s => s.顺序号).ToList();

                string Search = bp.GetGroupRangePower("searchBound");

                switch (bp.GetGroupRangePower("searchBound"))
                {
                case "SearchAll":
                    break;

                case "SearchCenter":    //查找所属分中心
                    list = list.Where(p => UserInfo.CenterCode == p.中心编码).ToList();
                    break;

                case "SearchOrganization":    //查找所属分站
                    list = list.Where(p => UserInfo.Sta.Contains(p.编码)).ToList();
                    break;

                default:    //没有设置查询权限
                    return(null);
                    //break;
                }

                return(list);
            }
        }
예제 #13
0
        public static object AmbulanceListSearch(string RealCode, string AmbNum, string Station, string AmbType, string AmbGroup
                                                 , int page, int rows, string order, string sort, bool?IsActive, Anchor.FA.Utility.ButtonPower bp, C_WorkerDetail UserInfo)
        {
            using (MainDataContext dbContext = new MainDataContext(AppConfig.ConnectionStringDispatch))
            {
                var list = (from p in dbContext.TAmbulance

                            join o in dbContext.TZAmbulanceLevel on p.车辆等级编码 equals o.编码 into o_join
                            from o in o_join.DefaultIfEmpty()

                            join o1 in dbContext.TZAmbulanceState on p.工作状态编码 equals o1.编码 into o1_join
                            from o1 in o1_join.DefaultIfEmpty()

                            join o2 in dbContext.TZAmbulanceType on p.车辆类型编码 equals o2.编码 into o2_join
                            from o2 in o2_join.DefaultIfEmpty()

                            join o3 in dbContext.TStation on p.分站编码 equals o3.编码 into o3_join
                            from o3 in o3_join.DefaultIfEmpty()

                            join o4 in dbContext.TTask on p.任务编码 equals o4.任务编码 into o4_join
                            from o4 in o4_join.DefaultIfEmpty()

                            select new
                {
                    ID = p.车辆编码,
                    StationCode = p.分站编码,
                    CenterCode = o3.中心编码,
                    AmbTypeCode = p.车辆类型编码,
                    CardNum = p.车牌号码,
                    RealSign = p.实际标识,
                    CommandAspectId = p.命令单发送去向编码,

                    TaskCode = p.任务编码,
                    UserOrder = p.用户流水号,
                    WorkStateId = p.工作状态编码,
                    OndutyTaskCount = p.当班执行任务数,
                    Driver = p.司机,
                    Doctor = p.医生,
                    Nurse = p.护士,
                    Litter = p.担架工,
                    Salver = p.抢救员,
                    KeyPressTime = p.键时刻,
                    FollowTel = p.随车电话,
                    GroupNumber = p.分组编码,
                    LevelId = p.车辆等级编码,
                    IsOnline = p.是否在线,
                    IsActive = p.是否有效,

                    //Station = o3 == null ? null : o3.名称,
                    //Type = o2 == null ? null : o2.名称,
                    //Level = o == null ? null : o.名称,
                    //State = o1 == null ? null : o1.名称,
                    //Color = o1 == null ? (Nullable<int>)null : o1.颜色,
                    Station = o3.称,
                    Type = o2.称,
                    Level = o.称,
                    State = o1.称,
                    Color = (Nullable <int>)o1.颜色,
                    Tel = p.随车电话,
                    AlarmEventCode = o4.事件编码,
                });
                if (!string.IsNullOrEmpty(RealCode))//实际标识
                {
                    list = list.Where(p => p.RealSign.Contains(RealCode));
                }
                if (!string.IsNullOrEmpty(AmbNum))//车牌号码
                {
                    list = list.Where(p => p.CardNum.Contains(AmbNum));
                }
                if (!string.IsNullOrEmpty(AmbType))//车辆类型编码
                {
                    list = list.Where(p => p.AmbTypeCode == Convert.ToInt32(AmbType));
                }
                if (!string.IsNullOrEmpty(AmbGroup))//分组编码
                {
                    list = list.Where(p => p.GroupNumber == Convert.ToInt32(AmbGroup));
                }

                if (!string.IsNullOrEmpty(Station))//分站编码
                {
                    list = list.Where(p => p.StationCode == Station);
                }
                if (IsActive.HasValue)//是否有效
                {
                    list = list.Where(p => p.IsActive == IsActive);
                }
                string Search = bp.GetGroupRangePower("searchBound");

                switch (bp.GetGroupRangePower("searchBound"))
                {
                case "SearchAll":
                    break;

                case "SearchCenter":    //查找分站
                    list = list.Where(p => UserInfo.CenterCode == p.CenterCode);
                    break;

                case "SearchOrganization":    //查找分站
                    list = list.Where(p => UserInfo.Sta.Contains(p.StationCode));
                    break;

                case "SearchMe":    //查询车辆本人
                    list = list.Where(p => UserInfo.W.Name.Contains(p.Driver) ||
                                      UserInfo.W.Name.Contains(p.Doctor) ||
                                      UserInfo.W.Name.Contains(p.Nurse) ||
                                      UserInfo.W.Name.Contains(p.Litter) ||
                                      UserInfo.W.Name.Contains(p.Salver)
                                      );
                    break;

                default:    //没有设置查询权限
                    return(null);
                    //break;
                }



                long total = list.LongCount();
                list = list.Skip((page - 1) * rows).Take(rows);

                var result = new { total = total, rows = list.ToList() };

                return(result);
            }
        }
예제 #14
0
파일: Person.cs 프로젝트: bertyang/Mobile
        /// <summary>
        /// 根据人员类型(-1全部)和分站编码(-1或""或"--请选择--"时取全部)和是否有效(-1全部、0无效、1有效)获取人员编码、姓名列表
        /// </summary>
        /// <param name="personType">人员类型(-1全部)</param>
        /// <param name="stationCode">分站编码(-1或""或"--请选择--"时取全部)</param>
        /// <param name="isValid">是否有效(-1全部、0无效、1有效)</param>
        /// <returns></returns>
        public static object GetPersonList(int personType, string stationCode, int isValid, ButtonPower p, C_WorkerDetail userDetail)
        {
            using (MainDataContext dbContext = new MainDataContext(AppConfig.ConnectionStringDispatch))
            {
                bool BisValid = Convert.ToBoolean(isValid);

                switch (p.GetGroupRangePower("searchBound"))
                {
                case "SearchAll":    //查找所属分中心
                    return((from t in dbContext.TPerson
                            where (personType == -1 ? true : t.类型编码 == personType)
                            // && (stationCode == "-1" || stationCode == "" || stationCode == "--请选择--" || t.分站编码 == stationCode)
                            && (isValid == -1 ? true : t.是否有效 == BisValid)
                            select new C_Worker
                    {
                        EmpNo = t.编码,
                        Name = t.姓名 + "(" + t.工号 + ")",
                    }).ToList());

                case "SearchCenter":    //查找所属分中心
                    int CenterCode = (from t in dbContext.TStation
                                      where t.编码 == stationCode
                                      select t.中心编码).First();
                    return((from t in dbContext.TPerson
                            join s in dbContext.TStation on t.分站编码 equals s.编码
                            where (personType == -1 ? true : t.类型编码 == personType)
                                                 // && (stationCode == "-1" || stationCode == "" || stationCode == "--请选择--" || t.分站编码 == stationCode)
                            && (isValid == -1 ? true : t.是否有效 == BisValid) &&
                            s.中心编码 == CenterCode //userDetail.CenterCode
                            select new C_Worker
                    {
                        EmpNo = t.编码,
                        Name = t.姓名 + "(" + t.工号 + ")",
                    }).ToList());

                case "SearchOrganization":    //查找分站
                    return((from t in dbContext.TPerson
                            where (personType == -1 ? true : t.类型编码 == personType) &&
                            t.分站编码 == stationCode
                            //&& (stationCode == "-1" || stationCode == "" || stationCode == "--请选择--" || t.分站编码 == stationCode)
                            && (isValid == -1 ? true : t.是否有效 == BisValid)
                            //&& userDetail.Sta.Contains(t.分站编码)
                            select new C_Worker
                    {
                        EmpNo = t.编码,
                        Name = t.姓名 + "(" + t.工号 + ")",
                    }).ToList());

                default:    //没有设置查询权限
                    return(null);
                }
            }
        }
예제 #15
0
 public List <TAmbulance> GetAmbulanceByStationID(string id, Anchor.FA.Utility.ButtonPower bp, C_WorkerDetail UserInfo)
 {
     return(DAL.Notice.NoticeList.GetAmbulanceByStationID(id, bp, UserInfo));
 }
예제 #16
0
 public List <TDesk> GetAllDesk(Anchor.FA.Utility.ButtonPower bp, C_WorkerDetail UserInfo)
 {
     return(DAL.Notice.NoticeList.GetAllDesk(bp, UserInfo));
 }
예제 #17
0
        public static object GetNoticeList(int page, int rows, string order, string sort, DateTime startTime, DateTime endTime,
                                           int sendType, string station, string vehicle, Anchor.FA.Utility.ButtonPower bp, C_WorkerDetail UserInfo)
        {
            using (MainDataContext dbContext = new MainDataContext())
            {
                StringBuilder strSQL = new StringBuilder();
                strSQL.Append("SELECT distinct ID=A.编码,Num=A.编码,content=A.内容,sendTime=A.发送时刻,A.操作员编码,worker=P.姓名,sendList=dbo.GetStrRecAmb(A.编码),typeName=tznt.名称,typeCode=A.类型编码 ");
                strSQL.Append(@",backCount=(select COUNT(*) from MobileGet 
                    where Mobile in (select 目的地编码 from TNoticeLog where 通知单编码=A.编码)
                    and [GetDate] > (select 发送时刻 from TNotice where 编码=A.编码)
                    and [GetDate] < (select dateadd(n,30,发送时刻) from TNotice where 编码=A.编码)) ");
                strSQL.Append("from TNotice A  ");
                //strSQL.Append("left join B_WORKER_ROLE B on rtrim(A.操作员编码)=rtrim(B.TPerson编码) and rtrim(B.TPerson编码) !='' ");
                //strSQL.Append("left join B_WORKER W on B.WorkerID=W.ID ");
                strSQL.Append("inner join TPerson P on A.操作员编码=P.编码 ");
                strSQL.Append("inner join TStation S on P.分站编码=S.编码 ");
                strSQL.Append("left join TZNoticeType tznt on A.类型编码=tznt.编码 ");

                StringBuilder sbWhereClause = new StringBuilder();
                //车辆通知0、台通知1、短信通知2、分中心通知3、分站通知4、收到短信5
                switch (sendType)
                {
                case 0:                  //车辆通知
                    if (vehicle != "-1") //选择了车:只查询车辆通知
                    {
                        strSQL.Append(" inner join TNoticeLog L on A.编码=L.通知单编码 and L.目的地编码 = '" + vehicle + "' and A.类型编码=0 ");
                    }
                    else if (station.Trim() != "-1")                                                                                                                         //没选车,选了分站
                    {
                        strSQL.Append(" inner join TNoticeLog L on A.编码=L.通知单编码 and (L.目的地编码 in( select 车辆编码 from TAmbulance where 分站编码='" + station + "') and A.类型编码=0) "); //车辆通知
                    }
                    WhereClauseUtility.AddIntEqual("A.类型编码", sendType, sbWhereClause);
                    break;

                case 1:   //台通知
                    WhereClauseUtility.AddIntEqual("A.类型编码", sendType, sbWhereClause);
                    break;

                case 2:                         //短信通知
                    if (station.Trim() != "-1") //选了分站
                    {
                        strSQL.Append(" inner join TNoticeLog L on A.编码=L.通知单编码 and ( L.目的地编码 in(select EmpNo from B_WORKER_ROLE");

                        strSQL.Append(" where WorkerID in (select wo.WorkerID from B_WORKER_ORGANIZATION wo left join B_ORGANIZATION b on wo.OrgID = b.ID where b.编码='" + station + "')) and A.类型编码=2) ");   //短信通知2
                    }
                    WhereClauseUtility.AddIntEqual("A.类型编码", sendType, sbWhereClause);
                    break;

                case 4:                                                                                                           //分站通知
                    if (station.Trim() != "-1")                                                                                   //选了分站
                    {
                        strSQL.Append(" inner join TNoticeLog L on A.编码=L.通知单编码 and ( L.目的地编码 ='" + station + "' and A.类型编码=4)"); //分站通知4
                    }
                    WhereClauseUtility.AddIntEqual("A.类型编码", sendType, sbWhereClause);
                    break;

                default:                 //没有选择发送类型
                    if (vehicle != "-1") //选择了车:只查询车辆通知
                    {
                        strSQL.Append(" inner join TNoticeLog L on A.编码=L.通知单编码 and L.目的地编码 = '" + vehicle + "' and A.类型编码=0 ");
                        sbWhereClause.Append(" where A.类型编码=0 ");
                    }
                    else if (station.Trim() != "-1")   //没选车,选了分站
                    {
                        strSQL.Append(" inner join TNoticeLog L on A.编码=L.通知单编码 ");
                        strSQL.Append(" and (L.目的地编码 in( select 车辆编码 from TAmbulance where 分站编码='" + station + "') and A.类型编码=0 ");                                                                       //车辆通知
                        strSQL.Append(" or L.目的地编码 in(select EmpNo from B_WORKER_ROLE");                                                                                                                  //短信通知2
                        strSQL.Append(" where WorkerID in (select wo.WorkerID from B_WORKER_ORGANIZATION wo left join B_ORGANIZATION b on wo.OrgID = b.ID where b.编码='" + station + "')) and A.类型编码=2 "); //短信通知2
                        strSQL.Append(" or L.目的地编码 ='" + station + "' and A.类型编码=4)");                                                                                                                    //分站通知4
                        sbWhereClause.Append(" where A.类型编码 in(0,2,4) ");
                    }
                    break;
                }
                WhereClauseUtility.AddDateTimeGreaterThan("A.发送时刻", startTime, sbWhereClause);
                WhereClauseUtility.AddDateTimeLessThan("A.发送时刻", endTime, sbWhereClause);

                switch (bp.GetGroupRangePower("searchBound"))
                {
                case "SearchAll":
                    break;

                case "SearchCenter":   //查找所属分中心
                    WhereClauseUtility.AddIntEqual("S.中心编码", UserInfo.CenterCode, sbWhereClause);
                    break;

                default:   //没有设置查询权限
                    return(null);
                    //break;
                }

                strSQL.Append(sbWhereClause);

                strSQL.Append(" order by A.发送时刻 desc");
                string sql   = strSQL.ToString();
                var    list1 = dbContext.ExecuteQuery <C_Notice>(sql);
                var    list2 = dbContext.ExecuteQuery <C_Notice>(sql);

                long total = list1.LongCount();
                list2 = list2.OrderByDescending(t => t.sendTime);
                list2 = list2.Skip((page - 1) * rows).Take(rows);

                return(new { total = total, rows = list2.ToList() });
            }
        }
예제 #18
0
 /// <summary>
 /// 查询事件无关的电话
 /// </summary>
 public object GetAlarmCallOthers(int pageIndex, int pageSize, DateTime m_BeginTime, DateTime m_EndTime,
                                  string deskNumber, string attemperCode, string callTypeCode, string callNumber, string recordNumber, string isCallOut
                                  , string remark, Anchor.FA.Utility.ButtonPower p, C_WorkerDetail userDetail)
 {
     return(DAL.BasicInfo.AlarmEvent.GetAlarmCallOthers(pageIndex, pageSize, m_BeginTime, m_EndTime,
                                                        deskNumber, attemperCode, callTypeCode, callNumber, recordNumber, isCallOut
                                                        , remark, p, userDetail));
 }
예제 #19
0
파일: Worker.cs 프로젝트: bertyang/Mobile
        public static C_WorkerDetail GetWorkerDetailById(int id)
        {
            using (MainDataContext dbContext = new MainDataContext())
            {
                C_WorkerDetail entity = new C_WorkerDetail();
                entity.W    = dbContext.B_WORKER.FirstOrDefault(t => t.ID == id);
                entity.WOrg = (from o in dbContext.B_ORGANIZATION
                               join wo in dbContext.B_WORKER_ORGANIZATION on o.ID equals wo.OrgID
                               where wo.WorkerID == id
                               orderby o.Sort
                               select o).ToList();

                entity.WRol = (from r in dbContext.B_ROLE
                               join wr in dbContext.B_WORKER_ROLE on r.ID equals wr.RoleID
                               where wr.WorkerID == id
                               select r).ToList();

                entity.Rol = entity.WRol.Select(t => t.ID).ToArray();
                entity.Org = entity.WOrg.Select(t => t.ID).ToArray();
                entity.Sta = entity.WOrg.Where(t => t.Type == (int)OrgType.Station).Select(t => t.编码).ToArray();

                entity.EmpNo = (from r in dbContext.B_ROLE
                                join wr in dbContext.B_WORKER_ROLE on r.ID equals wr.RoleID
                                where wr.WorkerID == id && wr.EmpNo != ""
                                select wr.EmpNo).ToArray();

                entity.PersonCode = (from r in dbContext.B_ROLE
                                     join wr in dbContext.B_WORKER_ROLE on r.ID equals wr.RoleID
                                     where wr.WorkerID == id && wr.TPerson编码 != ""
                                     select wr.TPerson编码).ToArray();
                //entity.WPer = (from p in dbContext.TPerson
                //               where entity.EmpNo.Contains(p.工号)
                //               select p).ToList();
                entity.WPer = (from p in dbContext.TPerson
                               where entity.PersonCode.Contains(p.编码)
                               select p).ToList();
                entity.WAct = (from a in dbContext.B_ACTION
                               join ra in dbContext.B_ROLE_ACTION on a.ID equals ra.ActionID
                               where a.IsActive == "Y" && entity.Rol.Contains(ra.RoleID)
                               orderby a.OrderID
                               select a
                               ).ToList();
                entity.WRan = (from r in dbContext.B_Range
                               join rr in dbContext.B_ROLE_Range on new { r.ActionId, r.Range } equals new { ActionId = rr.ActionID, rr.Range }
                               where r.IsActive == true && entity.Rol.Contains(rr.RoleID)
                               orderby r.OrderID
                               select r).ToList();
                entity.WSta = (from s in dbContext.TStation
                               where entity.Sta.Contains(s.编码) && s.是否有效 == true
                               orderby s.顺序号
                               select s).ToList();
                #region 之前获取的组织机构是 本人所有属于的组织机构,但是需要一个默认的组织机构。Type == 0

                var WOrgM = (from o in dbContext.B_ORGANIZATION
                             join wo in dbContext.B_WORKER_ORGANIZATION on o.ID equals wo.OrgID
                             where wo.WorkerID == id && wo.Type == 0
                             select o);
                if (WOrgM.Any())
                {
                    entity.WOrgM = WOrgM.First();
                }
                #endregion

                if (entity.WOrgM != null)
                {
                    string centerCode = "1";

                    if (entity.WOrgM.Type == (int)OrgType.Station)
                    {
                        centerCode      = dbContext.B_ORGANIZATION.Single(t => t.ID == entity.WOrgM.ParentID).编码;
                        entity.CenterID = entity.WOrgM.ParentID;
                    }
                    else if (entity.WOrgM.Type == (int)OrgType.Branch)
                    {
                        centerCode = (from o in dbContext.B_ORGANIZATION
                                      join p in dbContext.B_ORGANIZATION on o.ParentID equals p.ID
                                      join g in dbContext.B_ORGANIZATION on p.ParentID equals g.ID
                                      where o.ID == entity.WOrgM.ID
                                      select g.编码).First();
                        entity.CenterID = (from o in dbContext.B_ORGANIZATION
                                           join p in dbContext.B_ORGANIZATION on o.ParentID equals p.ID
                                           join g in dbContext.B_ORGANIZATION on p.ParentID equals g.ID
                                           where o.ID == entity.WOrgM.ID
                                           select g.ID).First();
                    }
                    else if (entity.WOrgM.Type == (int)OrgType.Center)
                    {
                        centerCode      = entity.WOrgM.编码;
                        entity.CenterID = entity.WOrgM.ID;
                    }

                    entity.CenterCode = int.Parse(centerCode);
                }

                return(entity);
            }
        }
예제 #20
0
파일: Accident.cs 프로젝트: bertyang/Mobile
        /// <summary>
        /// 获取所有满足条件的重大事故
        /// </summary>
        /// <param name="page">页码</param>
        /// <param name="rows">行数</param>
        /// <param name="order">排序顺序</param>
        /// <param name="sort">排序字段</param>
        /// <param name="startTime">起始时刻</param>
        /// <param name="endTime">中止时刻</param>
        /// <param name="accidentName">事故名称</param>
        /// <param name="place">区域</param>
        /// <param name="type">事故类型</param>
        /// <param name="level">事故等级</param>
        /// <returns></returns>
        public static object GetAccident(int page, int rows, string order, string sort,
                                         DateTime startTime, DateTime endTime,
                                         string accidentName, string place, int?type, int?level,
                                         Anchor.FA.Utility.ButtonPower b, C_WorkerDetail userDetail)
        {
            using (MainDataContext dbContext = new MainDataContext())
            {
                //高级版病例
                if (AppConfig.GetStringConfigValue("PatientRecordTable") == "M_PatientRecord")
                {
                    var list = from tae in dbContext.TAlarmEvent
                               join tzt in dbContext.TZAccidentType on tae.事故类型编码 equals tzt.编码 into left_tzt
                               from tzt in left_tzt.DefaultIfEmpty()
                               join tzl in dbContext.TZAccidentLevel on tae.事故等级编码 equals tzl.编码 into left_tzl
                               from tzl in left_tzl.DefaultIfEmpty()
                               join tp in dbContext.TPerson on tae.首次调度员编码 equals tp.编码 into left_tp
                               from tp in left_tp.DefaultIfEmpty()
                               where tae.首次受理时刻 >= startTime && tae.首次受理时刻 <= endTime &&
                               tae.事件编码 == tae.所属事故编码 && tae.事故类型编码 != -1
                               select new
                    {
                        关联事件数  = (from t in dbContext.TAlarmEvent where t.所属事故编码 == tae.事件编码 select t).Count(),
                        事故编码   = tae.事件编码,
                        事故名称   = tae.事件名称,
                        调度员    = tp.姓名,
                        事发时间   = tae.首次受理时刻,
                        事发区域   = tae.区域,
                        事故类型   = tzt.称 == null ? "未找到" : tzt.称,
                        事故等级   = tzl.称 == null ? "未找到" : tzl.称,
                        伤亡总人数一 = (from p in dbContext.TAccidentPatient
                                  where (from t in dbContext.TAlarmEvent where t.所属事故编码 == tae.事件编码 select t.事件编码).Contains(p.事故编码)
                                  select p).Count(),
                        伤亡总人数二 = (from tpr in dbContext.M_PatientRecord
                                  where (from t in dbContext.TAlarmEvent where t.所属事故编码 == tae.事件编码 select t.事件编码).Contains(tpr.TaskCode.Substring(1, 16))
                                  select tpr).Count(),
                        伤亡总人数三 = (from tar in dbContext.TAccidentReport
                                  where (from t in dbContext.TAlarmEvent where t.所属事故编码 == tae.事件编码 select t.事件编码).Contains(tar.事故编码)
                                  select tar.受伤人数).Count()
                                 + (from tar in dbContext.TAccidentReport
                                    where (from t in dbContext.TAlarmEvent where t.所属事故编码 == tae.事件编码 select t.事件编码).Contains(tar.事故编码)
                                    select tar.死亡人数).Count(),
                        事故类型编码 = tae.事故类型编码,
                        事故等级编码 = tae.事故等级编码,
                        中心编码   = tae.中心编码
                    };
                    //动态Where
                    if (!string.IsNullOrEmpty(accidentName))
                    {
                        list = list.Where(t => t.事故名称.Contains(accidentName));
                    }
                    if (!string.IsNullOrEmpty(place) && place != "--请选择--")
                    {
                        list = list.Where(t => t.事发区域.Contains(place));
                    }

                    if (type != null)
                    {
                        list = list.Where(t => t.事故类型编码 == type);
                    }

                    if (level != null)
                    {
                        list = list.Where(t => t.事故等级编码 == level);
                    }

                    switch (b.GetGroupRangePower("searchBound"))
                    {
                    case "SearchAll":    //查找所有
                        break;

                    case "SearchCenter":    //查找所属分中心
                        list = list.Where(t => t.中心编码 == userDetail.CenterCode);
                        break;

                    default:    //没有设置查询权限
                        return(null);
                    }

                    long total = list.LongCount();
                    list = list.OrderByDescending(t => t.事发时间);
                    list = list.Skip((page - 1) * rows).Take(rows);

                    if (Config.GetKeyValue("WoundedMode") == "0")
                    {
                        var listAccident = list.ToList().Select(o => new
                        {
                            关联事件数 = o.关联事件数,
                            事故编码  = o.事故编码,
                            关联    = o.事故编码,
                            打印    = o.事故编码,
                            事故名称  = o.事故名称,
                            调度员   = o.调度员,
                            事发时间  = o.事发时间.ToString("yyyy-MM-dd HH:mm:ss"),
                            事发区域  = o.事发区域,
                            事故类型  = o.事故类型,
                            事故等级  = o.事故等级,
                            伤亡总人数 = o.伤亡总人数一,
                        });
                        var result = new { total = total, rows = listAccident.ToList() };
                        return(result);
                    }
                    else if (Config.GetKeyValue("WoundedMode") == "1")
                    {
                        var listAccident = list.ToList().Select(o => new
                        {
                            关联事件数 = o.关联事件数,
                            事故编码  = o.事故编码,
                            关联    = o.事故编码,
                            打印    = o.事故编码,
                            事故名称  = o.事故名称,
                            调度员   = o.调度员,
                            事发时间  = o.事发时间.ToString("yyyy-MM-dd HH:mm:ss"),
                            事发区域  = o.事发区域,
                            事故类型  = o.事故类型,
                            事故等级  = o.事故等级,
                            伤亡总人数 = o.伤亡总人数二,
                        });
                        var result = new { total = total, rows = listAccident.ToList() };
                        return(result);
                    }
                    else if (Config.GetKeyValue("WoundedMode") == "2")
                    {
                        var listAccident = list.ToList().Select(o => new
                        {
                            关联事件数 = o.关联事件数,
                            事故编码  = o.事故编码,
                            关联    = o.事故编码,
                            打印    = o.事故编码,
                            事故名称  = o.事故名称,
                            调度员   = o.调度员,
                            事发时间  = o.事发时间.ToString("yyyy-MM-dd HH:mm:ss"),
                            事发区域  = o.事发区域,
                            事故类型  = o.事故类型,
                            事故等级  = o.事故等级,
                            伤亡总人数 = o.伤亡总人数三,
                        });
                        var result = new { total = total, rows = listAccident.ToList() };
                        return(result);
                    }
                    return(null);
                }
                else //标准版病例
                {
                    var list = from tae in dbContext.TAlarmEvent
                               join tzt in dbContext.TZAccidentType on tae.事故类型编码 equals tzt.编码 into left_tzt
                               from tzt in left_tzt.DefaultIfEmpty()
                               join tzl in dbContext.TZAccidentLevel on tae.事故等级编码 equals tzl.编码 into left_tzl
                               from tzl in left_tzl.DefaultIfEmpty()
                               join tp in dbContext.TPerson on tae.首次调度员编码 equals tp.编码 into left_tp
                               from tp in left_tp.DefaultIfEmpty()
                               where tae.首次受理时刻 >= startTime && tae.首次受理时刻 <= endTime &&
                               tae.事件编码 == tae.所属事故编码 && tae.事故类型编码 != -1
                               select new
                    {
                        关联事件数  = (from t in dbContext.TAlarmEvent where t.所属事故编码 == tae.事件编码 select t).Count(),
                        事故编码   = tae.事件编码,
                        事故名称   = tae.事件名称,
                        调度员    = tp.姓名,
                        事发时间   = tae.首次受理时刻,
                        事发区域   = tae.区域,
                        事故类型   = tzt.称 == null ? "未找到" : tzt.称,
                        事故等级   = tzl.称 == null ? "未找到" : tzl.称,
                        伤亡总人数一 = (from p in dbContext.TAccidentPatient
                                  where (from t in dbContext.TAlarmEvent where t.所属事故编码 == tae.事件编码 select t.事件编码).Contains(p.事故编码)
                                  select p).Count(),
                        伤亡总人数二 = (from tpr in dbContext.TPatientRecord
                                  where (from t in dbContext.TAlarmEvent where t.所属事故编码 == tae.事件编码 select t.事件编码).Contains(tpr.任务编码.Substring(1, 16))
                                  select tpr).Count(),
                        伤亡总人数三 = (from tar in dbContext.TAccidentReport
                                  where (from t in dbContext.TAlarmEvent where t.所属事故编码 == tae.事件编码 select t.事件编码).Contains(tar.事故编码)
                                  select tar.受伤人数).Count()
                                 + (from tar in dbContext.TAccidentReport
                                    where (from t in dbContext.TAlarmEvent where t.所属事故编码 == tae.事件编码 select t.事件编码).Contains(tar.事故编码)
                                    select tar.死亡人数).Count(),
                        事故类型编码 = tae.事故类型编码,
                        事故等级编码 = tae.事故等级编码,
                        中心编码   = tae.中心编码
                    };
                    //动态Where
                    if (!string.IsNullOrEmpty(accidentName))
                    {
                        list = list.Where(t => t.事故名称.Contains(accidentName));
                    }
                    if (!string.IsNullOrEmpty(place) && place != "--请选择--")
                    {
                        list = list.Where(t => t.事发区域.Contains(place));
                    }

                    if (type != null)
                    {
                        list = list.Where(t => t.事故类型编码 == type);
                    }

                    if (level != null)
                    {
                        list = list.Where(t => t.事故等级编码 == level);
                    }

                    switch (b.GetGroupRangePower("searchBound"))
                    {
                    case "SearchAll":    //查找所有
                        break;

                    case "SearchCenter":    //查找所属分中心
                        list = list.Where(t => t.中心编码 == userDetail.CenterCode);
                        break;

                    default:    //没有设置查询权限
                        return(null);
                    }

                    long total = list.LongCount();
                    list = list.OrderByDescending(t => t.事发时间);
                    list = list.Skip((page - 1) * rows).Take(rows);

                    if (Config.GetKeyValue("WoundedMode") == "0")
                    {
                        var listAccident = list.ToList().Select(o => new
                        {
                            关联事件数 = o.关联事件数,
                            事故编码  = o.事故编码,
                            关联    = o.事故编码,
                            打印    = o.事故编码,
                            事故名称  = o.事故名称,
                            调度员   = o.调度员,
                            事发时间  = o.事发时间.ToString("yyyy-MM-dd HH:mm:ss"),
                            事发区域  = o.事发区域,
                            事故类型  = o.事故类型,
                            事故等级  = o.事故等级,
                            伤亡总人数 = o.伤亡总人数一,
                        });
                        var result = new { total = total, rows = listAccident.ToList() };
                        return(result);
                    }
                    else if (Config.GetKeyValue("WoundedMode") == "1")
                    {
                        var listAccident = list.ToList().Select(o => new
                        {
                            关联事件数 = o.关联事件数,
                            事故编码  = o.事故编码,
                            关联    = o.事故编码,
                            打印    = o.事故编码,
                            事故名称  = o.事故名称,
                            调度员   = o.调度员,
                            事发时间  = o.事发时间.ToString("yyyy-MM-dd HH:mm:ss"),
                            事发区域  = o.事发区域,
                            事故类型  = o.事故类型,
                            事故等级  = o.事故等级,
                            伤亡总人数 = o.伤亡总人数二,
                        });
                        var result = new { total = total, rows = listAccident.ToList() };
                        return(result);
                    }
                    else if (Config.GetKeyValue("WoundedMode") == "2")
                    {
                        var listAccident = list.ToList().Select(o => new
                        {
                            关联事件数 = o.关联事件数,
                            事故编码  = o.事故编码,
                            关联    = o.事故编码,
                            打印    = o.事故编码,
                            事故名称  = o.事故名称,
                            调度员   = o.调度员,
                            事发时间  = o.事发时间.ToString("yyyy-MM-dd HH:mm:ss"),
                            事发区域  = o.事发区域,
                            事故类型  = o.事故类型,
                            事故等级  = o.事故等级,
                            伤亡总人数 = o.伤亡总人数三,
                        });
                        var result = new { total = total, rows = listAccident.ToList() };
                        return(result);
                    }
                    return(null);
                }
            }
        }
예제 #21
0
 public object AmbulanceListSearch(string RealCode, string AmbNum, string Station, string AmbType, string AmbGroup
                                   , int page, int rows, string order, string sort, bool?IsActive, Anchor.FA.Utility.ButtonPower bp, C_WorkerDetail UserInfo)
 {
     return(DAL.BasicInfo.Ambulance.AmbulanceListSearch(RealCode, AmbNum, Station, AmbType, AmbGroup
                                                        , page, rows, order, sort, IsActive, bp, UserInfo));
 }
예제 #22
0
파일: Person.cs 프로젝트: bertyang/Mobile
 /// <summary>
 /// 根据人员类型(-1全部)和分站编码(-1或""或"--请选择--"时取全部)和是否有效(-1全部、0无效、1有效)获取人员编码、姓名列表
 /// </summary>
 /// <param name="personType">人员类型(-1全部)</param>
 /// <param name="stationCode">分站编码(-1或""或"--请选择--"时取全部)</param>
 /// <param name="isValid">是否有效(-1全部、0无效、1有效)</param>
 /// <returns></returns>
 public static object GetPersonList(int personType, string stationCode,
                                    int isValid, Anchor.FA.Utility.ButtonPower p, C_WorkerDetail userDetail)
 {
     return(Anchor.FA.DAL.BasicInfo.Person.GetPersonList(personType, stationCode, isValid, p, userDetail));
 }
예제 #23
0
        public static string Update(TAcceptEvent entity)
        {
            using (MainDataContext dbContext = new MainDataContext(AppConfig.ConnectionStringDispatch))
            {
                try
                {
                    TAcceptEvent model = dbContext.TAcceptEvent.FirstOrDefault(t => t.事件编码 == entity.事件编码 && t.受理序号 == entity.受理序号);


                    if (m_ModifyAcceptTypeDic == null)
                    {
                        m_ModifyAcceptTypeDic = new Dictionary <string, int>();

                        //后台根据设置是否可以更改

                        List <Anchor.FA.Model.TParameterAcceptInfo> tpaLs = AlarmEvent.LoadParameterAcceptInfo().Where(t => t.是否可见 == true).ToList();

                        //对应表 TModifyRecord 要在TModifyRecord有 MPDS备注

                        if (IfAllowUpdate("label_AlarmReason", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("主诉", 19);//主诉(呼救原因)
                        }
                        if (IfAllowUpdate("label_PatientName", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("患者姓名", 14);//患者姓名
                        }
                        if (IfAllowUpdate("label_Sex", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("性别", 15);//性别
                        }
                        if (IfAllowUpdate("label_Age", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("年龄", 16);//年龄
                        }
                        if (IfAllowUpdate("label_National", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("国籍", 18);//国籍
                        }
                        if (IfAllowUpdate("label_Folk", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("民族", 17);//民族
                        }
                        if (IfAllowUpdate("label_Judge", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("病种判断", 20);//病种判断
                        }
                        if (IfAllowUpdate("label_LinkMan", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("联系人", 11);//联系人
                        }
                        if (IfAllowUpdate("label_LinkTel", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("联系电话", 12);//联系电话
                        }
                        if (IfAllowUpdate("label_Extension", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("分机", 13);//分机
                        }
                        if (IfAllowUpdate("label_LocalAddr", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("现场地址", 6);//现场地址
                        }
                        if (IfAllowUpdate("label_WaitAddr", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("等车地址", 7);//等车地址
                        }
                        if (IfAllowUpdate("label_SendAddr", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("送往地点", 8);//送往地点
                        }
                        if (IfAllowUpdate("label_Remark", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("备注", 27);//备注
                        }
                        if (IfAllowUpdate("label_IllState", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("病情编码", 21);//
                        }
                        if (IfAllowUpdate("label_LocalAddrType", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("往救地点类型编码", 9);//
                        }
                        if (IfAllowUpdate("label_SendAddrType", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("送往地点类型编码", 10);//
                        }
                        if (IfAllowUpdate("label_PatientCount", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("患者人数", 23);//
                        }
                        if (IfAllowUpdate("label_SpecialNeed", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("特殊要求", 24);//
                        }
                        if (IfAllowUpdate("label_Reserve1", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("保留字段1", 25);//
                        }
                        if (IfAllowUpdate("label_Reserve2", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("保留字段2", 26);//
                        }
                        if (IfAllowUpdate("label_Mpds", tpaLs))
                        {
                            m_ModifyAcceptTypeDic.Add("MPDS备注", 30); //MPDS备注
                        }
                        m_ModifyAcceptTypeDic.Add("是否需要担架", 22);     //是否需要担架


                        //m_ModifyAcceptTypeDic.Add("LocalAddr", 6);//现场地址
                        //m_ModifyAcceptTypeDic.Add("WaitAddr", 7);//等车地址
                        //m_ModifyAcceptTypeDic.Add("SendAddr", 8);//送往地点
                        //m_ModifyAcceptTypeDic.Add("LocalAddrTypeId", 9);//
                        //m_ModifyAcceptTypeDic.Add("SendAddrTypeId", 10);//
                        //m_ModifyAcceptTypeDic.Add("LinkMan", 11);//联系人
                        //m_ModifyAcceptTypeDic.Add("LinkTel", 12);//联系电话
                        //m_ModifyAcceptTypeDic.Add("Extension", 13);//分机
                        //m_ModifyAcceptTypeDic.Add("PatientName", 14);//患者姓名
                        //m_ModifyAcceptTypeDic.Add("Sex", 15);//性别
                        //m_ModifyAcceptTypeDic.Add("Age", 16);//年龄
                        //m_ModifyAcceptTypeDic.Add("Folk", 17);//民族
                        //m_ModifyAcceptTypeDic.Add("National", 18);//国籍
                        //m_ModifyAcceptTypeDic.Add("AlarmReason", 19);//主诉(呼救原因)
                        //m_ModifyAcceptTypeDic.Add("Judge", 20);//病种判断
                        //m_ModifyAcceptTypeDic.Add("IllStateId", 21);//
                        //m_ModifyAcceptTypeDic.Add("IsNeedLitter", 22);//是否需要担架
                        //m_ModifyAcceptTypeDic.Add("PatientCount", 23);//
                        //m_ModifyAcceptTypeDic.Add("SpecialNeed", 24);//
                        //m_ModifyAcceptTypeDic.Add("BackUpOne", 25);//
                        //m_ModifyAcceptTypeDic.Add("BackUpTwo", 26);//
                        //m_ModifyAcceptTypeDic.Add("Remark", 27);//备注
                    }
                    //List<TModifyRecord> mriList = new List<TModifyRecord>();
                    //获得所有property的信息
                    PropertyInfo[] properties        = model.GetType().GetProperties();
                    C_WorkerDetail CWD               = Anchor.FA.DAL.Organize.Worker.GetWorkerDetailById(Convert.ToInt32(entity.责任受理人编码));//使用 责任受理人编码 来存储操作员编码
                    string         OperatePersonCode = CWD.PersonCode.FirstOrDefault();
                    //string OperatePersonCode = Task.LoadWorkerRole(Convert.ToInt32(entity.责任受理人编码)).EmpNo;
                    //string OperatePersonCode = entity.责任受理人编码;



                    foreach (PropertyInfo p in properties)
                    {
                        int typeId = -1;
                        if (m_ModifyAcceptTypeDic.TryGetValue(p.Name, out typeId)) //如果需要修改
                        {
                            object oldObj = p.GetValue(model, null);
                            object newObj = p.GetValue(entity, null);
                            if (!object.Equals(oldObj, newObj))
                            {
                                p.SetValue(model, newObj, null);
                                TModifyRecord mri = new TModifyRecord();
                                mri.编码     = Guid.NewGuid();
                                mri.修改后内容  = newObj == null ? "" : newObj.ToString(); //
                                mri.修改前内容  = oldObj == null ? "" : oldObj.ToString(); //
                                mri.产生时刻   = DateTime.Now;
                                mri.操作员编码  = OperatePersonCode;
                                mri.修改类型编码 = typeId;
                                mri.事件编码   = entity.事件编码;
                                mri.受理序号   = entity.受理序号;
                                //ModifyRecordInfo mri = new ModifyRecordInfo();
                                //mri.Code = Guid.NewGuid();
                                //mri.NewContent = newObj == null ? "" : newObj.ToString();//2011-02-14 如果是null就费了。
                                //mri.OriginContent = oldObj == null ? "" : oldObj.ToString();//2011-02-14 如果是null就费了。
                                //mri.OperateTime = DateTime.Now;
                                //mri.OperatorCode = operatorCode;
                                //mri.TypeId = typeId;
                                //mri.EventCode = originInfo.EventCode;
                                //mriList.Add(mri);

                                dbContext.TModifyRecord.InsertOnSubmit(mri);
                            }
                        }
                    }



                    //model.主诉 = entity.主诉;
                    //model.患者姓名    =  entity.患者姓名    ;
                    //model.性别        =  entity.性别        ;
                    //model.年龄        =  entity.年龄        ;
                    //model.国籍        =  entity.国籍        ;
                    //model.民族        =  entity.民族        ;
                    //model.病种判断    =  entity.病种判断    ;
                    //model.联系人      =  entity.联系人      ;
                    //model.联系电话    =  entity.联系电话    ;
                    //model.分机        =  entity.分机        ;
                    //model.现场地址    =  entity.现场地址    ;
                    //model.等车地址    =  entity.等车地址    ;
                    //model.送往地点    =  entity.送往地点    ;
                    //model.是否需要担架=  entity.是否需要担架;
                    //model.备注        =  entity.备注        ;
                    //ReflectionUtility.CopyObjectProperty<TAcceptEvent>(entity, model);
                    dbContext.SubmitChanges();
                    return("");
                }
                catch (Exception ex)
                {
                    //Log4Net.LogError("", ex.ToString());
                    return(ex.ToString());
                }
            }
        }