Example #1
0
        public ActionResult Zc(string id)
        {
            try
            {
                BROKENRAIL_SECTION_STATUS section = oc.BllSession.IBROKENRAIL_SECTION_STATUSService.Entities.Where(o => o.SECTION_ID == id).FirstOrDefault().ToPOCO();
                if (section != null)
                {
                    section.POINT_NO       = "13834549024";
                    section.MILEAGE_START  = "K190+681~K192+240";
                    section.MILEAGE_END    = "191.200";
                    section.IS_SHOW        = "1";
                    section.RECORD_TIME    = DateTime.Now;
                    section.SECTION_STATUS = "正常";
                    Expression <Func <BROKENRAIL_SECTION_STATUS, object> >[] ignoreProperties =
                        new Expression <Func <BROKENRAIL_SECTION_STATUS, object> >[] { p => p.BROKENRAIL_BDATA_SECTION };
                    oc.BllSession.IBROKENRAIL_SECTION_STATUSService.UpdateEntity(section, ignoreProperties);
                }

                return(Content(id));
            }
            catch (Exception ex)
            {
                RecordLog.RecordError(ex.ToString());
                return(null);
            }
        }
Example #2
0
        public IEnumerable <object> GetStationInfoByPhone([FromBody] string phone)
        {
            if (string.IsNullOrEmpty(phone))
            {
                return(null);
            }
            var member = oc.BllSession.ISYS_MEMBERService.Entities.Where(o => o.MOBILE == phone && o.DEL_FLAG.Equals("0")).FirstOrDefault();

            if (member != null)
            {
                var dept = oc.BllSession.ISYS_DEPTService.Entities.Where(o => o.DEPT_CODE == member.DEPT_CODE).FirstOrDefault();
                if (dept != null)
                {
                    string resultCode = string.Empty;
                    if (dept.DEPT_CODE.Length == 2)
                    {
                        resultCode = dept.DEPT_CODE;
                        return(oc.BllSession.IT_GIS_STATIONService.Entities.Where(o => o.工务段编码.StartsWith(resultCode))
                               .ToList().Select(o => new
                        {
                            PKID = o.车站编码,
                            pymSTATIONAME = SpellCode.GetSpellCode(o.车站) + "-" + o.车站
                        }).DistinctBy(o => o.pymSTATIONAME).OrderBy(o => o.pymSTATIONAME));
                    }
                    else
                    {
                        int count = -1;
                        resultCode = dept.DEPT_CODE;
                        do
                        {
                            try
                            {
                                count = oc.BllSession.IT_GIS_STATIONService.Entities.Where(o => o.工务段编码.StartsWith(resultCode)).Count();
                                if (count > 0)
                                {
                                    return(oc.BllSession.IT_GIS_STATIONService.Entities.Where(o => o.工务段编码.StartsWith(resultCode))
                                           .ToList().Select(o => new
                                    {
                                        PKID = o.车站编码,
                                        pymSTATIONAME = SpellCode.GetSpellCode(o.车站) + "-" + o.车站
                                    }).DistinctBy(o => o.pymSTATIONAME).OrderBy(o => o.pymSTATIONAME));
                                }
                                dept       = oc.BllSession.ISYS_DEPTService.Entities.Where(o => o.DEPT_CODE == dept.PARENT_CODE).FirstOrDefault();
                                resultCode = dept.DEPT_CODE;
                            }
                            catch (Exception ex)
                            {
                                RecordLog.RecordError("[手机获取车站]:" + ex.ToString());
                                return(null);
                            }
                        } while (count <= 0);
                    }
                }
            }
            return(null);
        }