/// <summary>
 /// Constructor
 /// </summary>
 /// <param name="statusReport">array of status reports</param>
 public StatusReportEventArgs(StatusReport statusReport)
 {
     _statusReport = statusReport;
 }
        public RegisterV2ViewModel(Register register, FilterParameters filter, int?page = null, StatusReport statusReport = null, List <StatusReport> statusReports = null)
        {
            if (register != null)
            {
                _register           = register;
                SystemId            = register.systemId;
                Owner               = register.owner;
                Name                = register.NameTranslated();
                Description         = register.DescriptionTranslated();
                Status              = register.status;
                DateSubmitted       = register.dateSubmitted;
                Modified            = register.modified;
                DateAccepted        = register.dateAccepted;
                ContainedItemClass  = register.containedItemClass;
                RegisterItems       = register.items;
                ParentRegister      = register.parentRegister;
                Subregisters        = register.subregisters;
                TargetNamespace     = register.targetNamespace;
                Seoname             = register.seoname;
                Versioning          = register.versioning;
                VersionNumber       = register.versionNumber;
                RegisterItemsV2     = GetRegisterItems(register.containedItemClass, register.RegisterItems, filter);
                SynchronizationJobs = new SynchronizationViewModel(register.Synchronizes, page);
                StatusReport        = GetStatsReport(statusReport, statusReports, filter);


                if (register.accessId != null)
                {
                    AccessId = register.accessId.Value;
                }

                if (register.IsAlertRegister())
                {
                    if (string.IsNullOrWhiteSpace(OrderBy))
                    {
                        OrderBy = "dateSubmitted_desc";
                    }
                }
            }
        }
Exemplo n.º 3
0
        public static StatusReport GetDecorationList(string classify, string isDone)
        {
            StatusReport sr   = new StatusReport();
            string       done = "";

            if (isDone == "0")
            {
                //done = " where (分类 = @分类) AND (客服专员 = @客服专员) AND (验收时间 is null) ORDER BY ID DESC";
                done = " where (left(分类,2) = @分类) AND (状态 is null or 状态 = '正在装修') ORDER BY ID DESC";
            }
            else
            {
                //done = " where (分类 = @分类) AND (客服专员 = @客服专员) AND (验收时间 is not null) ORDER BY ID DESC ";
                done = " where (left(分类,2) = @分类) AND (状态 is null or 状态 = '正在装修') ORDER BY ID DESC ";
            }
            string sqlstring = " SELECT top 100 ID, 分类, 房产编号, 业主姓名, 业主电话, 客服专员, 装修负责人, 装修负责人电话, 装修类型, " +
                               " 装修公司押金交纳人, 装修押金金额, 财务收款人, 收款日期, 装修施工证编号, 办理时间, 开工时间, 状态, 装修内容, 是否封阳台, " +
                               " 第一次验收人, 第一次验收时间, 第一次验收结果, 第一次验收结果说明, 第二次验收人, 第二次验收时间, 第二次验收结果, 第二次验收结果说明, " +
                               " 安装单位名称, 执照号码, 负责人姓名, 负责人电话, 押金交纳人, 封阳台押金金额, 收款人, 退款人, 退款日期, 业主确认, 工程指导人员签字, " +
                               " 工程指导人员签字日期, 门岗进场控制签字, 门岗进场控制签字日期, 工程确认进场签字, 工程确认进场签字日期, 工程封装巡查签字, 工程封装巡查签字日期, " +
                               " 封装完毕验收签字, 封装完毕验收签字日期, 工程主管审核, 工程主管审核日期 " +
                               " FROM dbo.基础资料_装修管理 ";

            sqlstring += done;

            DataTable dt = SQLHelper.ExecuteQuery("wyt", sqlstring,
                                                  new SqlParameter("@分类", classify));

            if (dt.Rows.Count == 0)
            {
                sr.status     = "Fail";
                sr.result     = "未查询到任何数据";
                sr.parameters = sqlstring;
                return(sr);
            }
            List <Decoration> decorationList = new List <Decoration>();

            foreach (DataRow dr in dt.Rows)
            {
                Decoration decoration = new Decoration();
                decoration.id                          = DataTypeHelper.GetIntValue(dr["ID"]);
                decoration.classify                    = DataTypeHelper.GetStringValue(dr["分类"]);
                decoration.roomNumber                  = DataTypeHelper.GetStringValue(dr["房产编号"]);
                decoration.name                        = DataTypeHelper.GetStringValue(dr["业主姓名"]);
                decoration.phone                       = DataTypeHelper.GetStringValue(dr["业主电话"]);
                decoration.attache                     = DataTypeHelper.GetStringValue(dr["客服专员"]);
                decoration.decorationMan               = DataTypeHelper.GetStringValue(dr["装修负责人"]);
                decoration.decorationPhone             = DataTypeHelper.GetStringValue(dr["装修负责人电话"]);
                decoration.type                        = DataTypeHelper.GetStringValue(dr["装修类型"]);
                decoration.decorationCompanyChargeMan  = DataTypeHelper.GetStringValue(dr["装修公司押金交纳人"]);
                decoration.decorationCharge            = DataTypeHelper.GetDecimalValue(dr["装修押金金额"]);
                decoration.decorationChargeReceiver    = DataTypeHelper.GetStringValue(dr["财务收款人"]);
                decoration.decorationChargeReceiveDate = DataTypeHelper.GetStringValue(dr["收款日期"]);
                //decoration.teamMembers = GetTeamMember(decoration.id);
                decoration.certificateNumber                 = DataTypeHelper.GetStringValue(dr["装修施工证编号"]);
                decoration.transactTime                      = DataTypeHelper.GetDateStringValue(dr["办理时间"]);
                decoration.startTime                         = DataTypeHelper.GetDateStringValue(dr["开工时间"]);
                decoration.status                            = DataTypeHelper.GetStringValue(dr["状态"]);
                decoration.contents                          = GetDecorationContent(decoration.id);
                decoration.needSealingBalcony                = DataTypeHelper.GetStringValue(dr["是否封阳台"]);
                decoration.checkMan1                         = DataTypeHelper.GetStringValue(dr["第一次验收人"]);
                decoration.checkTime1                        = DataTypeHelper.GetDateStringValue(dr["第一次验收时间"]);
                decoration.checkResult1                      = DataTypeHelper.GetStringValue(dr["第一次验收结果"]);
                decoration.checkResultExplain1               = DataTypeHelper.GetStringValue(dr["第一次验收结果说明"]);
                decoration.checkMan2                         = DataTypeHelper.GetStringValue(dr["第二次验收人"]);
                decoration.checkTime2                        = DataTypeHelper.GetDateStringValue(dr["第二次验收时间"]);
                decoration.checkResult2                      = DataTypeHelper.GetStringValue(dr["第二次验收结果"]);
                decoration.checkResultExplain2               = DataTypeHelper.GetStringValue(dr["第二次验收结果说明"]);
                decoration.installDepartment                 = DataTypeHelper.GetStringValue(dr["安装单位名称"]);
                decoration.licenseNumber                     = DataTypeHelper.GetStringValue(dr["执照号码"]);
                decoration.leaderName                        = DataTypeHelper.GetStringValue(dr["负责人姓名"]);
                decoration.leaderPhone                       = DataTypeHelper.GetStringValue(dr["负责人电话"]);
                decoration.chargeMan                         = DataTypeHelper.GetStringValue(dr["押金交纳人"]);
                decoration.charge                            = DataTypeHelper.GetDecimalValue(dr["封阳台押金金额"]);
                decoration.receiver                          = DataTypeHelper.GetStringValue(dr["收款人"]);
                decoration.refundMan                         = DataTypeHelper.GetStringValue(dr["退款人"]);
                decoration.refundDate                        = DataTypeHelper.GetDateStringValue(dr["退款日期"]);
                decoration.proprietorCheck                   = DataTypeHelper.GetStringValue(dr["业主确认"]);
                decoration.checkEngineer                     = DataTypeHelper.GetStringValue(dr["工程指导人员签字"]);
                decoration.checkEngineerSignDate             = DataTypeHelper.GetDateStringValue(dr["工程指导人员签字日期"]);
                decoration.accessController                  = DataTypeHelper.GetStringValue(dr["门岗进场控制签字"]);
                decoration.accessControllerSignDate          = DataTypeHelper.GetDateStringValue(dr["门岗进场控制签字日期"]);
                decoration.engineeringCheckAccessMan         = DataTypeHelper.GetStringValue(dr["工程确认进场签字"]);
                decoration.engineeringCheckAccessManSignDate = DataTypeHelper.GetDateStringValue(dr["工程确认进场签字日期"]);
                decoration.engineeringPatrolMan              = DataTypeHelper.GetStringValue(dr["工程封装巡查签字"]);
                decoration.engineeringPatrolManSignDate      = DataTypeHelper.GetDateStringValue(dr["工程封装巡查签字日期"]);
                decoration.engineeringCheckMan               = DataTypeHelper.GetStringValue(dr["封装完毕验收签字"]);
                decoration.engineeringCheckManSignDate       = DataTypeHelper.GetDateStringValue(dr["封装完毕验收签字日期"]);
                decoration.engineeringManager                = DataTypeHelper.GetStringValue(dr["工程主管审核"]);
                decoration.engineeringManagerSignDate        = DataTypeHelper.GetDateStringValue(dr["工程主管审核日期"]);
                decorationList.Add(decoration);
            }
            sr.status     = "Success";
            sr.result     = "成功";
            sr.data       = decorationList.ToArray();
            sr.parameters = sqlstring;
            return(sr);
        }
Exemplo n.º 4
0
        public ActionResult View(int id)
        {
            List <StatusReport> reports = new List <StatusReport>();

            using (PixurfDBContext db = new PixurfDBContext())
            {
                Content content = db.Contents.Find(id);

                if (content == null)
                {
                    reports.Add(new StatusReport
                    {
                        Title       = "None",
                        Description = "Content not found",
                        Status      = StatusReport.Warning
                    });
                    Session["Reports"] = reports;
                    return(RedirectToAction("Index", "Home"));
                }

                ViewContentModel vcm = new ViewContentModel
                {
                    Content_ID    = content.Content_ID,
                    Title         = content.Title,
                    Description   = content.Description,
                    Album         = content.Album,
                    Path          = content.Path,
                    User          = content.User,
                    Access        = content.Access,
                    Creation_Date = content.Creation_Date,
                    Status        = content.Status,
                    Type          = content.Type
                };

                if (content.Status == 1)
                {
                    if (content.User_ID == User.Identity.GetUserId())
                    {
                        if (reports.Count > 0)
                        {
                            Session["Reports"] = reports;
                        }

                        vcm.UserAuthenticated = true;
                        return(View(vcm));
                    }

                    UserRelationship relationship = new UserRelationship();
                    //Private
                    if (content.Access == "Private")
                    {
                        StatusReport report = new StatusReport
                        {
                            Title       = "Access Denied",
                            Description = "This content is not accessible",
                            Status      = StatusReport.Warning
                        };

                        reports.Add(report);

                        Session["Reports"] = reports;
                        return(RedirectToAction("Index", "Home"));
                    }
                    //Follower
                    else if (content.Access == "Follower")
                    {
                        if (relationship.Following(content.User_ID, User.Identity.GetUserId()))
                        {
                            if (reports.Count > 0)
                            {
                                Session["Reports"] = reports;
                            }
                            return(View(vcm));
                        }
                        else
                        {
                            StatusReport report = new StatusReport
                            {
                                Title       = "Access Denied",
                                Description = "Only Followers can view this content",
                                Status      = StatusReport.Warning
                            };

                            reports.Add(report);

                            Session["Reports"] = reports;
                            return(RedirectToAction("Index", "Home"));
                        }
                    }
                    //Not Blocked
                    else
                    {
                        if (!relationship.Blocked(content.User_ID, User.Identity.GetUserId()))
                        {
                            if (reports.Count > 0)
                            {
                                Session["Reports"] = reports;
                            }
                            return(View(vcm));
                        }
                        StatusReport report = new StatusReport
                        {
                            Title       = "Error",
                            Description = "Content not found",
                            Status      = StatusReport.Warning
                        };

                        reports.Add(report);

                        Session["Reports"] = reports;
                        return(RedirectToAction("Index", "Home"));
                    }
                }
                else
                {
                    User user = db.Users.Find(User.Identity.GetUserId());
                    if (user != null && user.Admin)
                    {
                        if (reports.Count > 0)
                        {
                            Session["Reports"] = reports;
                        }
                        return(View(vcm));
                    }
                    else
                    {
                        StatusReport report = new StatusReport
                        {
                            Title       = "Error",
                            Description = "Content not found",
                            Status      = StatusReport.Warning
                        };

                        reports.Add(report);

                        Session["Reports"] = reports;
                        return(RedirectToAction("Index", "Home"));
                    }
                }
            }
        }
Exemplo n.º 5
0
        private ReturnCodeEnum internalGetStatus(GenericStatusResquestEnum r, StatusReport rts)
        {
            //Verificar se impressora suporta o comando
            if (r == GenericStatusResquestEnum.ErrorStatus)
            {
                return(ReturnCodeEnum.UnsupportedCommand);
            }

            // Envie o comando de status em tempo real, r é o argumento
            var command = new byte[] { 0x10, 0x04, (byte)r };
            int respLen = 1;

            var data = new byte[0];

            try
            {
                Connection.Open();

                var written = Connection.Write(command);

                System.Threading.Thread.Sleep(100);

                // Colete a resposta
                data = Connection.Read(respLen);
            }
            catch
            {
                //Fazer nada
            }
            finally
            {
                Connection.Close();
            }

            // Resposta inválida
            if (data.Length != respLen)
            {
                return(ReturnCodeEnum.ExecutionFailure);
            }

            switch (r)
            {  //TODO: REVISAR TODOS OS STATUS => PaperRollStatus OK
            case GenericStatusResquestEnum.Status:
                // bit 3: 0- online, 1- offline
                rts.IsOnline = (data[0] & 0x08) == 0;
                break;

            case GenericStatusResquestEnum.OffLineStatus:

                // bit 6: 0- no error, 1- error
                rts.HasError = (data[0] & 0x40) == 0;
                break;

            case GenericStatusResquestEnum.ErrorStatus:
                // bit 3: 0- okay, 1- Not okay
                rts.IsCutterOkay = (data[0] & 8) == 0;

                // bit 5: 0- No fatal (non-recoverable) error, 1- Fatal error
                rts.HasFatalError = (data[0] & 8) == 0;

                // bit 6: 0- No recoverable error, 1- Recoverable error
                rts.HasRecoverableError = (data[0] & 0x40) == 1;
                break;

            case GenericStatusResquestEnum.PaperRollStatus:
                //18 - Ok,  0- Error, 30 - No Paper
                rts.IsPaperPresent = (data[0] & 0x60) == 0;
                break;

            default:
                rts.IsInvalidReport = true;
                break;
            }

            return(ReturnCodeEnum.Success);
        }
Exemplo n.º 6
0
        public static StatusReport GetComplaintList(string classify, string status, string name)
        {
            StatusReport sr = new StatusReport()
            {
                status = "Success",
                result = "成功",
            };
            string condition = "";

            if (status == "未完成")
            {
                condition = " where 分类 = @分类 and 接单人 = @接单人 and (not(状态 = '已完成') and not(状态 = '无效投诉')) " +
                            " order by ID desc ";
            }
            else
            {
                condition = " where 分类 = @分类 and 接单人 = @接单人 and 状态 = '已完成' " +
                            " order by ID desc ";
            }
            string sqlString = " select top 100 ID,投诉接待时间,投诉方式,投诉人姓名,地址,投诉内容,联系电话,投诉处理单编号,处理完成时间,处理完成情况,登记人,责任部门," +
                               " 投诉照片1,投诉照片2,投诉照片3,处理后照片1,处理后照片2,处理后照片3,状态,发单人,发单时间,接单人 " +
                               " from 基础资料_顾客投诉处理登记表 ";

            sqlString += condition;

            DataTable dt = SQLHelper.ExecuteQuery("wyt", sqlString,
                                                  new SqlParameter("@分类", classify),
                                                  new SqlParameter("@接单人", name));

            if (dt.Rows.Count == 0)
            {
                sr.status = "Fail";
                sr.result = "查询条件错误或没有数据";
                return(sr);
            }

            List <object> complainList = new List <object>();

            foreach (DataRow dr in dt.Rows)
            {
                List <string> beforeList = new List <string>();
                List <string> afterList  = new List <string>();

                beforeList.Add(DataTypeHelper.GetStringValue(dr["投诉照片1"]));
                beforeList.Add(DataTypeHelper.GetStringValue(dr["投诉照片2"]));
                beforeList.Add(DataTypeHelper.GetStringValue(dr["投诉照片3"]));
                afterList.Add(DataTypeHelper.GetStringValue(dr["处理后照片1"]));
                afterList.Add(DataTypeHelper.GetStringValue(dr["处理后照片2"]));
                afterList.Add(DataTypeHelper.GetStringValue(dr["处理后照片3"]));
                var complaint = new
                {
                    Id            = DataTypeHelper.GetIntValue(dr["ID"]),
                    ReceptionDate = DataTypeHelper.GetDateStringValue(dr["投诉接待时间"]),
                    Way           = DataTypeHelper.GetStringValue(dr["投诉方式"]),
                    Name          = DataTypeHelper.GetStringValue(dr["投诉人姓名"]),
                    Address       = DataTypeHelper.GetStringValue(dr["地址"]),
                    Content       = DataTypeHelper.GetStringValue(dr["投诉内容"]),
                    Phone         = DataTypeHelper.GetStringValue(dr["联系电话"]),
                    Number        = DataTypeHelper.GetStringValue(dr["投诉处理单编号"]),
                    FinishDate    = DataTypeHelper.GetDateStringValue(dr["处理完成时间"]),
                    FinishStatus  = DataTypeHelper.GetStringValue(dr["处理完成情况"]),
                    Registrant    = DataTypeHelper.GetStringValue(dr["登记人"]),
                    Department    = DataTypeHelper.GetStringValue(dr["责任部门"]),
                    Sender        = DataTypeHelper.GetStringValue(dr["发单人"]),
                    SendTime      = DataTypeHelper.GetDateStringValue(dr["发单时间"]),
                    Receiver      = DataTypeHelper.GetStringValue(dr["接单人"]),
                    Status        = DataTypeHelper.GetStringValue(dr["状态"]),
                    BeforeImage   = beforeList.ToArray(),
                    AfterImage    = afterList.ToArray()
                };
                complainList.Add(complaint);
            }

            sr.data = complainList.ToArray();
            return(sr);
        }
Exemplo n.º 7
0
        public static StatusReport PostRequest(string url, NameValueCollection data)
        {
            WebRequest   request        = null;
            WebResponse  response       = null;
            Stream       requestStream  = null;
            Stream       responseStream = null;
            StreamReader streamReader   = null;
            StatusReport sr             = new StatusReport();

            sr.status = "success";
            sr.result = "成功";
            string result = "";
            string param  = "";

            foreach (string key in data)
            {
                param += String.Format("\"{0}\":\"{1}\",", key, data[key]);
            }
            if (!(String.IsNullOrEmpty(param)))
            {
                param         = param.TrimEnd(',');
                param         = "{" + param + "}";
                sr.parameters = param;
            }
            try
            {
                byte[] byteParam = System.Text.Encoding.UTF8.GetBytes(param);
                request               = WebRequest.Create(url);
                request.Method        = "POST";
                request.ContentType   = "application/x=www-form-urlencoded;charset=utf8";
                request.ContentLength = byteParam.Length;

                requestStream = request.GetRequestStream();
                requestStream.Write(byteParam, 0, byteParam.Length);
                response       = request.GetResponse();
                responseStream = response.GetResponseStream();
                streamReader   = new StreamReader(responseStream);
                result         = streamReader.ReadToEnd();
                sr.data        = result;
            }
            catch (Exception ex)
            {
                sr.status = "fail";
                sr.result = "发生错误:" + ex.Message;
            }
            finally
            {
                if (!(streamReader == null))
                {
                    streamReader.Close();
                }
                if (!(responseStream == null))
                {
                    responseStream.Close();
                }
                if (!(response == null))
                {
                    response.Close();
                }
                if (!(requestStream == null))
                {
                    requestStream.Close();
                }
            }
            return(sr);
        }
Exemplo n.º 8
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="statusReport">array of status reports</param>
 public StatusReportEventArgs(StatusReport statusReport)
 {
     _statusReport = statusReport;
 }
Exemplo n.º 9
0
 void WriteStatusReportForNewItem(string name)
 {
     StatusReport.Write(() => storage[name].Name + " (" + (storage[name].Value * storage[name].Amount).ToKFloats() + ") " + storage[name].Amount + " ");
     StatusReport.AddBarGraph(() => GetBarLenght(storage[name].MaxAmountEverStored), () => storage[name].Amount / storage[name].MaxAmountEverStored, () => new Color(60, 80, 170));
     StatusReport.Write("\n");
 }
Exemplo n.º 10
0
        public ActionResult BussinessHandler_NextLink_ReceiveStaffs(string registId, string userId, string businessId, string linkId, string task, string staffId, string operatorLimit, string roleMemberId, string handlerInfo, string lastInstanceId, string department, string secondDepartment, string thirdDepartment, string registerId)
        {
            StatusReport sr = ProcessDal.BussinessHandler_NextLink_ReceiveStaffs(userId, registId, businessId, linkId, task, staffId, operatorLimit, roleMemberId, handlerInfo, lastInstanceId, department, secondDepartment, thirdDepartment, registerId);

            return(Json(sr, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 11
0
        // GET: Report
        public ActionResult OnGetReport(string ztcode, string level, string func, string username, string before)
        {
            StatusReport sr = new StatusReport();

            if (string.IsNullOrEmpty(level) || string.IsNullOrEmpty(func))
            {
                sr.status = "Fail";
                sr.result = "信息不完整";
                return(Json(sr));
            }
            switch (func)
            {
            case "工单上报":
                sr = RepairDal.GetRepairReport(ztcode, level);
                break;

            case "设备上报":
                if (level == "公司")
                {
                    sr = EquipmentDal.GetEquipmentReportAbstractList();
                }
                else if (level == "一线")
                {
                    sr.status = "Fail";
                    sr.result = "没有此权限";
                }
                else
                {
                    sr = EquipmentDal.GetEquipmentReport(ztcode);
                }
                break;

            case "设备故障上报":
                if (level == "公司")
                {
                    sr = EquipmentDal.GetEquipmentTroubleReportAbstractList();
                }
                else if (level == "一线")
                {
                    sr.status = "Fail";
                    sr.result = "没有此权限";
                }
                else
                {
                    sr = EquipmentDal.GetEquipmentTroubleReport(ztcode);
                }
                break;

            case "投诉上报":
                if (level == "一线" || level == "助理" || level == "项目经理")
                {
                    sr.status = "Fail";
                    sr.result = "没有此权限";
                }
                else
                {
                    sr = ComplainDal.GetComplainReport();
                }
                break;
            }

            return(Json(sr));
        }
Exemplo n.º 12
0
        public ActionResult BussinessHandler_NextLink(string registId, string transferObjectId, string receiveLinkId, string receiveLinkIds, string userId, string businessId, string linkId, string task, string staffId, string lastInstanceId, string department, string secondDepartment, string thirdDepartment, string registerId)
        {
            StatusReport sr = ProcessDal.BussinessHandler_NextLink(registId, transferObjectId, receiveLinkId, receiveLinkIds, userId, businessId, linkId, task, staffId, lastInstanceId, department, secondDepartment, thirdDepartment, registerId);

            return(Json(sr, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 13
0
        public ActionResult BussinessHandler_TableData(string userId, string linkId, string docTableName, string docTableId, string businessId, string transferObjectId, string objectType, string transferObjectType)
        {
            StatusReport sr = ProcessDal.BussinessHandler_TableData(userId, linkId, docTableName, docTableId, businessId, transferObjectId, objectType, transferObjectType);

            return(Json(sr, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 14
0
        //sharePerson person = new sharePerson();
        //public static StatusReport SetShareInfo (string userid, string shareNumber)
        //{
        //    StatusReport sr = new StatusReport();
        //    string sqlString = "insert into 基础_分享 (分享单编号) " +
        //        " select @分享单编号 " +
        //        " select @@identity ";
        //    sr = SQLHelper.Insert("wyt", sqlString, new SqlParameter("@分享单编号", shareNumber));
        //    if (!string.IsNullOrEmpty(sr.data.ToString()))
        //    {
        //        string PID = sr.data.ToString();
        //        sqlString = "insert into 基础_分享_分享情况 (PID,发单人ID,发单时间) " +
        //            " select @PID,@发单人ID,@发单时间 " +
        //            " select @@identity ";
        //        sr = SQLHelper.Insert("wyt", sqlString, new SqlParameter("@PID", PID),
        //            new SqlParameter("@发单人ID", userid),
        //            new SqlParameter("@发单时间", DateTime.Now));
        //        return sr;
        //    }
        //    else
        //    {
        //        return sr;
        //    }
        //}

        public static StatusReport SetShareInfo(string receiverId, string shareNumber, string userId, string userName, string shareTime, string kindergartenName)
        {
            StatusReport sr        = new StatusReport();
            string       dbName    = kindergartenName == "松园幼儿园" ? "cloudsy" : "cloudyd";
            string       sqlString =
                "if not exists (select ID from 基础_分享 where 分享单编号 = @分享单编号) " +
                " begin " +
                " insert into 基础_分享(分享单编号, 分享人姓名) " +
                " select @分享单编号,@分享人姓名 " +
                " select @@identity " +
                " end " +
                " else " +
                " begin " +
                " select ID from 基础_分享 where 分享单编号 = @分享单编号" +
                " end ";

            sr = SQLHelper.Insert(dbName, sqlString, new SqlParameter("@分享单编号", shareNumber), new SqlParameter("@分享人姓名", userName));
            if (!string.IsNullOrEmpty(sr.data.ToString()))
            {
                StatusReport report = new StatusReport();

                /**
                 * 如果存在发单人 = @发单人 ,层数为发单人的层数
                 * 如果不存在发单人 = @发单人,判断接单人 = @发单人,如果存在,层数为接单人层数 + 1 ,如果不存在,层数为1。
                 **/
                string PID    = sr.data.ToString();
                string sqlStr = "if not exists (select ID from 基础_分享_分享情况 where (PID = @PID) and ((发单人ID = @发单人ID and 接单人ID = @接单人ID) or ( 发单人ID = @接单人ID))) " +
                                " begin " +
                                " if not exists (select 层数 from 基础_分享_分享情况 where PID = @PID and 发单人ID = @发单人ID) " +
                                " begin " +
                                " if not exists (select 层数 from 基础_分享_分享情况 where PID = @PID and 接单人ID = @发单人ID) " +
                                " begin " +
                                " select 1 as 层数" +
                                " end " +
                                " else " +
                                " begin " +
                                " select 层数 + 1 as 层数 from 基础_分享_分享情况 where PID = @PID and 接单人ID = @发单人ID " +
                                " end " +
                                " end " +
                                " else " +
                                " begin " +
                                " select 层数 from 基础_分享_分享情况 where PID = @PID and 发单人ID = @发单人ID " +
                                " end " +
                                " end ";
                DataTable dt = SQLHelper.ExecuteQuery(dbName, sqlStr,
                                                      new SqlParameter("@PID", PID),
                                                      new SqlParameter("@发单人ID", userId),
                                                      new SqlParameter("@接单人ID", receiverId));
                if (dt.Rows.Count == 0)
                {
                    report.status = "Fail";
                    report.result = "数据已存在";
                    return(report);
                }
                DataRow dr      = dt.Rows[0];
                object  value   = dr["层数"];
                string  sqlStr1 = "insert into 基础_分享_分享情况 (PID,发单人ID,发单时间,接单人ID,接单时间,层数) " +
                                  " select @PID,@发单人ID,@发单时间,@接单人ID,@接单时间,@层数 " +
                                  " select @@identity ";
                report = SQLHelper.Insert(dbName, sqlStr1,
                                          new SqlParameter("@PID", PID),
                                          new SqlParameter("@发单人ID", userId),
                                          new SqlParameter("@发单时间", shareTime),
                                          new SqlParameter("@接单人ID", receiverId),
                                          new SqlParameter("@接单时间", DateTime.Now),
                                          new SqlParameter("@层数", value));
                return(report);
            }
            return(sr);
        }
Exemplo n.º 15
0
        public ActionResult OnGetLookOverInfo(string ztCode, string func, string route, string name)
        {
            StatusReport sr = new StatusReport();

            return(Json(LookOverDal.GetLookOverInfo(ztCode, func, route, name)));
        }
Exemplo n.º 16
0
        /// <summary>
        /// 判断该OpenId是否对应系统中的某占用者
        /// 如果对应,则返回该占用者的信息
        /// 如果不对应,则返回错误信息
        /// </summary>
        /// <param name="openId"></param>
        /// <returns></returns>
        public static StatusReport CheckOpenIdExist(string openId)
        {
            StatusReport sr = new StatusReport();

            //string sqlString =
            //    "select " +
            //    "占用者ID " +
            //    "from 基础资料_微信占用者绑定表 " +
            //    "where OpenID = @OpenId";

            //int proprietorId = SQLHelper.ExecuteScalar("wyt", sqlString,
            //    new SqlParameter("@OpenId", openId));

            //if (proprietorId > 0)
            //{
            string sqlStr =
                " SELECT ID, 房产单元ID, 房产单元编号, 姓名, 联系电话, 帐套名称, 帐套代码, 客服专员 ,是否占用者本人 " +
                " FROM dbo.小程序_业主信息 " +
                " where OpenID = @OpenID";
            DataTable dt = SQLHelper.ExecuteQuery("wyt", sqlStr, new SqlParameter("@OpenID", openId));

            if (dt.Rows.Count == 0)
            {
                sr.status = "Fail";
                sr.result = "无此用户";
                return(sr);
            }
            //var dataTable = from dtt in dt select dtt;
            DataRow    dr         = dt.Rows[0];
            Proprietor proprietor = new Proprietor();

            proprietor.Id = DataTypeHelper.GetIntValue(dr["ID"]);
            //proprietor.RoomId = DataTypeHelper.GetIntValue(dr["房产单元ID"]);
            //proprietor.RoomNumber = DataTypeHelper.GetStringValue(dr["房产单元编号"]);
            proprietor.Name         = DataTypeHelper.GetStringValue(dr["姓名"]);
            proprietor.Phone        = DataTypeHelper.GetStringValue(dr["联系电话"]);
            proprietor.ZTName       = DataTypeHelper.GetStringValue(dr["帐套名称"]);
            proprietor.ZTCode       = DataTypeHelper.GetStringValue(dr["帐套代码"]);
            proprietor.Server       = DataTypeHelper.GetStringValue(dr["客服专员"]);
            proprietor.IsProprietor = DataTypeHelper.GetStringValue(dr["是否占用者本人"]);
            List <RoomInfo> pList = new List <RoomInfo>();

            foreach (DataRow datarow in dt.Rows)
            {
                RoomInfo roomInfo = new RoomInfo();
                roomInfo.RoomNumber = DataTypeHelper.GetStringValue(datarow["房产单元编号"]);
                roomInfo.RoomId     = DataTypeHelper.GetIntValue(datarow["房产单元ID"]);
                pList.Add(roomInfo);
            }
            proprietor.Room = pList.ToArray();
            sr.status       = "Success";
            sr.result       = "成功";
            sr.data         = JsonConvert.SerializeObject(proprietor);
            return(sr);
            //}
            //else
            //{
            //    sr.status = "Fail";
            //    sr.result = "无此用户";
            //    return sr;
            //}
        }
Exemplo n.º 17
0
        public static StatusReport GetComplainStatistics(string ztCode, string level, string before)
        {
            StatusReport sr = new StatusReport();

            if (level == "助理" || level == "项目经理")
            {
                string sqlString = "SELECT " +
                                   " 帐套名称, " +
                                   " 接单人, " +
                                   " COUNT(dbo.基础资料_顾客投诉处理登记表.ID) AS 投诉数, " +
                                   " COUNT(CASE WHEN 状态 = '无效投诉' THEN ID ELSE NULL END) AS 无效投诉数, " +
                                   " COUNT(CASE WHEN isnull(状态, '') <> '无效投诉' THEN ID ELSE NULL END) AS 有效投诉数, " +
                                   " COUNT(CASE WHEN 状态 = '已完成' THEN ID ELSE NULL END) AS 已解决投诉数, " +
                                   " COUNT(CASE WHEN 状态 <> '已完成' AND isnull(状态, '') <> '无效投诉' THEN ID ELSE NULL END) AS 未解决投诉数, " +
                                   " COUNT(CASE WHEN 状态 = '关闭' THEN ID ELSE NULL END) AS 关闭数 " +
                                   " FROM dbo.基础资料_顾客投诉处理登记表 " +
                                   " LEFT OUTER JOIN dbo.资源帐套表 ON LEFT(dbo.基础资料_顾客投诉处理登记表.分类, 2) = dbo.资源帐套表.帐套代码 " +
                                   " WHERE 帐套代码 = @帐套代码 and left(CONVERT(varchar(10),投诉接待时间,112),6) >=left(CONVERT(varchar(10),dateadd(month,@before,GETDATE()),112),6) " +
                                   " GROUP BY dbo.资源帐套表.帐套名称,接单人 " +
                                   " ORDER BY dbo.资源帐套表.帐套名称,接单人 ";
                DataTable dt = SQLHelper.ExecuteQuery("wyt", sqlString,
                                                      new SqlParameter("@帐套代码", ztCode),
                                                      new SqlParameter("@before", -Convert.ToInt32(before)));
                if (dt.Rows.Count == 0)
                {
                    sr.status = "Fail";
                    sr.result = "未查询到任何记录";
                    return(sr);
                }
                ComplainStatisticsProject csp    = new ComplainStatisticsProject();
                List <ComplainStatistics> csList = new List <ComplainStatistics>();
                foreach (DataRow dr in dt.Rows)
                {
                    ComplainStatistics cs = new ComplainStatistics();
                    //cs.ztName = Convert.ToString(dr["帐套名称"]);
                    cs.name            = Convert.ToString(dr["接单人"]);
                    cs.countReceive    = Convert.ToString(dr["投诉数"]);
                    cs.countValid      = Convert.ToString(dr["有效投诉数"]);
                    cs.countInvalid    = Convert.ToString(dr["无效投诉数"]);
                    cs.countFinished   = Convert.ToString(dr["已解决投诉数"]);
                    cs.countUnfinished = Convert.ToString(dr["未解决投诉数"]);
                    cs.countClosed     = Convert.ToString(dr["关闭数"]);
                    cs.rateValid       = GetPercent(cs.countValid, cs.countReceive);
                    cs.rateInvalid     = GetPercent(cs.countInvalid, cs.countReceive);
                    cs.rateFinished    = GetPercent(cs.countFinished, cs.countValid);
                    cs.rateUnfinished  = GetPercent(cs.countUnfinished, cs.countValid);
                    cs.rateClosed      = GetPercent(cs.countClosed, cs.countValid);
                    csList.Add(cs);
                    csp.ztName          = Convert.ToString(dr["帐套名称"]);
                    csp.countReceive    = Convert.ToString(Convert.ToDecimal(csp.countReceive) + Convert.ToDecimal(cs.countReceive));
                    csp.countValid      = Convert.ToString(Convert.ToDecimal(csp.countValid) + Convert.ToDecimal(cs.countValid));
                    csp.countInvalid    = Convert.ToString(Convert.ToDecimal(csp.countInvalid) + Convert.ToDecimal(cs.countInvalid));
                    csp.countFinished   = Convert.ToString(Convert.ToDecimal(csp.countFinished) + Convert.ToDecimal(cs.countFinished));
                    csp.countUnfinished = Convert.ToString(Convert.ToDecimal(csp.countUnfinished) + Convert.ToDecimal(cs.countUnfinished));
                    csp.countClosed     = Convert.ToString(Convert.ToDecimal(csp.countClosed) + Convert.ToDecimal(cs.countClosed));
                }
                csp.rateValid                  = GetPercent(csp.countValid, csp.countReceive);
                csp.rateInvalid                = GetPercent(csp.countInvalid, csp.countReceive);
                csp.rateFinished               = GetPercent(csp.countFinished, csp.countValid);
                csp.rateUnfinished             = GetPercent(csp.countUnfinished, csp.countValid);
                csp.rateClosed                 = GetPercent(csp.countClosed, csp.countValid);
                csp.complainStatisticsPersonal = csList.ToArray();
                sr.status = "Success";
                sr.result = "成功";
                sr.data   = csp;
                return(sr);
            }
            else
            {
                string sqlString = "SELECT " +
                                   " 帐套名称, " +
                                   " COUNT(dbo.基础资料_顾客投诉处理登记表.ID) AS 投诉数, " +
                                   " COUNT(CASE WHEN 状态 = '无效投诉' THEN ID ELSE NULL END) AS 无效投诉数, " +
                                   " COUNT(CASE WHEN isnull(状态, '') <> '无效投诉' THEN ID ELSE NULL END) AS 有效投诉数, " +
                                   " COUNT(CASE WHEN 状态 = '已完成' THEN ID ELSE NULL END) AS 已解决投诉数, " +
                                   " COUNT(CASE WHEN 状态 <> '已完成' AND isnull(状态, '') <> '无效投诉' THEN ID ELSE NULL END) AS 未解决投诉数, " +
                                   " COUNT(CASE WHEN 状态 = '关闭' THEN ID ELSE NULL END) AS 关闭数 " +
                                   " FROM dbo.基础资料_顾客投诉处理登记表 " +
                                   " LEFT OUTER JOIN dbo.资源帐套表 ON LEFT(dbo.基础资料_顾客投诉处理登记表.分类, 2) = dbo.资源帐套表.帐套代码 " +
                                   " WHERE left(CONVERT(varchar(10),投诉接待时间,112),6) >=left(CONVERT(varchar(10),dateadd(month,@before,GETDATE()),112),6) " +
                                   " GROUP BY dbo.资源帐套表.帐套名称 " +
                                   " ORDER BY dbo.资源帐套表.帐套名称 ";
                DataTable dt = SQLHelper.ExecuteQuery("wyt", sqlString,
                                                      new SqlParameter("@before", -Convert.ToInt32(before)));
                if (dt.Rows.Count == 0)
                {
                    sr.status = "Fail";
                    sr.result = "未查询到任何记录";
                    return(sr);
                }
                ComplainStatisticsCompany        csc    = new ComplainStatisticsCompany();
                List <ComplainStatisticsProject> csList = new List <ComplainStatisticsProject>();
                foreach (DataRow dr in dt.Rows)
                {
                    ComplainStatisticsProject cs = new ComplainStatisticsProject();
                    cs.ztName          = Convert.ToString(dr["帐套名称"]);
                    cs.countReceive    = Convert.ToString(dr["投诉数"]);
                    cs.countValid      = Convert.ToString(dr["有效投诉数"]);
                    cs.countInvalid    = Convert.ToString(dr["无效投诉数"]);
                    cs.countFinished   = Convert.ToString(dr["已解决投诉数"]);
                    cs.countUnfinished = Convert.ToString(dr["未解决投诉数"]);
                    cs.countClosed     = Convert.ToString(dr["关闭数"]);
                    cs.rateValid       = GetPercent(cs.countValid, cs.countReceive);
                    cs.rateInvalid     = GetPercent(cs.countInvalid, cs.countReceive);
                    cs.rateFinished    = GetPercent(cs.countFinished, cs.countValid);
                    cs.rateUnfinished  = GetPercent(cs.countUnfinished, cs.countValid);
                    cs.rateClosed      = GetPercent(cs.countClosed, cs.countValid);
                    csList.Add(cs);
                    csc.countReceive    = Convert.ToString(Convert.ToDecimal(csc.countReceive) + Convert.ToDecimal(cs.countReceive));
                    csc.countValid      = Convert.ToString(Convert.ToDecimal(csc.countValid) + Convert.ToDecimal(cs.countValid));
                    csc.countInvalid    = Convert.ToString(Convert.ToDecimal(csc.countInvalid) + Convert.ToDecimal(cs.countInvalid));
                    csc.countFinished   = Convert.ToString(Convert.ToDecimal(csc.countFinished) + Convert.ToDecimal(cs.countFinished));
                    csc.countUnfinished = Convert.ToString(Convert.ToDecimal(csc.countUnfinished) + Convert.ToDecimal(cs.countUnfinished));
                    csc.countClosed     = Convert.ToString(Convert.ToDecimal(csc.countClosed) + Convert.ToDecimal(cs.countClosed));
                }
                csc.rateValid                 = GetPercent(csc.countValid, csc.countReceive);
                csc.rateInvalid               = GetPercent(csc.countInvalid, csc.countReceive);
                csc.rateFinished              = GetPercent(csc.countFinished, csc.countValid);
                csc.rateUnfinished            = GetPercent(csc.countUnfinished, csc.countValid);
                csc.rateClosed                = GetPercent(csc.countClosed, csc.countValid);
                csc.complainStatisticsProject = csList.ToArray();
                sr.status = "Success";
                sr.result = "成功";
                sr.data   = csc;
                return(sr);
            }
        }
Exemplo n.º 18
0
 public Area(List <Access> accessPoints, List <IMyAirVent> sourceAirVents, List <IMyAirVent> storageAirVents = null, GasTanksManager storageTanksManager = null, StatusReport statusReport = null)
 {
     listOfAccessPoints = accessPoints;
     AccessPointsSetStatusReport(statusReport);
     listOfStorageAirVents    = storageAirVents;
     listOfSourceAirVents     = sourceAirVents;
     this.storageTanksManager = storageTanksManager;
     storageTanksManager.SetStatusReport(statusReport);
 }
Exemplo n.º 19
0
 /// <summary>
 /// PressurizedAreaController constructor.
 /// </summary>
 /// <param name="listExteriorDoors">Doors to non-pressurized area.</param>
 /// <param name="listInteriorDoors">Doors to pressurized area.</param>
 /// <param name="listVentsToO2Tanks">Vents to oxygen storage tanks.</param>
 /// <param name="listVentsToO2Gens">Vents to oxygen generators.</param>
 /// <param name="o2TanksManager">Oxygen tank manager.</param>
 /// <param name="alertSystemManager">Alert system manager.</param>
 public PressurizedAreaController(Area area, Dictionary <AlertStatus, Alert> alertDictionary = null, StatusReport statusReport = null)
 {
     this.area = area;
     if (alertDictionary != null)
     {
         alertSystemManager = new AlertSystemManager <AlertStatus>(alertDictionary);
     }
     SetStatusReport(statusReport);
     Pressurize();
 }
Exemplo n.º 20
0
        public DokStatusReportViewModel(StatusReport statusReport, List <StatusReport> statusReports, string statusType)
        {
            ReportsSelectList    = CreateSelectList(statusReports);
            StatusTypeSelectList = CreateStatusTypeSelectList();
            DokHistoricalChart   = new DokLineChart(statusReports, statusReport, statusType);
            StatusChart          = new StatusLineChart(statusReports, statusReport, statusType);

            if (statusReport != null)
            {
                ReportNotExists = false;
                Id            = statusReport.Id;
                Date          = statusReport.Date;
                NumberOfItems = statusReport.NumberOfIems();

                NumberOfItemsWithMetadataGood      = statusReport.NumberOfItemsWithMetadata(Good);
                NumberOfItemsWithMetadataDeficient = statusReport.NumberOfItemsWithMetadata(Deficient);
                NumberOfItemsWithMetadataNotSet    = statusReport.NumberOfItemsWithMetadata(Notset);
                NumberOfItemsWithMetadataUseable   = statusReport.NumberOfItemsWithMetadata(Useable);

                NumberOfItemsWithProductsheetGood      = statusReport.NumberOfItemsWithProductsheet(Good);
                NumberOfItemsWithProductsheetDeficient = statusReport.NumberOfItemsWithProductsheet(Deficient);
                NumberOfItemsWithProductsheetNotSet    = statusReport.NumberOfItemsWithProductsheet(Notset);
                NumberOfItemsWithProductsheetUseable   = statusReport.NumberOfItemsWithProductsheet(Useable);

                NumberOfItemsWithPresentationRulesGood      = statusReport.NumberOfItemsWithPresentationRules(Good);
                NumberOfItemsWithPresentationRulesDeficient = statusReport.NumberOfItemsWithPresentationRules(Deficient);
                NumberOfItemsWithPresentationRulesNotSet    = statusReport.NumberOfItemsWithPresentationRules(Notset);
                NumberOfItemsWithPresentationRulesUseable   = statusReport.NumberOfItemsWithPresentationRules(Useable);

                NumberOfItemsWithProductSpecificationGood      = statusReport.NumberOfItemsWithProductSpecification(Good);
                NumberOfItemsWithProductSpecificationDeficient = statusReport.NumberOfItemsWithProductSpecification(Deficient);
                NumberOfItemsWithProductSpecificationNotSet    = statusReport.NumberOfItemsWithProductSpecification(Notset);
                NumberOfItemsWithProductSpecificationUseable   = statusReport.NumberOfItemsWithProductSpecification(Useable);


                NumberOfItemsWithWmsGood      = statusReport.NumberOfItemsWithWms(Good);
                NumberOfItemsWithWmsDeficient = statusReport.NumberOfItemsWithWms(Deficient);
                NumberOfItemsWithWmsNotSet    = statusReport.NumberOfItemsWithWms(Notset);
                NumberOfItemsWithWmsUseable   = statusReport.NumberOfItemsWithWms(Useable);

                NumberOfItemsWithWfsGood      = statusReport.NumberOfItemsWithWfs(Good);
                NumberOfItemsWithWfsDeficient = statusReport.NumberOfItemsWithWfs(Deficient);
                NumberOfItemsWithWfsNotSet    = statusReport.NumberOfItemsWithWfs(Notset);
                NumberOfItemsWithWfsUseable   = statusReport.NumberOfItemsWithWfs(Useable);

                NumberOfItemsWithSosiRequirementsGood      = statusReport.NumberOfItemsWithSosiRequirements(Good);
                NumberOfItemsWithSosiRequirementsDeficient = statusReport.NumberOfItemsWithSosiRequirements(Deficient);
                NumberOfItemsWithSosiRequirementsNotSet    = statusReport.NumberOfItemsWithSosiRequirements(Notset);
                NumberOfItemsWithSosiRequirementsUseable   = statusReport.NumberOfItemsWithSosiRequirements(Useable);

                NumberOfItemsWithGmlRequirementsGood      = statusReport.NumberOfItemsWithGmlRequirements(Good);
                NumberOfItemsWithGmlRequirementsDeficient = statusReport.NumberOfItemsWithGmlRequirements(Deficient);
                NumberOfItemsWithGmlRequirementsNotSet    = statusReport.NumberOfItemsWithGmlRequirements(Notset);
                NumberOfItemsWithGmlRequirementsUseable   = statusReport.NumberOfItemsWithGmlRequirements(Useable);

                NumberOfItemsWithAtomFeedGood      = statusReport.NumberOfItemsWithAtomFeed(Good);
                NumberOfItemsWithAtomFeedDeficient = statusReport.NumberOfItemsWithAtomFeed(Deficient);
                NumberOfItemsWithAtomFeedNotSet    = statusReport.NumberOfItemsWithAtomFeed(Notset);
                NumberOfItemsWithAtomFeedUseable   = statusReport.NumberOfItemsWithAtomFeed(Useable);

                NumberOfItemsWithDistributionGood      = statusReport.NumberOfItemsWithDistribution(Good);
                NumberOfItemsWithDistributionDeficient = statusReport.NumberOfItemsWithDistribution(Deficient);
                NumberOfItemsWithDistributionNotSet    = statusReport.NumberOfItemsWithDistribution(Notset);
                NumberOfItemsWithDistributionUseable   = statusReport.NumberOfItemsWithDistribution(Useable);
            }
            else
            {
                ReportNotExists = true;
            }
        }
Exemplo n.º 21
0
        /// <summary>
        /// 通过姓名和联系电话查找看园信息
        /// </summary>
        /// <param name="kindergartenName">幼儿园名称</param>
        /// <param name="name">姓名</param>
        /// <param name="phoneNumber">联系电话</param>
        /// <returns></returns>
        //public static StatusReport GetKanyuanData(string kindergartenName, string name, string phoneNumber)
        //{
        //    StatusReport sr = new StatusReport();

        //    //根据幼儿园名称选择不同的数据库
        //    string dbName = kindergartenName == "松园幼儿园" ? "wyt" : "ydal";
        //    string sqlString = " select ID,姓名,性别,出生年月日,家长姓名,家长与幼儿关系,联系电话,家庭住址,是否上过幼儿园, " +
        //                       " 家长性别,入托意愿,计划入学时间,是否政府摇号,是否预约看园,预约看园时间," +
        //                       " 是否有接待人,接待人姓名,是否校车接送 " +
        //                       " from 基础_看园管理 where 姓名=@姓名 and 联系电话= @联系电话 ";

        //    //在数据库中查询匹配的看园数据
        //    DataTable dt = SQLHelper.ExecuteQuery(dbName, sqlString, new SqlParameter("@姓名", GetDBValue(name)),
        //                                                             new SqlParameter("@联系电话", GetDBValue(phoneNumber)));

        //    //如果未查询到数据,返回错误信息
        //    if (dt.Rows.Count == 0)
        //    {
        //        sr.status = "Fail";
        //        sr.result = "未查询到任何数据";
        //        return sr;
        //    }

        //    //获取查询到的数据,并用以初始化kyData
        //    DataRow dr = dt.Rows[0];
        //    KanyuanData kyData = new KanyuanData();
        //    kyData.id = DataTypeHelper.GetIntValue(dr["ID"]);
        //    kyData.name = DataTypeHelper.GetStringValue(dr["姓名"]);
        //    kyData.gender = DataTypeHelper.GetStringValue(dr["性别"]);
        //    kyData.birth = DataTypeHelper.GetStringValue(dr["出生年月日"]);
        //    kyData.relateName = DataTypeHelper.GetStringValue(dr["家长姓名"]);
        //    kyData.relation = DataTypeHelper.GetStringValue(dr["家长与幼儿关系"]);
        //    kyData.phoneNumber = DataTypeHelper.GetStringValue(dr["联系电话"]);
        //    kyData.address = DataTypeHelper.GetStringValue(dr["家庭住址"]);
        //    kyData.isYoueryuan = DataTypeHelper.GetStringValue(dr["是否上过幼儿园"]);
        //    kyData.relateGender = DataTypeHelper.GetStringValue(dr["家长性别"]);
        //    kyData.desire = DataTypeHelper.GetStringValue(dr["入托意愿"]);
        //    kyData.ruyuanDate = DataTypeHelper.GetStringValue(dr["计划入学时间"]);
        //    kyData.joinLottery = DataTypeHelper.GetStringValue(dr["是否政府摇号"]);
        //    kyData.isAppointment = DataTypeHelper.GetStringValue(dr["是否预约看园"]);
        //    kyData.appointmentDate = DataTypeHelper.GetStringValue(dr["预约看园时间"]);
        //    kyData.haveReceiver = DataTypeHelper.GetStringValue(dr["是否有接待人"]);
        //    kyData.receiverName = DataTypeHelper.GetStringValue(dr["接待人姓名"]);
        //    kyData.needSchoolBus = DataTypeHelper.GetStringValue(dr["是否校车接送"]);

        //    //返回查询到的数据
        //    sr.status = "Success";
        //    sr.result = "成功";
        //    sr.data = kyData;

        //    return sr;
        //}

        public static StatusReport GetKanyuanData(string kindergartenName, string openid)
        {
            StatusReport sr = new StatusReport();

            //根据幼儿园名称选择不同的数据库
            string dbName = kindergartenName == "松园幼儿园" ? "localsy" : "localyd";
            //string sqlString = " select ID,姓名,性别,出生年月日,家长姓名,家长与幼儿关系,联系电话,家庭住址,是否上过幼儿园, " +
            //                   " 家长性别,入托意愿,计划入学时间,是否政府摇号,是否预约看园,预约看园时间," +
            //                   " 是否有接待人,接待人姓名,是否校车接送 " +
            //                   " from 基础_看园管理 where 姓名=@姓名 and 联系电话= @联系电话 ";

            //在数据库中查询匹配的看园数据
            //DataTable dt = SQLHelper.ExecuteQuery(dbName, sqlString, new SqlParameter("@姓名", GetDBValue(name)),
            //new SqlParameter("@联系电话", GetDBValue(phoneNumber)));

            string sqlString = " select ID,姓名,性别,出生年月日,家长姓名,家长与幼儿关系,联系电话,家庭住址,是否上过幼儿园, " +
                               " 家长性别,入托意愿,计划入学时间,是否政府摇号,是否预约看园,预约看园时间," +
                               " 是否有接待人,接待人姓名,是否校车接送 " +
                               " from 基础_看园管理 where openid = @openid " +
                               " order by ID desc ";

            //在数据库中查询匹配的看园数据
            DataTable dt = SQLHelper.ExecuteQuery(dbName, sqlString, new SqlParameter("@openid", GetDBValue(openid)));

            //如果未查询到数据,返回错误信息
            if (dt.Rows.Count == 0)
            {
                sr.status = "Fail";
                sr.result = "未查询到任何数据";
                return(sr);
            }

            //获取查询到的数据,并用以初始化kyData
            DataRow     dr     = dt.Rows[0];
            KanyuanData kyData = new KanyuanData();

            kyData.id              = DataTypeHelper.GetIntValue(dr["ID"]);
            kyData.name            = DataTypeHelper.GetStringValue(dr["姓名"]);
            kyData.gender          = DataTypeHelper.GetStringValue(dr["性别"]);
            kyData.birth           = DataTypeHelper.GetDateStringValue(dr["出生年月日"]);
            kyData.relateName      = DataTypeHelper.GetStringValue(dr["家长姓名"]);
            kyData.relation        = DataTypeHelper.GetStringValue(dr["家长与幼儿关系"]);
            kyData.phoneNumber     = DataTypeHelper.GetStringValue(dr["联系电话"]);
            kyData.address         = DataTypeHelper.GetStringValue(dr["家庭住址"]);
            kyData.isYoueryuan     = DataTypeHelper.GetStringValue(dr["是否上过幼儿园"]);
            kyData.relateGender    = DataTypeHelper.GetStringValue(dr["家长性别"]);
            kyData.desire          = DataTypeHelper.GetStringValue(dr["入托意愿"]);
            kyData.ruyuanDate      = DataTypeHelper.GetDateStringValue(dr["计划入学时间"]);
            kyData.joinLottery     = DataTypeHelper.GetStringValue(dr["是否政府摇号"]);
            kyData.isAppointment   = DataTypeHelper.GetStringValue(dr["是否预约看园"]);
            kyData.appointmentDate = DataTypeHelper.GetDateStringValue(dr["预约看园时间"]);
            kyData.haveReceiver    = DataTypeHelper.GetStringValue(dr["是否有接待人"]);
            kyData.receiverName    = DataTypeHelper.GetStringValue(dr["接待人姓名"]);
            kyData.needSchoolBus   = DataTypeHelper.GetStringValue(dr["是否校车接送"]);

            //返回查询到的数据
            sr.status = "Success";
            sr.result = "成功";
            sr.data   = kyData;

            return(sr);
        }
Exemplo n.º 22
0
        /// <summary>
        /// 接收小程序入园报名界面提交的数据,并将其保存到数据库中
        /// </summary>
        /// <param name="kindergartenName">幼儿园</param>
        /// <param name="name">姓名</param>
        /// <param name="gender">性别</param>
        /// <param name="bagPhone">书包电话</param>
        /// <param name="birth">出生日期</param>
        /// <param name="address">家庭住址</param>
        /// <param name="source">学生来源</param>
        /// <param name="guardianName">监护人</param>
        /// <param name="relation">与幼儿关系</param>
        /// <param name="guardianPhone">监护人电话</param>
        /// <param name="guardianCredentialType">监护人身份证件类型</param>
        /// <param name="guardianIdNumber">监护人证件号码</param>
        /// <param name="occupation">监护人职业</param>
        /// <param name="job">监护人工作单位及职位</param>
        /// <param name="guardianName2">监护人2</param>
        /// <param name="relation2">与幼儿关系2</param>
        /// <param name="guardianPhone2">监护人电话2</param>
        /// <param name="guardianCredentialType2">监护人身份证件类型2</param>
        /// <param name="guardianIDNumber2">监护人证件号码2</param>
        /// <param name="occupation2">监护人职业2</param>
        /// <param name="job2">监护人工作单位及职位2</param>
        /// <param name="guardianName3">监护人3</param>
        /// <param name="relation3">与幼儿关系3</param>
        /// <param name="guardianPhone3">监护人电话3</param>
        /// <param name="guardianCredentialType3">监护人身份证件类型3</param>
        /// <param name="guardianIDNumber3">监护人证件号码3</param>
        /// <param name="occupation3">监护人职业3</param>
        /// <param name="job3">监护人工作单位及职位3</param>
        /// <param name="guardianName4">监护人4</param>
        /// <param name="relation4">与幼儿关系4</param>
        /// <param name="guardianPhone4">监护人电话4</param>
        /// <param name="guardianCredentialType4">监护人身份证件类型4</param>
        /// <param name="guardianIDNumber4">监护人证件号码4</param>
        /// <param name="occupation4">监护人职业4</param>
        /// <param name="job4">监护人工作单位及职位4</param>
        /// <param name="healthRemarks">健康备注</param>
        /// <param name="foodDragRemarks">食品药品备注</param>
        /// <param name="healthCareNote">保健手册</param>
        /// <param name="examination">体检手册</param>
        /// <param name="vaccineNote">预防针本</param>
        /// <param name="kidCredentialType">幼儿身份证件类型</param>
        /// <param name="kidIDNumber">幼儿身份证件号码</param>
        /// <param name="kidNation">民族</param>
        /// <param name="kidNationality">国籍地区</param>
        /// <param name="gangaotai">港澳台侨外</param>
        /// <param name="area">户籍地区</param>
        /// <param name="areaDetail">户籍地区详情</param>
        /// <param name="residenceNature">户口性质</param>
        /// <param name="nonagricultureType">非农业户口类型</param>
        /// <param name="disabled">是否残疾</param>
        /// <param name="disabledType">残疾类型</param>
        /// <param name="leftChild">是否留守儿童</param>
        /// <param name="onlyChild">是否独生子女</param>
        /// <param name="migrantWorkerChild">是否进城务工人员子女</param>
        /// <param name="orphan">是否孤儿</param>
        /// <param name="healthCondition">健康状况</param>
        /// <param name="bloodType">血型</param>
        /// <param name="teacherName">老师姓名</param>
        /// <param name="patriarchName">家长姓名</param>
        /// <param name="websiteName">网站名称</param>
        /// <param name="examDate">体检时间</param>
        /// <param name="kyId">看园ID</param>
        /// <returns></returns>
        public static StatusReport SetSignUpData(string kindergartenName, string name, string gender, string bagPhone, string birth,
                                                 string address, string source, string guardianName, string relation, string guardianPhone, string guardianCredentialType,
                                                 string guardianIdNumber, string occupation, string job, string guardianName2, string relation2, string guardianPhone2,
                                                 string guardianCredentialType2, string guardianIDNumber2, string occupation2, string job2, string guardianName3,
                                                 string relation3, string guardianPhone3, string guardianCredentialType3, string guardianIDNumber3, string occupation3,
                                                 string job3, string guardianName4, string relation4, string guardianPhone4, string guardianCredentialType4,
                                                 string guardianIDNumber4, string occupation4, string job4, string healthRemarks, string foodDragRemarks, string healthCareNote,
                                                 string examination, string vaccineNote, string kidCredentialType, string kidIDNumber, string kidNation, string kidNationality,
                                                 string gangaotai, string area, string areaDetail, string residenceNature, string nonagricultureType, string disabled,
                                                 string disabledType, string leftChild, string onlyChild, string migrantWorkerChild, string orphan, string healthCondition,
                                                 string bloodType, string teacherName, string patriarchName, string websiteName, string examDate, string kyId, string openid,
                                                 string shareNumber)
        {
            StatusReport sr        = new StatusReport();
            string       dbName    = kindergartenName == "松园幼儿园" ? "cloudsy" : "cloudyd";
            string       sqlStr    = "select ID from 基础_看园管理 where 姓名 = @姓名 and 联系电话 = @联系电话";
            string       kanyuanId = null;
            DataTable    dt        = SQLHelper.ExecuteQuery(dbName, sqlStr, new SqlParameter("@姓名", name), new SqlParameter("@联系电话", bagPhone));

            if (!(dt.Rows.Count == 0))
            {
                DataRow dr = dt.Rows[0];
                kanyuanId = DataTypeHelper.GetIntValue(dr["ID"]).ToString();
            }

            string sqlString = " if not exists(select * from 基础_小程序报名 where 姓名=@姓名 and 书包电话= @书包电话) " +
                               " insert into 基础_小程序报名(姓名,性别,书包电话,出生日期,家庭住址,学生来源,监护人,与幼儿关系," +
                               " 监护人电话,监护人身份证件类型,监护人证件号码,监护人职业,监护人工作单位及职位," +
                               " 监护人2,与幼儿关系2,监护人2电话,监护人2身份证件类型,监护人2证件号码,监护人2职业,监护人2工作单位及职位," +
                               " 监护人3,与幼儿关系3,监护人3电话,监护人3身份证件类型,监护人3证件号码,监护人3职业,监护人3工作单位及职位," +
                               " 监护人4,与幼儿关系4,监护人4电话,监护人4身份证件类型,监护人4证件号码,监护人4职业,监护人4工作单位及职位," +
                               " 健康备注,食物药品备注,保健手册,体检手册,预防针本,幼儿身份证件类型,幼儿身份证件号码,民族,国籍地区,港澳台侨外," +
                               " 户籍地区,户籍地区详情,户口性质,非农业户口类型,是否残疾,残疾类型,是否留守儿童,是否独生子女,是否进城务工人员子女," +
                               " 是否孤儿,健康状况,血型,看园ID,报名日期,家长姓名,老师姓名,网站名称,体检时间,审核状态,openid,分享单编号)" +
                               " select @姓名,@性别,@书包电话,@出生日期,@家庭住址,@学生来源," +
                               " @监护人,@与幼儿关系,@监护人电话,@监护人身份证件类型,@监护人证件号码,@监护人职业,@监护人工作单位及职位," +
                               " @监护人2,@与幼儿关系2,@监护人2电话,@监护人2身份证件类型,@监护人2证件号码,@监护人2职业,@监护人2工作单位及职位," +
                               " @监护人3,@与幼儿关系3,@监护人3电话,@监护人3身份证件类型,@监护人3证件号码,@监护人3职业,@监护人3工作单位及职位," +
                               " @监护人4,@与幼儿关系4,@监护人4电话,@监护人4身份证件类型,@监护人4证件号码,@监护人4职业,@监护人4工作单位及职位," +
                               " @健康备注,@食物药品备注,@保健手册,@体检手册,@预防针本,@幼儿身份证件类型,@幼儿身份证件号码,@民族,@国籍地区,@港澳台侨外," +
                               " @户籍地区,@户籍地区详情,@户口性质,@非农业户口类型,@是否残疾,@残疾类型,@是否留守儿童,@是否独生子女,@是否进城务工人员子女," +
                               " @是否孤儿,@健康状况,@血型,@看园ID,@报名日期,@家长姓名,@老师姓名,@网站名称,@体检时间,@审核状态,@openid,@分享单编号 " +
                               " select @@identity ";

            sr = SQLHelper.Insert(dbName, sqlString, new SqlParameter("@姓名", GetDBValue(name)),
                                  new SqlParameter("@性别", GetDBValue(gender)),
                                  new SqlParameter("@书包电话", GetDBValue(bagPhone)),
                                  new SqlParameter("@出生日期", GetDBValue(birth)),
                                  new SqlParameter("@家庭住址", GetDBValue(address)),
                                  new SqlParameter("@学生来源", GetDBValue(source)),
                                  new SqlParameter("@监护人", GetDBValue(guardianName)),
                                  new SqlParameter("@与幼儿关系", GetDBValue(relation)),
                                  new SqlParameter("@监护人电话", GetDBValue(guardianPhone)),
                                  new SqlParameter("@监护人身份证件类型", GetDBValue(guardianCredentialType)),
                                  new SqlParameter("@监护人证件号码", GetDBValue(guardianIdNumber)),
                                  new SqlParameter("@监护人职业", GetDBValue(occupation)),
                                  new SqlParameter("@监护人工作单位及职位", GetDBValue(job)),
                                  new SqlParameter("@监护人2", GetDBValue(guardianName2)),
                                  new SqlParameter("@与幼儿关系2", GetDBValue(relation2)),
                                  new SqlParameter("@监护人2电话", GetDBValue(guardianPhone2)),
                                  new SqlParameter("@监护人2身份证件类型", GetDBValue(guardianCredentialType2)),
                                  new SqlParameter("@监护人2证件号码", GetDBValue(guardianIDNumber2)),
                                  new SqlParameter("@监护人2职业", GetDBValue(occupation2)),
                                  new SqlParameter("@监护人2工作单位及职位", GetDBValue(job2)),
                                  new SqlParameter("@监护人3", GetDBValue(guardianName3)),
                                  new SqlParameter("@与幼儿关系3", GetDBValue(relation3)),
                                  new SqlParameter("@监护人3电话", GetDBValue(guardianPhone3)),
                                  new SqlParameter("@监护人3身份证件类型", GetDBValue(guardianCredentialType3)),
                                  new SqlParameter("@监护人3证件号码", GetDBValue(guardianIDNumber3)),
                                  new SqlParameter("@监护人3职业", GetDBValue(occupation3)),
                                  new SqlParameter("@监护人3工作单位及职位", GetDBValue(job3)),
                                  new SqlParameter("@监护人4", GetDBValue(guardianName4)),
                                  new SqlParameter("@与幼儿关系4", GetDBValue(relation4)),
                                  new SqlParameter("@监护人4电话", GetDBValue(guardianPhone4)),
                                  new SqlParameter("@监护人4身份证件类型", GetDBValue(guardianCredentialType4)),
                                  new SqlParameter("@监护人4证件号码", GetDBValue(guardianIDNumber4)),
                                  new SqlParameter("@监护人4职业", GetDBValue(occupation4)),
                                  new SqlParameter("@监护人4工作单位及职位", GetDBValue(job4)),
                                  new SqlParameter("@健康备注", GetDBValue(healthRemarks)),
                                  new SqlParameter("@食物药品备注", GetDBValue(foodDragRemarks)),
                                  new SqlParameter("@保健手册", GetDBValue(healthCareNote)),
                                  new SqlParameter("@体检手册", GetDBValue(examination)),
                                  new SqlParameter("@预防针本", GetDBValue(vaccineNote)),
                                  new SqlParameter("@幼儿身份证件类型", GetDBValue(kidCredentialType)),
                                  new SqlParameter("@幼儿身份证件号码", GetDBValue(kidIDNumber)),
                                  new SqlParameter("@民族", GetDBValue(kidNation)),
                                  new SqlParameter("@国籍地区", GetDBValue(kidNationality)),
                                  new SqlParameter("@港澳台侨外", GetDBValue(gangaotai)),
                                  new SqlParameter("@户籍地区", GetDBValue(area)),
                                  new SqlParameter("@户籍地区详情", GetDBValue(areaDetail)),
                                  new SqlParameter("@户口性质", GetDBValue(residenceNature)),
                                  new SqlParameter("@非农业户口类型", GetDBValue(nonagricultureType)),
                                  new SqlParameter("@是否残疾", GetDBValue(disabled)),
                                  new SqlParameter("@残疾类型", GetDBValue(disabledType)),
                                  new SqlParameter("@是否留守儿童", GetDBValue(leftChild)),
                                  new SqlParameter("@是否独生子女", GetDBValue(onlyChild)),
                                  new SqlParameter("@是否进城务工人员子女", GetDBValue(migrantWorkerChild)),
                                  new SqlParameter("@是否孤儿", GetDBValue(orphan)),
                                  new SqlParameter("@健康状况", GetDBValue(healthCondition)),
                                  new SqlParameter("@血型", GetDBValue(bloodType)),
                                  new SqlParameter("@看园ID", kyId == "undefined" ? DBNull.Value : GetDBValue(kanyuanId)),
                                  new SqlParameter("@报名日期", System.DateTime.Now),
                                  new SqlParameter("@家长姓名", GetDBValue(patriarchName)),
                                  new SqlParameter("@老师姓名", GetDBValue(teacherName)),
                                  new SqlParameter("@网站名称", GetDBValue(websiteName)),
                                  new SqlParameter("@体检时间", GetDBValue(examDate)),
                                  new SqlParameter("@openid", GetDBValue(openid)),
                                  new SqlParameter("@分享单编号", GetDBValue(shareNumber)),
                                  new SqlParameter("@审核状态", "未审"));
            return(sr);
        }
Exemplo n.º 23
0
    { /// <summary>
      /// 获取满足条件的工单的列表
      /// </summary>
      /// <param name="name"></param>
      /// <param name="phone"></param>
      /// <returns></returns>
        public static StatusReport GetRepairOrder(string name, string phone)
        {
            StatusReport sr        = new StatusReport();
            string       sqlString =
                " select top 100 " +
                " ID,序号,部门,地址,报修人,联系电话,服务项目,服务类别, " +
                " 紧急程度,报修说明,报修时间,预约服务时间,谈好上门时间,发单人,接单人,派工时间, " +
                " 到场时间,操作人,完成时间,材料费,人工费,是否阅读,状态,完成情况及所耗物料, " +
                " 报修前照片1,报修前照片2,报修前照片3,处理后照片1,处理后照片2,处理后照片3 " +
                //"业主确认完成,业主确认完成时间,业主评价,是否满意 " +
                " from 基础资料_服务任务管理 " +
                " where 报修人 = @报修人 and 联系电话 = @联系电话 " +
                " order by ID desc ";
            DataTable dt = SQLHelper.ExecuteQuery("wyt", sqlString,
                                                  new SqlParameter("@报修人", name),
                                                  new SqlParameter("@联系电话", phone));

            if (dt.Rows.Count == 0)
            {
                sr.SetFail("未查询到报修记录");
            }
            else
            {
                List <Repair> repairList = new List <Repair>();
                foreach (DataRow row in dt.Rows)
                {
                    List <string> beforeList = new List <string>();
                    List <string> afterList  = new List <string>();
                    Repair        r          = new Repair();
                    r.Id              = DataTypeHelper.GetIntValue(row["ID"]);
                    r.SerialNumber    = DataTypeHelper.GetStringValue(row["序号"]);
                    r.Department      = DataTypeHelper.GetStringValue(row["部门"]);
                    r.Address         = DataTypeHelper.GetStringValue(row["地址"]);
                    r.RepairPerson    = DataTypeHelper.GetStringValue(row["报修人"]);
                    r.PhoneNumber     = DataTypeHelper.GetStringValue(row["联系电话"]);
                    r.ServiceProject  = DataTypeHelper.GetStringValue(row["服务项目"]);
                    r.ServiceCategory = DataTypeHelper.GetStringValue(row["服务类别"]);
                    r.Level           = DataTypeHelper.GetStringValue(row["紧急程度"]);
                    r.RepairExplain   = DataTypeHelper.GetStringValue(row["报修说明"]);
                    r.RepairTime      = DataTypeHelper.GetDateStringValue(row["报修时间"]);
                    r.OrderTime       = DataTypeHelper.GetDateStringValue(row["预约服务时间"]);
                    r.VisitTime       = DataTypeHelper.GetDateStringValue(row["谈好上门时间"]);
                    r.SendPerson      = DataTypeHelper.GetStringValue(row["发单人"]);
                    r.ReceivePerson   = DataTypeHelper.GetStringValue(row["接单人"]);
                    r.DispatchTime    = DataTypeHelper.GetDateStringValue(row["派工时间"]);
                    r.ArriveTime      = DataTypeHelper.GetDateStringValue(row["到场时间"]);
                    r.OperatePerson   = DataTypeHelper.GetStringValue(row["操作人"]);
                    r.CompleteTime    = DataTypeHelper.GetDateStringValue(row["完成时间"]);
                    r.MaterialExpense = DataTypeHelper.GetDoubleValue(row["材料费"]);
                    r.LaborExpense    = DataTypeHelper.GetDoubleValue(row["人工费"]);
                    r.IsRead          = DataTypeHelper.GetIntValue(row["是否阅读"]);
                    r.status          = DataTypeHelper.GetStringValue(row["状态"]);
                    r.CompleteStatus  = DataTypeHelper.GetStringValue(row["完成情况及所耗物料"]);
                    //r.IsSatisfying = DataTypeHelper.GetStringValue(row["是否满意"]);
                    //r.AffirmComplete = DataTypeHelper.GetStringValue(row["业主确认完成"]);
                    //r.AffirmCompleteEvaluation = DataTypeHelper.GetStringValue(row["业主评价"]);
                    //r.AffirmCompleteTime = DataTypeHelper.GetDateStringValue(row["业主确认完成时间"]);
                    beforeList.Add(DataTypeHelper.GetStringValue(row["报修前照片1"]));
                    beforeList.Add(DataTypeHelper.GetStringValue(row["报修前照片2"]));
                    beforeList.Add(DataTypeHelper.GetStringValue(row["报修前照片3"]));
                    r.BeforeImage = beforeList.ToArray();
                    afterList.Add(DataTypeHelper.GetStringValue(row["处理后照片1"]));
                    afterList.Add(DataTypeHelper.GetStringValue(row["处理后照片2"]));
                    afterList.Add(DataTypeHelper.GetStringValue(row["处理后照片3"]));
                    r.AfterImage = afterList.ToArray();
                    repairList.Add(r);
                }
                sr.status = "Success";
                sr.result = "成功";
                sr.data   = repairList.ToArray();
            }

            return(sr);
        }
Exemplo n.º 24
0
        public static StatusReport getWatchInfo(string officeId, string workDate)
        {
            StatusReport sr    = new StatusReport();
            Watch        watch = new Watch();

            Frequency[] frequencies = null;
            Point[]     points      = null;
            sr = FrequencyDal.GetAllFrequency(officeId);
            if (sr.status == "Fail")
            {
                return(sr);
            }
            else
            {
                frequencies = (Frequency[])sr.data;
                //watch.frequencies = frequencies;
            }
            sr = PointDal.GetAllPoints(officeId);
            if (sr.status == "Fail")
            {
                return(sr);
            }
            else
            {
                points = (Point[])sr.data;
                //watch.route = points;
            }


            List <Frequency> fList = new List <Frequency>();

            for (int i = 0; i < frequencies.Length; i++)
            {
                List <ChildFrequency> cfList = new List <ChildFrequency>();
                for (int j = 0; j < frequencies[i].times; j++)
                {
                    ChildFrequency cf = new ChildFrequency()
                    {
                        isDone = false,
                        //route = (Point[])points.Reverse<Point>().Reverse<Point>(),
                        //route = new Point[points.Length],
                        //route = (Point[])points.Clone(),
                        //route = points.Reverse<Point>();
                        time      = j + 1,
                        startTime = ""
                    };
                    List <Point> pl = new List <Point>();
                    for (int k = 0; k < points.Length; k++)
                    {
                        Point p = new Point();
                        p.pointId      = points[k].pointId;
                        p.locationName = points[k].locationName;
                        p.longitude    = points[k].longitude;
                        p.latitude     = points[k].latitude;
                        p.no           = points[k].no;
                        p.isScan       = points[k].isScan;
                        pl.Add(p);
                    }
                    cf.route = pl.ToArray();
                    cfList.Add(cf);
                }
                frequencies[i].cFreq = cfList.ToArray();
            }
            watch.frequencies = frequencies;


            sr = WatchResultDal.GetWatchInfo(officeId, workDate);
            if (sr.status == "Success")
            {
                WatchInfo[] wis = (WatchInfo[])sr.data;
                for (int i = 0; i < wis.Length; i++)
                {
                    int?   frequencyId = wis[i].frequencyId;
                    int?   pointId     = wis[i].pointId;
                    int?   time        = wis[i].watchTimes;
                    string startTime   = wis[i].startTime;
                    for (int j = 0; j < watch.frequencies.Length; j++)
                    {
                        for (int k = 0; k < watch.frequencies[j].cFreq.Length; k++)
                        {
                            for (int l = 0; l < watch.frequencies[j].cFreq[k].route.Length; l++)
                            {
                                if (watch.frequencies[j].frequencyId == frequencyId &&
                                    watch.frequencies[j].cFreq[k].time == time &&
                                    watch.frequencies[j].cFreq[k].route[l].pointId == pointId)
                                {
                                    watch.frequencies[j].cFreq[k].route[l].isScan = true;
                                    watch.frequencies[j].cFreq[k].startTime       = startTime;
                                }
                            }
                        }
                    }
                }

                bool totalDone = true;
                for (int i = 0; i < watch.frequencies.Length; i++)
                {
                    //bool[] cFreqIsDone = new bool[watch.frequencies[i].cFreq.Length];
                    //bool isDone = true;
                    watch.frequencies[i].isDone = false;
                    bool freqIsDone = true;
                    for (int j = 0; j < watch.frequencies[i].cFreq.Length; j++)
                    {
                        watch.frequencies[i].cFreq[j].isDone = false;
                        bool cFreqIsDone = true;
                        for (int k = 0; k < watch.frequencies[i].cFreq[j].route.Length; k++)
                        {
                            if (watch.frequencies[i].cFreq[j].route[k].isScan == false)
                            {
                                cFreqIsDone = false;
                            }
                        }
                        if (cFreqIsDone == true)
                        {
                            watch.frequencies[i].cFreq[j].isDone = true;
                        }
                        if (watch.frequencies[i].cFreq[j].isDone == false)
                        {
                            freqIsDone = false;
                        }
                    }
                    if (freqIsDone == true)
                    {
                        watch.frequencies[i].isDone = true;
                        //break;
                    }
                    if (watch.frequencies[i].isDone == false)
                    {
                        totalDone = false;
                    }
                }
                if (totalDone == true)
                {
                    watch.isDone = true;
                }
            }


            sr.status = "Success";
            sr.result = "成功获取到巡更信息";
            sr.data   = watch;
            return(sr);
        }
Exemplo n.º 25
0
        internal Runner[] RunTests(
            TestGroup group,
            List <string> testsList,
            int maxRetry,
            bool bShellMode,
            int retryOnFailure,
            string failedfile,
            TestSuiteLogger testSuiteLogger,
            int testsTimeout,
            TestRange testRange,
            Hashtable userValues,
            LogWriter logWriter,
            string listenAddress,
            string reportFile)
        {
            if (testRange == null)
            {
                mLog.Warn("No tests are selected to run. Exiting.");
                return(new Runner[0]);
            }

            int testCount          = testRange.EndTest - testRange.StartTest + 1;
            int testToExecuteCount = (testsList != null) ? testsList.Count : testCount;

            mStatus = new LauncherStatus(testCount, testToExecuteCount);

            Runner[]            runners      = new Runner[testCount];
            List <ParallelTest> failedGroups = new List <ParallelTest>();

            for (int currentTest = testRange.StartTest; currentTest <= testRange.EndTest;)
            {
                int ini = Environment.TickCount;

                ParallelTest test = group.ParallelTests[currentTest] as ParallelTest;

                if (!IsSelectedTest(test, testsList))
                {
                    mLog.ErrorFormat(
                        "Test with name [{0}] is not invited to this party.",
                        test.Name);

                    ++currentTest;
                    mStatus.Increment();
                    continue;
                }

                mStatus.SetCurrentTestName(test.Name);

                int retryCount = 0;

                bool bRetry = true;

                while (bRetry && retryCount < maxRetry)
                {
                    bRetry = false;

                    LogTestProgress(group, testRange, testCount, currentTest);

                    Runner runner = new Runner(
                        test, userValues, testsTimeout, logWriter, mStatus, listenAddress);

                    if (bShellMode)
                    {
                        runner.ShellMode = bShellMode;
                    }

                    runners[currentTest - testRange.StartTest] = runner;

                    if (reportFile != null)
                    {
                        StatusReport.Write(reportFile, mStatus, false);
                    }

                    runner.Run();

                    TestResult[] runnerResults = runner.GetTestResults();

                    if (runnerResults == null)
                    {
                        mLog.InfoFormat("Error. Results for test [{0}] are NULL",
                                        test.Name);

                        ++currentTest;
                        mStatus.Increment();
                        mStatus.IncrementExecuted();
                        continue;
                    }

                    bool isRepeated = retryCount > 0;

                    if (reportFile == null)
                    {
                        LogTestResultsToTTS(
                            testSuiteLogger, runnerResults, test.Name, isRepeated);
                    }
                    else
                    {
                        LogTestResultsToFile(
                            reportFile, runnerResults, test.Name, isRepeated, true);
                    }

                    bRetry = RetryTest(runnerResults);
                    bool bFailed = FailedTest(runnerResults);

                    if (bRetry ||
                        ((bFailed && (retryOnFailure > 0) &&
                          ((retryCount + 1) < maxRetry)) /* so that list time is printed*/))
                    {
                        bRetry = true;
                        ++retryCount;
                        mLog.Info("Test failed with retry option, trying again");

                        mStatus.AddRepeated(test.Name);

                        continue;
                    }

                    if (bFailed)
                    {
                        failedGroups.Add(test);
                        WriteGroup(failedGroups, failedfile);
                        mStatus.AddFailed(test.Name);
                    }

                    if (IgnoredTest(runnerResults))
                    {
                        mStatus.AddIgnored(test.Name);
                    }
                }

                // updated at the bottom so it's not affected by retries
                mStatus.Increment();
                mStatus.IncrementExecuted();
                ++currentTest;

                mLog.DebugFormat("Test {0} time {1} ms",
                                 test.Name, Environment.TickCount - ini);
            }

            if (reportFile != null)
            {
                StatusReport.Write(reportFile, mStatus, true);
            }

            return(runners);
        }
Exemplo n.º 26
0
        private void btn_status_report_Click(object sender, EventArgs e)
        {
            StatusReport status = new StatusReport(username, password, designation);

            status.Show();
        }
Exemplo n.º 27
0
        public ActionResult OnSetSignUpData(string kindergartenName, string name, string gender, string bagPhone, string birth,
                                            string address, string source, string guardianName, string relation, string guardianPhone, string guardianCredentialType,
                                            string guardianIdNumber, string occupation, string job, string guardianName2, string relation2, string guardianPhone2,
                                            string guardianCredentialType2, string guardianIDNumber2, string occupation2, string job2, string guardianName3,
                                            string relation3, string guardianPhone3, string guardianCredentialType3, string guardianIDNumber3, string occupation3,
                                            string job3, string guardianName4, string relation4, string guardianPhone4, string guardianCredentialType4,
                                            string guardianIDNumber4, string occupation4, string job4, string healthRemarks, string foodDragRemarks, string healthCareNote,
                                            string examination, string vaccineNote, string kidCredentialType, string kidIDNumber, string kidNation, string kidNationality,
                                            string gangaotai, string area, string areaDetail, string residenceNature, string nonagricultureType, string disabled,
                                            string disabledType, string leftChild, string onlyChild, string migrantWorkerChild, string orphan, string healthCondition,
                                            string bloodType, string teacherName, string patriarchName, string websiteName, string examDate, string kanyuanID, string sessionId,
                                            string shareNumber)
        {
            StatusReport sr = new StatusReport();

            //如果未指定幼儿园,返回错误信息
            if (string.IsNullOrEmpty(kindergartenName))
            {
                sr.status = "Fail";
                sr.result = "未指定幼儿园";
                return(Json(sr));
            }

            //如果姓名或联系方式为空,返回错误信息
            if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(bagPhone))
            {
                sr.status = "Fail";
                sr.result = "姓名和书包电话不能为空";
                return(Json(sr));
            }

            if (string.IsNullOrEmpty(sessionId))
            {
                sr.status     = "Fail";
                sr.result     = "sessionId不存在";
                sr.parameters = sessionId;
                return(Json(sr));
            }
            SessionBag sessionBag = null;

            sessionBag = SessionContainer.GetSession(sessionId);
            if (sessionBag == null)
            {
                sr.status = "Fail";
                sr.result = "session已失效";
                return(Json(sr));
            }
            string openid = sessionBag.OpenId;

            sr = WXUserDal.SetUserInfo(openid, guardianName, bagPhone, kindergartenName, name, relation);

            //如果数据满足条件,调用SignUpDal.SetSignUpData方法,将数据存入数据库中
            sr = SignUpDal.SetSignUpData(kindergartenName, name, gender, bagPhone, birth, address, source,
                                         guardianName, relation, guardianPhone, guardianCredentialType, guardianIdNumber, occupation, job,
                                         guardianName2, relation2, guardianPhone2, guardianCredentialType2, guardianIDNumber2, occupation2, job2,
                                         guardianName3, relation3, guardianPhone3, guardianCredentialType3, guardianIDNumber3, occupation3, job3,
                                         guardianName4, relation4, guardianPhone4, guardianCredentialType4, guardianIDNumber4, occupation4, job4,
                                         healthRemarks, foodDragRemarks, healthCareNote, examination, vaccineNote, kidCredentialType, kidIDNumber,
                                         kidNation, kidNationality, gangaotai, area, areaDetail, residenceNature, nonagricultureType, disabled,
                                         disabledType, leftChild, onlyChild, migrantWorkerChild, orphan, healthCondition, bloodType, teacherName,
                                         patriarchName, websiteName, examDate, kanyuanID, openid, shareNumber);
            //if (sr.status == "Success")
            //{
            //    string data = sr.data.ToString();
            //    StatusReport report = new StatusReport();
            //    report = KanyuanDataDal.GetPayInfo(name, bagPhone,kindergartenName);
            //    if (report.status == "Success")
            //    {
            //        string totalFee = report.data.ToString();
            //        report.data = new { totalFee = totalFee, signUpId = data.ToString() };
            //        return Json(report);
            //    }
            //}
            return(Json(sr));
        }
Exemplo n.º 28
0
 /// <summary>
 /// PressurizedAreaController constructor.
 /// </summary>
 /// <param name="listExteriorDoors">Doors to non-pressurized area.</param>
 /// <param name="listInteriorDoors">Doors to pressurized area.</param>
 /// <param name="listVentsToO2Tanks">Vents to oxygen storage tanks.</param>
 /// <param name="listVentsToO2Gens">Vents to oxygen generators.</param>
 /// <param name="o2TanksManager">Oxygen tank manager.</param>
 /// <param name="alertSystemManager">Alert system manager.</param>
 public PressurizedAreaController(
     List <IMyDoor> listExteriorDoors, List <IMyDoor> listInteriorDoors,
     List <IMyAirVent> listVentsToO2Tanks, List <IMyAirVent> listVentsToO2Gens,
     GasTanksManager o2TanksManager = null, Dictionary <AlertStatus, Alert> alertDictionary = null, StatusReport statusReport = null)
 {
     this.listExteriorDoors  = listExteriorDoors;
     this.listInteriorDoors  = listInteriorDoors;
     this.listVentsToO2Tanks = listVentsToO2Tanks;
     this.listVentsToO2Gens  = listVentsToO2Gens;
     this.o2TanksManager     = o2TanksManager;
     if (alertDictionary != null)
     {
         alertSystemManager = new AlertSystemManager <AlertStatus>(alertDictionary);
     }
     SetStatusReport(statusReport);
     Pressurize();
 }
Exemplo n.º 29
0
        public static StatusReport GetDecorationPatrolList(string classify)
        {
            StatusReport     sr           = new StatusReport();
            DecorationPatrol dp           = new DecorationPatrol();
            string           sqlstringNpd = " SELECT ID, 分类, 房产编号, 业主姓名, 业主电话, 客服专员, 装修负责人, 装修负责人电话, 装修类型" +
                                            " FROM dbo.基础资料_装修管理 " +
                                            " where (left(分类,2) = @分类) AND (状态 = '正在装修') ORDER BY ID DESC ";
            //NeedPatrolDecoration npd = new NeedPatrolDecoration();
            DataTable dtNpd = SQLHelper.ExecuteQuery("wyt", sqlstringNpd, new SqlParameter("@分类", classify));

            if (dtNpd.Rows.Count == 0)
            {
                sr.status = "Fail";
                sr.result = "未查询到任何数据";
                return(sr);
            }
            List <NeedPatrolDecoration> npdList = new List <NeedPatrolDecoration>();

            foreach (DataRow dr in dtNpd.Rows)
            {
                NeedPatrolDecoration npd = new NeedPatrolDecoration();
                npd.id              = DataTypeHelper.GetIntValue(dr["ID"]);
                npd.classify        = DataTypeHelper.GetStringValue(dr["分类"]);
                npd.roomNumber      = DataTypeHelper.GetStringValue(dr["房产编号"]);
                npd.name            = DataTypeHelper.GetStringValue(dr["业主姓名"]);
                npd.phone           = DataTypeHelper.GetStringValue(dr["业主电话"]);
                npd.attache         = DataTypeHelper.GetStringValue(dr["客服专员"]);
                npd.decorationMan   = DataTypeHelper.GetStringValue(dr["装修负责人"]);
                npd.decorationPhone = DataTypeHelper.GetStringValue(dr["装修负责人电话"]);
                npd.type            = DataTypeHelper.GetStringValue(dr["装修类型"]);
                npdList.Add(npd);
            }
            dp.needPatrolDecorations = npdList.ToArray();

            string    sqlstringPi = " select 序号, 巡检项目, 是否上报 from 基础资料_装修巡检设置_检查项目 order by 序号 ";
            DataTable dtPi        = SQLHelper.ExecuteQuery("wyt", sqlstringPi);

            if (dtPi.Rows.Count == 0)
            {
                sr.status = "Fail";
                sr.result = "未查询到任何巡检项目";
                return(sr);
            }
            List <PatrolItem> piList = new List <PatrolItem>();

            foreach (DataRow dr in dtPi.Rows)
            {
                PatrolItem pi = new PatrolItem();
                pi.number     = DataTypeHelper.GetStringValue(dr["序号"]);
                pi.item       = DataTypeHelper.GetStringValue(dr["巡检项目"]);
                pi.needReport = DataTypeHelper.GetStringValue(dr["是否上报"]);
                piList.Add(pi);
            }
            dp.patrolItems = piList.ToArray();

            string    sqlstringDw = " select 处理方式 from 基础资料_装修巡检设置_处理方式 ";
            DataTable dtDw        = SQLHelper.ExecuteQuery("wyt", sqlstringDw);

            if (dtDw.Rows.Count == 0)
            {
                sr.status = "Fail";
                sr.result = "未查询到任何处理方式";
                return(sr);
            }
            List <string> dwList = new List <string>();

            foreach (DataRow dr in dtDw.Rows)
            {
                dwList.Add(DataTypeHelper.GetStringValue(dr["处理方式"]));
            }
            dp.disposeWay = dwList.ToArray();

            sr.status = "Success";
            sr.result = "成功";
            sr.data   = dp;
            return(sr);
        }
Exemplo n.º 30
0
 public void SetStatusReport(StatusReport statusReport)
 {
     this.statusReport = statusReport;
 }
Exemplo n.º 31
0
 public void NewStatusReport(string line)
 {
     //MainForm.DisplayText("NewStatusReport: " + line);
     JavaScriptSerializer serializer = new JavaScriptSerializer();
     Status = serializer.Deserialize<StatusReport>(line);
 }
Exemplo n.º 32
0
        public static StatusReport GetEquipmentTroubleStatistics(string ztcode, string level)
        {
            StatusReport sr        = new StatusReport();
            string       condition = "";
            string       order     = "";
            string       group     = "";
            string       sqlString = " SELECT " +
                                     " dbo.资源帐套表.帐套代码, " +
                                     " dbo.资源帐套表.帐套名称, " +
                                     " COUNT(CASE WHEN 接单时间 IS NULL THEN NULL ELSE 1 END) AS 接单数, " +
                                     " COUNT(CASE WHEN DATEDIFF(hh, 接单时间, ISNULL(完成时间, '1990/1/1')) > 0 AND DATEDIFF(hh, 接单时间, ISNULL(完成时间, '1990/1/1')) <= 8 THEN 1 ELSE NULL END) AS [8小时内完成数], " +
                                     " COUNT(CASE WHEN DATEDIFF(hh, 接单时间, ISNULL(完成时间, '1990/1/1')) > 8 AND DATEDIFF(hh, 接单时间, ISNULL(完成时间, '1990/1/1')) <= 24 THEN 1 ELSE NULL END)  AS [8到24小时内完成数], " +
                                     " COUNT(CASE WHEN DATEDIFF(hh, 接单时间, ISNULL(完成时间, '1990/1/1')) >= 24 THEN 1 ELSE NULL END) AS [24小时以上完成数] " +
                                     " FROM dbo.基础资料_设备故障管理 LEFT OUTER JOIN dbo.资源帐套表 ON LEFT(dbo.基础资料_设备故障管理.分类, 2) = dbo.资源帐套表.帐套代码 ";

            if (level == "助理" || level == "项目经理")
            {
                condition = " WHERE (dbo.基础资料_设备故障管理.接单时间 IS NOT NULL) AND 帐套代码 = @帐套代码 ";
                order     = " order by 帐套代码 ";
                group     = " GROUP BY dbo.资源帐套表.帐套代码, dbo.资源帐套表.帐套名称, dbo.基础资料_设备故障管理.分类";
                sqlString = sqlString + condition + group + order;
                DataTable dt = SQLHelper.ExecuteQuery("wyt", sqlString, new SqlParameter("@帐套代码", ztcode));
                if (dt.Rows.Count == 0)
                {
                    sr.status = "Fail";
                    sr.result = "未查询到符合条件的记录";
                    return(sr);
                }
                DataRow dr = dt.Rows[0];
                EquipmentTroubleStatistics ets = new EquipmentTroubleStatistics();
                ets.ztName       = Convert.ToString(dr["帐套名称"]);
                ets.countReceive = Convert.ToString(dr["接单数"]);
                ets.count8       = Convert.ToString(dr["8小时内完成数"]);
                ets.count8to24   = Convert.ToString(dr["8到24小时内完成数"]);
                ets.count24      = Convert.ToString(dr["24小时以上完成数"]);
                ets.rate8        = GetPercent(ets.count8, ets.countReceive);
                ets.rate8to24    = GetPercent(ets.count8to24, ets.countReceive);
                ets.rate24       = GetPercent(ets.count24, ets.countReceive);
                sr.status        = "Success";
                sr.result        = "成功";
                sr.data          = ets;
                return(sr);
            }
            else
            {
                condition = " WHERE (dbo.基础资料_设备故障管理.接单时间 IS NOT NULL) ";
                order     = " order by 帐套代码 ";
                group     = " GROUP BY dbo.资源帐套表.帐套代码, dbo.资源帐套表.帐套名称, dbo.基础资料_设备故障管理.分类";
                sqlString = sqlString + condition + group + order;
                DataTable dt = SQLHelper.ExecuteQuery("wyt", sqlString, new SqlParameter("@帐套代码", ztcode));
                if (dt.Rows.Count == 0)
                {
                    sr.status = "Fail";
                    sr.result = "未查询到符合条件的记录";
                    return(sr);
                }
                EquipmentTroubleStatisticsCompany esc    = new EquipmentTroubleStatisticsCompany();
                List <EquipmentTroubleStatistics> esList = new List <EquipmentTroubleStatistics>();
                foreach (DataRow dr in dt.Rows)
                {
                    EquipmentTroubleStatistics es = new EquipmentTroubleStatistics();
                    es.ztName        = Convert.ToString(dr["帐套名称"]);
                    es.countReceive  = Convert.ToString(dr["接单数"]);
                    es.count8        = Convert.ToString(dr["8小时内完成数"]);
                    es.count8to24    = Convert.ToString(dr["8到24小时内完成数"]);
                    es.count24       = Convert.ToString(dr["24小时以上完成数"]);
                    es.rate8         = GetPercent(es.count8, es.countReceive);
                    es.rate8to24     = GetPercent(es.count8to24, es.countReceive);
                    es.rate24        = GetPercent(es.count24, es.countReceive);
                    esc.countReceive = Convert.ToString(Convert.ToDecimal(esc.countReceive) + Convert.ToDecimal(es.countReceive));
                    esc.count8       = Convert.ToString(Convert.ToDecimal(esc.count8) + Convert.ToDecimal(es.count8));
                    esc.count8to24   = Convert.ToString(Convert.ToDecimal(esc.count8to24) + Convert.ToDecimal(es.count8to24));
                    esc.count24      = Convert.ToString(Convert.ToDecimal(esc.count24) + Convert.ToDecimal(es.count24));
                    esList.Add(es);
                }
                esc.rate8     = GetPercent(esc.count8, esc.countReceive);
                esc.rate8to24 = GetPercent(esc.count8to24, esc.countReceive);
                esc.rate24    = GetPercent(esc.count24, esc.countReceive);
                esc.equipmentTroubleStatisticsProjects = esList.ToArray();

                sr.status = "Success";
                sr.result = "成功";
                sr.data   = esc;
                return(sr);
            }
        }