예제 #1
0
        public DetailData GetDetailData(string databasePrefix, string databaseName, string tableName, string pkColumnName, string Id)
        {
            try
            {
                var detailData = new DetailData()
                {
                    DatabasePrefix = databasePrefix,
                    DatabaseName = databaseName,
                    PkColumnName = pkColumnName,
                    TableName = tableName,
                };
                var data = new List<Detail>();
                var typeFullName = MongodbServerMaintainceCenter.GetTypeFullName(databasePrefix);
                var server = CreateSlaveMongoServer(typeFullName);
                var database = server.GetDatabase(databaseName);
                var collection = database.GetCollection(tableName);
                var row = collection.FindOne(Query.EQ(pkColumnName, Id));
                if (row != null)
                {
                    var columnDescriptions = MongodbServerMaintainceCenter.GetMongodbColumnDescriptions(databasePrefix);
                    var enumColumnDescriptions = MongodbServerMaintainceCenter.GetMongodbEnumColumnDescriptions(databasePrefix);

                    foreach (var col in row)
                        InternalGetDetailData(string.Empty, data, col, columnDescriptions, enumColumnDescriptions, pkColumnName);
                    detailData.Data = data;
                    return detailData;
                }
                return null;
            }
            catch (Exception ex)
            {
                LocalLoggingService.Error("{0} {1} {2} {3}", MongodbServerConfiguration.ModuleName, "MongodbServer_Detail", "GetDetailData", ex.Message);
                throw;
            }
        }
예제 #2
0
        public async Task <List <DetailDataViewModel> > ReadAsync(SpreadsheetsResource.ValuesResource valuesResource)
        {
            Google.Apis.Sheets.v4.Data.ValueRange response = await valuesResource.Get(SpreadsheetId, ReadRange).ExecuteAsync();

            IList <IList <object> > values = response.Values;

            DetailData detail = new DetailData();

            if (values != null || values.Any())
            {
                //CABEÇALHO: var header = string.Join(" ", values.First().Select(r => r.ToString()));
                //foreach (var row in values.Skip(1))
                for (int i = 1; i < 4; i++)
                {
                    var row = values[i];
                    detail.Data.Add(new DetailDataViewModel
                    {
                        Id             = i,
                        CharName       = row[0].ToString(),
                        Type           = row[1].ToString(),
                        Skins          = row[2].ToString(),
                        Skin_Spotlight = row[3].ToString(),
                    });
                }
            }
            return(detail.Data);
        }
예제 #3
0
        private void SendDetails()
        {
            DetailData data = new DetailData();

            data.EntityId = MiningBlock.EntityId;
            data.Details  = m_syncDetails.ToString();
            var bytes = ASCIIEncoding.ASCII.GetBytes(MyAPIGateway.Utilities.SerializeToXML(data));

            var localSteamId = MyAPIGateway.Multiplayer.MyId;
            var distSq       = MyAPIGateway.Session.SessionSettings.SyncDistance;

            distSq += 1000; // some safety padding, avoid desync
            distSq *= distSq;

            var players = new List <IMyPlayer>();

            MyAPIGateway.Players.GetPlayers(players);
            foreach (var p in players)
            {
                var steamId = p.SteamUserId;

                if (steamId != localSteamId && Vector3D.DistanceSquared(p.GetPosition(), MiningBlock.GetPosition()) <= distSq)
                {
                    MyAPIGateway.Multiplayer.SendMessageTo(8954, bytes, p.SteamUserId);
                }
            }
            players.Clear();
        }
예제 #4
0
        private void BindData(DetailData result)
        {
            var data = new List <Detail>();

            //把没有下级的排在前面
            data.AddRange(result.Data.Where(d => d.SubDetails == null).ToList());
            data.AddRange(result.Data.Where(d => d.SubDetails != null).ToList());
            var root  = new TreeViewItem();
            var panel = new WrapPanel();

            panel.Children.Add(new TextBlock {
                Text = "数据库名:", FontWeight = FontWeights.Bold
            });
            panel.Children.Add(new TextBox {
                Text = result.DatabaseName, Margin = new Thickness(5, 0, 0, 0), TextWrapping = TextWrapping.Wrap, BorderBrush = new SolidColorBrush(Colors.White), Padding = new Thickness(0)
            });
            panel.Children.Add(new TextBlock {
                Text = "表名:", FontWeight = FontWeights.Bold, Margin = new Thickness(5, 0, 0, 0)
            });
            panel.Children.Add(new TextBox {
                Text = result.TableName, Margin = new Thickness(5, 0, 0, 0), TextWrapping = TextWrapping.Wrap, BorderBrush = new SolidColorBrush(Colors.White), Padding = new Thickness(0)
            });
            root.Header     = panel;
            root.IsExpanded = true;
            BindTree(root, data);
            DataTree.Items.Clear();
            DataTree.Items.Add(root);
        }
예제 #5
0
        public ActionResult Save(SubmitModel model)
        {
            SessionHelper.Temp  = model.DistrictId;
            SessionHelper.Temp2 = model.UpazillaId;
            SessionHelper.Temp3 = model.CollectedBy;
            SessionHelper.Temp4 = model.SourceId;


            DetailData entity = new DetailData();

            ModelCopier.CopyModel(model, entity);

            entity.InsertedById = SessionHelper.UserId;

            if (model.Id == 0)
            {
                sunDataService.Add(entity);
            }
            else
            {
                sunDataService.Update(entity);
            }

            unitOfWork.Commit();

            return(PartialView());

            //return PartialView("Create",GetModel(model.CollectedBy));
        }
예제 #6
0
        private void BindData(DetailData result)
        {
            var data = new List <Detail>();

            //把没有下级的排在前面
            data.AddRange(result.Data.Where(d => d.SubDetails == null).ToList());
            data.AddRange(result.Data.Where(d => d.SubDetails != null).ToList());
            var root  = new TreeViewItem();
            var panel = new WrapPanel();

            panel.Orientation = System.Windows.Controls.Orientation.Horizontal;
            panel.Children.Add(new TextBlock {
                Text = "数据库名:", FontWeight = FontWeights.Bold
            });
            panel.Children.Add(new TextBlock {
                Text = result.DatabaseName
            });
            panel.Children.Add(new TextBlock {
                Text = "表名:", FontWeight = FontWeights.Bold, Margin = new Thickness(5, 0, 0, 0)
            });
            panel.Children.Add(new TextBlock {
                Text = result.TableName
            });
            panel.Children.Add(new TextBlock {
                Text = "主键:", FontWeight = FontWeights.Bold, Margin = new Thickness(5, 0, 0, 0)
            });
            panel.Children.Add(new TextBlock {
                Text = DetailCondition.ID
            });
            root.Header     = panel;
            root.IsExpanded = true;
            BindTree(root, data);
            DataTree.Items.Add(root);
        }
예제 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string aID        = string.Empty;
        string aCheckPath = "~";
        string aReStr     = "<p id=\"Title\">{0}</p><ul>";
        string aLiStr     = "<li>{0}</li>";

        DetailData[] aDetailData;
        DetailData   aData;

        try
        {
            aID = Request["Kind"].ToString();

            aData = new DetailData();

            if (GetIsDebug() == false)
            {
                aCheckPath = "~/Dokkan/";
            }

            using (StreamReader aSR = new StreamReader(Server.MapPath(aCheckPath) + mLoadPath, Encoding.UTF8))
            {
                string zStr = aSR.ReadToEnd();

                aDetailData = JsonConvert.DeserializeObject <DetailData[]>(zStr);
            }

            for (int i = 0; i < aDetailData.Length; i++)
            {
                if (aID == aDetailData[i].ID)
                {
                    aData = aDetailData[i];
                    break;
                }
            }

            aReStr = string.Format(aReStr, aData.ProductName);

            int aDetailCount = GetDetailCount(aData);

            for (int i = 0; i < aDetailCount; i++)
            {
                aReStr += string.Format(aLiStr, aData.Detail[i]);
            }


            aReStr += "</ul>";

            aReStr += string.Format("<p id=\"Price\">售價{0}</p>", aData.Price);

            Response.Write(aReStr);
        }
        catch (Exception wz)
        {
            //無效的ID
            Response.Write(wz);
        }
    }
예제 #8
0
        private void SendDetails()
        {
            DetailData data = new DetailData();

            data.EntityId = MiningBlock.EntityId;
            data.Details  = m_syncDetails.ToString();
            MyAPIGateway.Multiplayer.SendMessageToOthers(8954, ASCIIEncoding.ASCII.GetBytes(MyAPIGateway.Utilities.SerializeToXML(data)));
        }
        public void Initialize(Assembly configAssembly, MasterData configRoleData, DetailData configCodeData, IArticleConfigFactory configFactory)
        {
            IArticleMasterCollection masterBundle = new ArticleMasterCollection();

            masterBundle.LoadConfigData(configAssembly, configRoleData, configFactory);

            detailBundle.LoadConfigData(masterBundle, configCodeData, configFactory);
        }
예제 #10
0
        private void UserRoleAddNew_Button_Click(object sender, EventArgs e)
        {
            List <object> users = UserID_CheckedComboBoxEdit.EditValue.CastTo <List <object> >();

            //string userID = UserID_TextBox.Text;
            CM_Company company  = CompanyID_LookUpEdit.GetSelectedDataRow().CastTo <CM_Company>();
            MasterInfo userRole = UserRole_ComboBox.GetSelectedDataRow().CastTo <MasterInfo>();

            //if (string.IsNullOrEmpty(userID))
            if (users == null || users.Count <= 0)
            {
                MessageBoxHelper.ShowErrorMessage(BSMessage.BSM000003);
                return;
            }

            if (string.IsNullOrEmpty(company?.CompanyID))
            {
                MessageBoxHelper.ShowErrorMessage(BSMessage.BSM000005);
                return;
            }

            if (string.IsNullOrEmpty(userRole?.Id))
            {
                MessageBoxHelper.ShowErrorMessage(BSMessage.BSM000006);
                return;
            }

            //if (DetailData.ToList().Find(o => o.UserID == userID && o.CompanyID == company.CompanyID) != null)
            //{
            //    MessageBoxHelper.ShowErrorMessage(BSMessage.BSM000004);
            //    return;
            //}

            foreach (string userID in users)
            {
                UserCompany find = DetailData.ToList().Find(o => o.UserID == userID && o.CompanyID == company.CompanyID);
                if (find != null)
                {
                    find.UserRoleID   = userRole.Id;
                    find.UserRoleName = userRole.Value;
                    find.Status       = ModifyMode.Update;
                }
                else
                {
                    DetailData.Add(new UserCompany
                    {
                        UserID       = userID,
                        CompanyID    = company.CompanyID,
                        CompanyName  = company.CompanyName,
                        UserRoleID   = userRole.Id,
                        UserRoleName = userRole.Value,
                        Status       = ModifyMode.Insert
                    });
                }
            }
        }
예제 #11
0
        public void SyncDetails(DetailData data)
        {
            m_syncDetails.Clear();
            m_syncDetails.Append(data.Details);
            //m_block.RefreshCustomInfo();
            // Trigger a refresh
            var detector = m_block as Sandbox.ModAPI.Ingame.IMyOreDetector;
            var action   = detector.GetActionWithName("BroadcastUsingAntennas");

            action.Apply(m_block);
        }
예제 #12
0
    private void UpdatePageFromData(DetailData data)
    {
        lblId.Text               = data.Id.ToString();
        txtMeno.Text             = data.Meno;
        txtPriezvisko.Text       = data.Priezvisko;
        txtEmail.Text            = data.Email;
        txtTelefon.Text          = data.Telefon;
        ddlZbor.SelectedValue    = (data.IdZbor ?? 0).ToString();
        txtInyZbor.Text          = data.InyZbor;
        chbPiatokVecera.Checked  = data.PiatokVecera;
        chbPiatokVecera2.Checked = data.PiatokVecera2;
        ddlUbytovaniePiatokSobota.SelectedValue = data.IdUbytovaniePiatokSobota.ToString();
        chbSobotaRanajky.Checked = data.SobotaRanajky;
        chbSobotaObed.Checked    = data.SobotaObed;
        chbSobotaVecera.Checked  = data.SobotaVecera;
        chbSobotaVecera2.Checked = data.SobotaVecera2;
        ddlUbytovanieSobotaNedela.SelectedValue = data.IdUbytovanieSobotaNedela.ToString();
        chbNedelaRanajky.Checked     = data.NedelaRanajky;
        chbNedelaObed.Checked        = data.NedelaObed;
        chbSach.Checked              = data.Sach;
        chbPingPong.Checked          = data.PingPong;
        ddlTricko.SelectedValue      = (data.IdTricko ?? 0).ToString();
        ddlSluziaci.SelectedValue    = (data.IdSluziaci ?? 0).ToString();
        ddlDobrovolnik.SelectedValue = (data.IdDobrovolnik ?? 0).ToString();
        txtPoznamka.Text             = data.Poznamka;
        lblRegistrationDate.Text     = data.DtRegistered.HasValue ? data.DtRegistered.Value.ToString(new CultureInfo("sk-SK")) : "";
        lblPaymentDate.Text          = data.DtPlatba.HasValue ? data.DtPlatba.Value.Date.ToString("d.M.yyyy") : "";
        lblArrivalDate.Text          = data.DtPrisli.HasValue ? data.DtPrisli.Value.ToString(new CultureInfo("sk-SK")) : "";
        lblZaplatili.Text            = Currency(data.Zaplatili);
        lblCosts.Text     = Currency(data.Naklady);
        lblDonation.Text  = Currency(data.Dar);
        lblPreplatok.Text = Currency(data.Preplatok);
        var surplus = data.Preplatok >= 0.01;
        var debt    = data.Preplatok <= -0.01;

        lblPreplatok.CssClass = debt ? "negative" : "positive";
        //btnDarovaliNam.Visible = surplus;
        //btnDarovaliSme.Visible = debt;
        btnZaplatiliNam.Visible     = debt;
        btnZaplatiliSme.Visible     = surplus;
        btnPrisli.Visible           = !data.DtPrisli.HasValue;
        txtAmount.Text              = Currency(Math.Abs(data.Preplatok));
        lblRegistracnyPoplatok.Text = data.RegistraciaZadarmo ? "Zadarmo" : Currency(data.RegistracnyPoplatok);
        txtRegistracnyOverride.Text = data.RegistracnyOverride == null ? "" : string.Format("{0:0.00}", data.RegistracnyOverride);

        lblTitle.Text = data.Meno + " " + data.Priezvisko;

        if (data.Group.Count > 0)
        {
            trGroup.Visible = true;
            lblGroup.Text   = string.Join("<br/>", data.Group.Select(x => string.Format("<a href=\"/Detail.aspx?id={0}\" target=\"new\">{1}</a>", x.Id, x.Name)));
        }
    }
예제 #13
0
        private async Task <bool> InitFunc()
        {
            _detailData = new DetailData();
            var url = AcFunAPI.GetContentUrl(_SeleCContent.ContentId);
            await _detailData.GetData(url);

            _SeleCContent    = _detailData.ListOfACContent[0];
            _videoSourceData = new VideoSourceData();
            //url=AcFunAPI.GetVideoSrcUrl(_SeleCContent.DetailVideos[0].)
            //url=AcFunAPI.GetVideoSrcUrl(_SeleCContent.DetailVideos[0].)
            //await _videoSourceData.GetData()
            return(true);
        }
예제 #14
0
    private int GetDetailCount(DetailData iData)
    {
        int aCount = 0;

        for (int i = 0; i < iData.Detail.Length; i++)
        {
            if (iData.Detail[i] == "")
            {
                break;
            }
            aCount++;
        }

        return(aCount);
    }
예제 #15
0
        private void HandleDetails(byte[] data)
        {
            try
            {
                if (MyAPIGateway.Session == null)
                {
                    return;
                }

                if (NaniteConstructionManager.NaniteBlocks == null)
                {
                    return;
                }

                DetailData details = MyAPIGateway.Utilities.SerializeFromXML <DetailData>(ASCIIEncoding.ASCII.GetString(data));
                //Logging.Instance.WriteLine(string.Format("HandleDetails: {0}", details.EntityId));

                bool found = false;
                foreach (var item in NaniteConstructionManager.NaniteBlocks)
                {
                    if (item.Key == details.EntityId && item.Value.Initialized)
                    {
                        //Logging.Instance.WriteLine(string.Format("Details for Factory: {0}", details.EntityId));
                        item.Value.SyncDetails(details);
                        found = true;
                        break;
                    }
                }

                if (!found)
                {
                    foreach (var item in NaniteConstructionManager.MiningList)
                    {
                        if (item.MiningBlock.EntityId == details.EntityId)
                        {
                            //Logging.Instance.WriteLine(string.Format("Details for Hammer: {0}", details.EntityId));
                            item.SyncDetails(details);
                            found = true;
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MyLog.Default.WriteLine(string.Format("HandleDetails() Error: {0}", ex.ToString()));
            }
        }
예제 #16
0
        public JsonResult Index(ApiModel model)
        {
            if (model.Key.Trim() != "9AF62612-CC13-46FE-8906-96E60DCC34D1")
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }

            try
            {
                DetailData entity = new DetailData();

                entity.SourceId    = 860538;
                entity.DistrictId  = 860539;
                entity.UpazillaId  = 860540;
                entity.Date        = DateTime.Now.Date;
                entity.Phone       = model.Phone;
                entity.CollectedBy = model.PIN;
                entity.IsFever     = model.HasFever;
                entity.IsBreadth   = model.HasBreathingProblem;
                entity.IsDryCough  = model.HasDryCough;
                entity.Description = model.Address;

                if (model.Gender.ToLower() == "male")
                {
                    entity.GenderId = 860516;
                }
                else if (model.Gender.ToLower() == "female")
                {
                    entity.GenderId = 860517;
                }

                entity.IsContact = model.HasAnyContactWithSuspected;

                entity.IsRespiratory = false;
                entity.Name          = "";
                entity.InsertedById  = 333;

                sunDataService.Add(entity);
                unitOfWork.Commit();

                return(Json(true, JsonRequestBehavior.AllowGet));
            }
            catch
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }
예제 #17
0
        private async void GetDetailData()
        {
            DetailData dd  = new DetailData();
            var        url = AcFunAPI.GetContentUrl(_SeleCContent.ContentId);
            await dd.GetData(url);

            if (dd.ListOfACContent == null || dd.ListOfACContent.Count == 0)
            {
                //todo
                MSGSHOW("获取资源失败!");
                return;
            }
            _SeleCContent = dd.ListOfACContent[0];
            _selecVideo   = _SeleCContent.DetailVideos[0];
            GetVideoSourceData();
            AddVideoInfoDetail();
        }
예제 #18
0
        private void LoadDataGridView()
        {
            // Lấy dữ liệu cho lưới
            using (ReportController controller = new ReportController())
            {
                // Lấy chi tiết nợ
                DetailData = controller.GetChiTietSoNo(FromDate, ToDate);

                DetailDataDic = DetailData
                                .GroupBy(o => GetKey(o.AccountID, o.AccountDetailID, o.CustomerID))
                                .ToDictionary(g => g.Key, g => g.ToList());

                MainData = GetSoTongHopNo(DetailData);

                Main_GridView.OptionsSelection.CheckBoxSelectorField = "IsSelected";
            }
        }
예제 #19
0
 private void BindData(DetailData result)
 {
     var data = new List<Detail>();
     //��û���¼�������ǰ��
     data.AddRange(result.Data.Where(d => d.SubDetails == null).ToList());
     data.AddRange(result.Data.Where(d => d.SubDetails != null).ToList());
     var root = new TreeViewItem();
     var panel = new WrapPanel();
     panel.Children.Add(new TextBlock { Text = "���ݿ�����", FontWeight = FontWeights.Bold });
     panel.Children.Add(new TextBox { Text = result.DatabaseName, Margin = new Thickness(5, 0, 0, 0), TextWrapping = TextWrapping.Wrap, BorderBrush = new SolidColorBrush(Colors.White), Padding = new Thickness(0) });
     panel.Children.Add(new TextBlock { Text = "������", FontWeight = FontWeights.Bold, Margin = new Thickness(5, 0, 0, 0) });
     panel.Children.Add(new TextBox { Text = result.TableName, Margin = new Thickness(5, 0, 0, 0), TextWrapping = TextWrapping.Wrap, BorderBrush = new SolidColorBrush(Colors.White), Padding = new Thickness(0) });
     root.Header = panel;
     root.IsExpanded = true;
     BindTree(root, data);
     DataTree.Items.Clear();
     DataTree.Items.Add(root);
 }
예제 #20
0
        public static List <DetailData> TestData()
        {
            List <DetailData> list = new List <DetailData>();

            for (int i = 0; i < 10; i++)
            {
                DetailData data = new DetailData();
                data.Image       = AppDomain.CurrentDomain.BaseDirectory + "Resources\\backgroud.bmp";
                data.Author      = i.ToString();
                data.Description = i.ToString();
                data.Description = "1234567890";
                data.UserName    = i.ToString();

                list.Add(data);
            }

            return(list);
        }
예제 #21
0
    public static void UpdateUser(DetailData data)
    {
        using (var transaction = new TransactionScope())
        {
            using (var connection = CreateConnection())
            {
                using (var command = CreateCommand(connection, "UpdateUser"))
                {
                    command.AddParameterInt("@idUser", data.Id);
                    command.AddParameterString("@meno", data.Meno);
                    command.AddParameterString("@priezvisko", data.Priezvisko);
                    command.AddParameterString("@email", data.Email);
                    command.AddParameterString("@telefon", data.Telefon);
                    command.AddParameterInt("@idZbor", data.IdZbor);
                    command.AddParameterString("@inyZbor", data.InyZbor);

                    command.AddParameterBool("@piatokVecera", data.PiatokVecera);
                    command.AddParameterBool("@piatokVecera2", data.PiatokVecera2);
                    command.AddParameterInt("@idUbytovaniePiatokSobota", data.IdUbytovaniePiatokSobota);

                    command.AddParameterBool("@sobotaRanajky", data.SobotaRanajky);
                    command.AddParameterBool("@sobotaObed", data.SobotaObed);
                    command.AddParameterBool("@sobotaVecera", data.SobotaVecera);
                    command.AddParameterBool("@sobotaVecera2", data.SobotaVecera2);
                    command.AddParameterInt("@idUbytovanieSobotaNedela", data.IdUbytovanieSobotaNedela);

                    command.AddParameterBool("@nedelaRanajky", data.NedelaRanajky);
                    command.AddParameterBool("@nedelaObed", data.NedelaObed);

                    command.AddParameterBool("@sach", data.Sach);
                    command.AddParameterBool("@pingPong", data.PingPong);
                    command.AddParameterInt("@idTricko", data.IdTricko);
                    command.AddParameterInt("@idSluziaci", data.IdSluziaci);
                    command.AddParameterInt("@idDobrovolnik", data.IdDobrovolnik);
                    command.AddParameterString("@poznamka", data.Poznamka);
                    command.AddParameterFloat("@registracny", data.RegistracnyOverride);

                    command.ExecuteNonQuery();
                }
            }
            transaction.Complete();
        }
    }
예제 #22
0
 public async Task <JSONResult <DetailData> > GetGoodData([FromBody] int ID)
 {
     return(await Task.Run(() =>
     {
         return new BaseJsonResult().UnifiedFucn(() =>
         {
             var model = new JSONResult <DetailData>();
             model.Success = true;
             DetailData data = new DetailData()
             {
                 ID = ID, favorite = true, imgList = "测试", title = "纯种金毛幼犬活体有血统证书", title2 = "拆家小能手 你值得拥有"
             };
             model.ret = 0;
             model.Result = "请求成功";
             model.Content = data;
             return model;
         });
     }));
 }
예제 #23
0
 private void BindData(DetailData result)
 {
     var data = new List<Detail>();
     //��û���¼�������ǰ��
     data.AddRange(result.Data.Where(d => d.SubDetails == null).ToList());
     data.AddRange(result.Data.Where(d => d.SubDetails != null).ToList());
     var root = new TreeViewItem();
     var panel = new WrapPanel();
     panel.Orientation = System.Windows.Controls.Orientation.Horizontal;
     panel.Children.Add(new TextBlock { Text = "���ݿ�����", FontWeight = FontWeights.Bold });
     panel.Children.Add(new TextBlock { Text = result.DatabaseName });
     panel.Children.Add(new TextBlock { Text = "������", FontWeight = FontWeights.Bold, Margin = new Thickness(5, 0, 0, 0) });
     panel.Children.Add(new TextBlock { Text = result.TableName });
     panel.Children.Add(new TextBlock { Text = "������", FontWeight = FontWeights.Bold, Margin = new Thickness(5, 0, 0, 0) });
     panel.Children.Add(new TextBlock { Text = DetailCondition.ID });
     root.Header = panel;
     root.IsExpanded = true;
     BindTree(root, data);
     DataTree.Items.Add(root);
 }
예제 #24
0
        private void HandleDetails(byte[] data)
        {
            MyAPIGateway.Parallel.Start(() =>
            {
                try
                {
                    if (MyAPIGateway.Session == null)
                    {
                        return;
                    }

                    if (NaniteConstructionManager.NaniteBlocks == null)
                    {
                        return;
                    }

                    DetailData details = MyAPIGateway.Utilities.SerializeFromXML <DetailData>(ASCIIEncoding.ASCII.GetString(data));

                    if (details == null)
                    {
                        return;
                    }
                    //Logging.Instance.WriteLine(string.Format("HandleDetails: {0}", details.EntityId));

                    foreach (var item in NaniteConstructionManager.NaniteBlocks)
                    {
                        if (item.Key == details.EntityId && item.Value.Initialized)
                        {
                            //Logging.Instance.WriteLine(string.Format("Details for Factory: {0}", details.EntityId));
                            item.Value.SyncDetails(details);
                            break;
                        }
                    }
                }
                catch (Exception ex)
                {
                    Logging.Instance.WriteLine(string.Format("HandleDetails() Error: {0}", ex.ToString()));
                }
            });
        }
예제 #25
0
        /// <summary>
        /// 解析对应站点数据
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public List <DetailData> TicketQueryAction(ResponseTicketQuery query)
        {
            var details = new List <DetailData>();

            string[] data = query.data.result;
            foreach (var item in data)
            {
                var        r_list = item.Split(new char[] { '|' });
                DetailData detail = new DetailData
                {
                    trainId                = r_list[0],
                    operat_remark          = r_list[1],
                    complete_train_no      = r_list[2],
                    train_no               = r_list[3],
                    start_station_telecode = r_list[4],
                    end_station_telecode   = r_list[5],
                    from_station_telecode  = r_list[6],
                    to_station_telecode    = r_list[7],
                    start_time             = r_list[8],
                    arrive_time            = r_list[9],
                    lishi             = r_list[10],
                    cross_days        = r_list[11],
                    cross_days_reamrk = r_list[12],
                    departure_date    = r_list[13],
                    gr_num            = r_list[21],
                    qt_num            = r_list[22],
                    rw_num            = r_list[23],
                    rz_num            = r_list[24],
                    dw_num            = r_list[25],
                    wz_num            = r_list[26],
                    yw_num            = r_list[28],
                    yz_num            = r_list[29],
                    ze_num            = r_list[30],
                    zy_num            = r_list[31],
                    swz_num           = r_list[32],
                };
                details.Add(detail);
            }
            return(details);
        }
예제 #26
0
        public DetailData GetDetailData(string databasePrefix, string databaseName, string tableName, string pkColumnName, string Id)
        {
            try
            {
                var detailData = new DetailData()
                {
                    DatabasePrefix = databasePrefix,
                    DatabaseName   = databaseName,
                    PkColumnName   = pkColumnName,
                    TableName      = tableName,
                };
                var data         = new List <Detail>();
                var typeFullName = MongodbServerMaintainceCenter.GetTypeFullName(databasePrefix);
                var server       = CreateSlaveMongoServer(typeFullName);
                var database     = server.GetDatabase(databaseName);
                var collection   = database.GetCollection(tableName);
                var row          = collection.FindOne(Query.EQ(pkColumnName, Id));
                if (row != null)
                {
                    var columnDescriptions     = MongodbServerMaintainceCenter.GetMongodbColumnDescriptions(databasePrefix);
                    var enumColumnDescriptions = MongodbServerMaintainceCenter.GetMongodbEnumColumnDescriptions(databasePrefix);

                    foreach (var col in row)
                    {
                        InternalGetDetailData(string.Empty, data, col, columnDescriptions, enumColumnDescriptions, pkColumnName);
                    }
                    detailData.Data = data;
                    return(detailData);
                }
                return(null);
            }
            catch (Exception ex)
            {
                LocalLoggingService.Error("{0} {1} {2} {3}", MongodbServerConfiguration.ModuleName, "MongodbServer_Detail", "GetDetailData", ex.Message);
                throw;
            }
        }
 public ReorderableMaterialList(TerraConfig config, DetailData detail) : base(detail.SplatsData, null, MAX_HEIGHT)
 {
     _detail = detail;
 }
 public DetailSubList(TerraConfig config, DetailData details)
 {
     ObjectsList   = new ReorderableObjectList(config, details);
     MaterialsList = new ReorderableMaterialList(config, details);
 }
예제 #29
0
        public static async Task <DetailData> GetDataByLink(string link)
        {
            var        client = new HttpClient();
            DetailData dd     = new DetailData();

            try
            {
                string s = await client.GetStringAsync(link);

                var doc = new HtmlDocument();
                doc.LoadHtml(s);

                HtmlNode parent = doc.DocumentNode
                                  .Descendants("table")
                                  .FirstOrDefault(o => o.GetAttributeValue("style", "")
                                                  ==
                                                  "width: 90%; margin-top: 19px; margin-left: auto; margin-right: auto; padding-top: 10px; text-align: left;");



                if (parent == null)
                {
                    return(dd);
                }

                dd.Caption      = parent.ChildNodes[1].InnerText.Trim();
                dd.DetailString = parent.ChildNodes[3].OuterHtml.Split('\n');
                dd.Text         = parent.ChildNodes[5].ChildNodes[1].ChildNodes[1].InnerText.Trim();

                dd.ImageLinks = new ObservableCollection <ImageData>();

                foreach (
                    var n in parent.ChildNodes[9].ChildNodes[1].ChildNodes[1].ChildNodes[0].ChildNodes[1].ChildNodes)
                {
                    if (n.Name != "a")
                    {
                        continue;
                    }
                    try
                    {
                        var r = new ImageData {
                            ImageLink = n.ChildNodes[0].Attributes[0].Value
                        };

                        dd.ImageLinks.Add(r);
                    }
                    catch (Exception)
                    {
                        // ignored
                    }
                }

                int idx = dd.Text.IndexOf("Контактные телефоны", StringComparison.Ordinal);
                if (idx != -1)
                {
                    dd.Contact = dd.Text.Substring(idx, dd.Text.Length - idx);
                    dd.Text    = dd.Text.Substring(0, idx).Trim();
                }
                return(dd);
            }
            catch (Exception)
            {
                return(dd);
            }
            return(new DetailData());
        }
예제 #30
0
 public ImagePageViewModel(DetailData data)
 {
     Data = data;
 }
예제 #31
0
파일: Database.cs 프로젝트: jaroban/Web
    public static int? UpdateOrCreate(DetailData data)
    {
        int? idUser;
        using (var transaction = new TransactionScope())
        {
            using (var sqlConnection = new SqlConnection(ConnectionString))
            {
                using (var command = sqlConnection.CreateCommand())
                {
                    command.PrepareStoredProcedure(sqlConnection, "UpdateOrAddUser");
                    command.AddParameterInt("@idUser", data.Id);
                    command.AddParameterString("@Meno", data.Meno);
                    command.AddParameterString("@Priezvisko", data.Priezvisko);
                    command.AddParameterString("@Email", data.Email);
                    command.AddParameterString("@Telefon", data.Telefon);
                    command.AddParameterInt("@IdZbor", data.IdZbor);
                    command.AddParameterString("@InyZbor", data.InyZbor);

                    command.AddParameterBool("@PiatokVecera", data.PiatokVecera);
                    command.AddParameterBool("@PiatokVecera2", data.PiatokVecera2);
                    command.AddParameterBool("@UbytovaniePiatokSobota", data.UbytovaniePiatokSobota);
                    command.AddParameterBool("@TichaTriedaPiatokSobota", data.TichaTriedaPiatokSobota);

                    command.AddParameterBool("@SobotaRanajky", data.SobotaRanajky);
                    command.AddParameterBool("@SobotaObed", data.SobotaObed);
                    command.AddParameterBool("@SobotaVecera", data.SobotaVecera);
                    command.AddParameterBool("@SobotaVecera2", data.SobotaVecera2);
                    command.AddParameterBool("@UbytovanieSobotaNedela", data.UbytovanieSobotaNedela);
                    command.AddParameterBool("@TichaTriedaSobotaNedela", data.TichaTriedaSobotaNedela);

                    command.AddParameterBool("@NedelaRanajky", data.NedelaRanajky);
                    command.AddParameterBool("@NedelaObed", data.NedelaObed);

                    command.AddParameterBool("@Sach", data.Sach);
                    command.AddParameterBool("@PingPong", data.PingPong);
                    command.AddParameterInt("@IdTricko", data.IdTricko);
                    command.AddParameterBool("@Sluziaci", data.Dobrovolnik);
                    command.AddParameterString("@Poznamka", data.Poznamka);

                    command.AddParameterBool("@Internat1", data.Internat1);
                    command.AddParameterBool("@Internat2", data.Internat2);
                    command.AddParameterFloat("@Preplacame", data.CashBack);
                    command.AddParameterBool("@InternatZadarmo", data.InternatZadarmo);
                    command.AddParameterBool("@RegistraciaZadarmo", data.RegistraciaZadarmo);
                    command.AddParameterBool("@JedloZadarmo", data.JedloZadarmo);

                    command.AddParameterBool("@Prisli", data.Prisli);
                    command.AddParameterBool("@IstoPride", data.IstoPride);
                    command.AddParameterFloat("@Donation", data.Dar);

                    command.AddOutputParameterInt("@NewId");

                    sqlConnection.Open();
                    command.ExecuteNonQuery();

                    idUser = command.Parameters["@NewId"].Value as int?;
                }
            }
            transaction.Complete();
        }
        return idUser;
    }
    private Dictionary <int, Rect> _positions;    //Cached positions at last repaint

    public ReorderableObjectList(TerraConfig config, DetailData detail) : base(detail.ObjectData, null, MAX_HEIGHT)
    {
        _positions = new Dictionary <int, Rect>();
    }
예제 #33
0
파일: Database.cs 프로젝트: jaroban/Web
    public static DetailData GetDetail(int idUser)
    {
        var result = new DetailData { Group = new List<IdName>() };

        using (var sqlConnection = new SqlConnection(ConnectionString))
        {
            using (var command = sqlConnection.CreateCommand())
            {
                command.PrepareStoredProcedure(sqlConnection, "GetDetail");
                command.AddParameterInt("@idUser", idUser);

                sqlConnection.Open();
                using (var reader = command.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        var i = 0;
                        result.Id = reader.GetInt32(i++);
                        result.Meno = reader.GetString(i++);
                        result.Priezvisko = reader.GetString(i++);
                        result.Email = reader.GetString(i++);
                        result.Telefon = reader.GetString(i++);
                        result.IdZbor = reader.IsDBNull(i) ? (int?)null : reader.GetInt32(i); i++;
                        result.InyZbor = reader.IsDBNull(i) ? null : reader.GetString(i); i++;
                        result.PiatokVecera = reader.GetBoolean(i++);
                        result.PiatokVecera2 = reader.GetInt32(i++) > 0;
                        result.UbytovaniePiatokSobota = reader.GetBoolean(i++);
                        result.TichaTriedaPiatokSobota = reader.GetBoolean(i++);
                        result.SobotaRanajky = reader.GetBoolean(i++);
                        result.SobotaObed = reader.GetBoolean(i++);
                        result.SobotaVecera = reader.GetBoolean(i++);
                        result.SobotaVecera2 = reader.GetInt32(i++) > 0;
                        result.UbytovanieSobotaNedela = reader.GetBoolean(i++);
                        result.TichaTriedaSobotaNedela = reader.GetBoolean(i++);
                        result.NedelaRanajky = reader.GetBoolean(i++);
                        result.NedelaObed = reader.GetBoolean(i++);
                        result.Sach = reader.GetBoolean(i++);
                        result.PingPong = reader.GetBoolean(i++);
                        result.IdTricko = reader.IsDBNull(i) ? (int?)null : reader.GetInt32(i); i++;
                        result.Dobrovolnik = reader.GetBoolean(i++);
                        result.Poznamka = reader.GetString(i++);
                        result.DtRegistered = reader.IsDBNull(i) ? (DateTime?)null : reader.GetDateTime(i); i++;
                        result.Internat1 = reader.GetBoolean(i++);
                        result.Internat2 = reader.GetBoolean(i++);
                        result.CashBack = (float)reader.GetDecimal(i++);
                        result.InternatZadarmo = reader.GetBoolean(i++);
                        result.RegistraciaZadarmo = reader.GetBoolean(i++);
                        result.JedloZadarmo = reader.GetBoolean(i++);
                        result.DtPlatba = reader.IsDBNull(i) ? (DateTime?)null : reader.GetDateTime(i); i++;
                        result.Prisli = reader.GetBoolean(i++);
                        result.Suma = (float)reader.GetDecimal(i++);
                        result.IstoPride = reader.GetBoolean(i++);
                        result.Zaplatili = (float)reader.GetDecimal(i++);
                        result.SkupinaDlzi = (float)reader.GetDecimal(i++);
                        result.Dar = (float)reader.GetDecimal(i++);
                        result.Preplatok = (float)reader.GetDecimal(i++);
                    }
                    reader.NextResult();

                    result.Group = reader.GetListOfIdNames();
                }
            }
        }
        return result;
    }
예제 #34
0
    //今回の結果を引数、ランキングを更新するスクリプト
    public void ScoreUpdate(float ResultNum, string RTotalTime, string RItemNum, string ROnceTime)
    {
        DetailData[] detaildata = new DetailData[5];
        for (int i = 0; i < 5; i++)
        {
            detaildata[i] = new DetailData();
        }

        #if UNITY_EDITOR        //デバッグ時
        filePath       = Application.dataPath + @"\Ranking\TopScore.txt";
        detailFilePath = Application.dataPath + @"\Ranking\";
        #elif UNITY_STANDALONE
        filePath       = Application.persistentDataPath + @"\Ranking\TopScore.txt";
        detailFilePath = Application.persistentDataPath + @"\Ranking\";
        #elif UNITY_ANDROID  //リリース時
        filePath       = Application.persistentDataPath + @"\Ranking\TopScore.txt";
        detailFilePath = Application.persistentDataPath + @"\Ranking\";
        #endif

        //ファイルが無かった時にファイルを作成
        if (!File.Exists(filePath))
        {
            File.AppendAllText(filePath, "99:00.00\n99:00.00\n99:00.00\n99:00.00\n99:00.00");
        }
        //詳細データファイルが無かった時に作成
        for (int i = 0; i < 5; i++)
        {
            if (!File.Exists(detailFilePath + "Detail" + i + ".txt"))
            {
                File.AppendAllText(detailFilePath + "Detail" + i + ".txt", "99:00.00\n1\n99:00.00\n9999/99/99\nリスト");
            }
        }

        //ランキングが旧型式だった場合アップデート
        string[] detailtext = File.ReadAllLines(detailFilePath + "Detail0.txt");
        if (detailtext.Length < 5)
        {
            for (int i = 0; i < 5; i++)
            {
                File.WriteAllText(detailFilePath + "Detail" + i + ".txt", "99:00.00\n1\n99:00.00\n9999/99/99\nリスト");
            }
        }

        string[] allText = File.ReadAllLines(filePath);     //ファイルの中身を取り出す
        //詳細ファイルの中身を取り出す
        for (int i = 0; i < 5; i++)
        {
            string[] DetailText = File.ReadAllLines(detailFilePath + "Detail" + i + ".txt");
            detaildata[i].DataSet(DetailText[0], DetailText[1], DetailText[2], DetailText[3], DetailText[4]);
            Debug.Log(i + "の合計時間を取得" + detaildata[i].getTotalTime());
        }

        //ランキング内の数字を秒で表示
        for (int i = 0; i < 5; i++)
        {
            string[] RankScoreString = allText[i].Split(':');
            RankScoreFloat[i] = float.Parse(RankScoreString[0]) * 60 + float.Parse(RankScoreString[1]);
        }


        //現在のスコアをランキングに反映
        DateTime dt = DateTime.Now;
        Debug.Log("今は + " + dt.ToString("d"));

        float      temp, temp2;
        DetailData detailTemp  = new DetailData();
        DetailData detailTemp2 = new DetailData();
        for (int i = 0; i < 5; i++)
        {
            //現在のスコアがランキングに入るとき
            if (RankScoreFloat[i] > ResultNum)
            {
                //ランキング更新
                temp = RankScoreFloat[i];
                RankScoreFloat[i] = ResultNum;
                //詳細情報更新
                detailTemp.setTotalTime(detaildata[i].getTotalTime());
                detailTemp.setItemNum(detaildata[i].getItemNum());
                detailTemp.setOnceTime(detaildata[i].getOnceTime());
                detailTemp.setNowDate(detaildata[i].getNowDate());
                detailTemp.setListName(detaildata[i].getListName());
                detaildata[i].setTotalTime(RTotalTime);
                detaildata[i].setItemNum(RItemNum);
                detaildata[i].setOnceTime(ROnceTime);
                detaildata[i].setNowDate(dt.ToString("yyyy/MM/dd"));
                detaildata[i].setListName(RankingUpdate.listName);
                i++;
                for (; i < 5; i++)
                {
                    //ランキング情報をずらす
                    temp2             = RankScoreFloat[i];
                    RankScoreFloat[i] = temp;
                    temp = temp2;
                    //詳細情報をずらす
                    detailTemp2.setTotalTime(detaildata[i].getTotalTime());
                    detailTemp2.setItemNum(detaildata[i].getItemNum());
                    detailTemp2.setOnceTime(detaildata[i].getOnceTime());
                    detailTemp2.setNowDate(detaildata[i].getNowDate());
                    detailTemp2.setListName(detaildata[i].getListName());
                    detaildata[i].setTotalTime(detailTemp.getTotalTime());
                    detaildata[i].setItemNum(detailTemp.getItemNum());
                    detaildata[i].setOnceTime(detailTemp.getOnceTime());
                    detaildata[i].setNowDate(detailTemp.getNowDate());
                    detaildata[i].setListName(detailTemp.getListName());
                    detailTemp.setTotalTime(detailTemp2.getTotalTime());
                    detailTemp.setItemNum(detailTemp2.getItemNum());
                    detailTemp.setOnceTime(detailTemp2.getOnceTime());
                    detailTemp.setNowDate(detailTemp2.getNowDate());
                    detailTemp.setListName(detailTemp2.getListName());
                }
            }
        }

        //スコアを分、秒表記に変換
        string[] ScoreTime = new string[5];
        for (int i = 0; i < 5; i++)
        {
            ScoreTime[i] = ((int)(RankScoreFloat[i]) / 60).ToString() + ":" + (RankScoreFloat[i] - ((int)(RankScoreFloat[i]) / 60) * 60).ToString("00.00");
        }


        //更新したスコアを保存
        string ScoreAllText = ScoreTime[0] + "\n" + ScoreTime[1] + "\n" + ScoreTime[2] + "\n" + ScoreTime[3] + "\n" + ScoreTime[4];
        File.WriteAllText(filePath, ScoreAllText);
        for (int i = 0; i < 5; i++)
        {
            string DetailAllText = detaildata[i].getTotalTime() + "\n" + detaildata[i].getItemNum() + "\n" + detaildata[i].getOnceTime() + "\n" + detaildata[i].getNowDate() + "\n" + detaildata[i].getListName();
            File.WriteAllText(detailFilePath + "Detail" + i + ".txt", DetailAllText);
        }
    }
예제 #35
0
 public void Insert(DetailData detail, int x, int y)
 {
     details.Add(detail);
     addreses.Add(new CVect(x, y));
 }
예제 #36
0
파일: Detail.aspx.cs 프로젝트: jaroban/Web
    protected void btnSave_Click(object sender, EventArgs e)
    {
        var errors = new List<string>();
        if (string.IsNullOrWhiteSpace(txtMeno.Text)) errors.Add(Common.ChybaMeno);
        if (string.IsNullOrWhiteSpace(txtPriezvisko.Text)) errors.Add(Common.ChybaPriezvisko);
        if (!Common.ValidateEmail(txtEmail.Text.Trim())) errors.Add(Common.ChybaEmail);
        float sponzorskyDar = 0;
        if (!string.IsNullOrWhiteSpace(txtDar.Text))
        {
            if (!float.TryParse(txtDar.Text, out sponzorskyDar))
            {
                errors.Add(Common.ChybaSponzorskyDar);
            }
        }
        var idTricko = ddlTricko.SelectedValue.StringToInt();
        if (idTricko == 0) idTricko = null;
        var idZbor = ddlZbor.SelectedValue.StringToInt();
        if (idZbor == 0 || idZbor == -1) idZbor = null;
        float cashback = 0;
        if (!string.IsNullOrWhiteSpace(txtCashBack.Text))
        {
            if (!float.TryParse(txtCashBack.Text, out cashback))
            {
                errors.Add(Common.ChybaPreplacame);
            }
        }

        lblError.Text = "";
        if (errors.Count > 0)
        {
            lblError.Text = string.Join("<br/>", errors);
            return;
        }

        var data = new DetailData
        {
            Id = _id,
            Meno = txtMeno.Text,
            Priezvisko = txtPriezvisko.Text,
            Email = txtEmail.Text,
            Telefon = txtTelefon.Text,
            IdZbor = idZbor,
            InyZbor = txtInyZbor.Text,
            PiatokVecera = chbPiatokVecera.Checked,
            PiatokVecera2 = chbPiatokVecera2.Checked,
            UbytovaniePiatokSobota = chbUbytovaniePiatokSobota.Checked,
            TichaTriedaPiatokSobota = chbTichaTriedaPiatokSobota.Checked,
            SobotaRanajky = chbSobotaRanajky.Checked,
            SobotaObed = chbSobotaObed.Checked,
            SobotaVecera = chbSobotaVecera.Checked,
            SobotaVecera2 = chbSobotaVecera2.Checked,
            UbytovanieSobotaNedela = chbUbytovanieSobotaNedela.Checked,
            TichaTriedaSobotaNedela = chbTichaTriedaSobotaNedela.Checked,
            NedelaRanajky = chbNedelaRanajky.Checked,
            NedelaObed = chbNedelaObed.Checked,
            Sach = chbSach.Checked,
            PingPong = chbPingPong.Checked,
            IdTricko = idTricko,
            Dobrovolnik = chbDobrovolnik.Checked,
            Poznamka = txtPoznamka.Text,
            Internat1 = chbInternat1.Checked,
            Internat2 = chbInternat2.Checked,
            CashBack = cashback,
            InternatZadarmo = chbInternatZadarmo.Checked,
            RegistraciaZadarmo = chbRegistraciaZadarmo.Checked,
            JedloZadarmo = chbJedloZadarmo.Checked,
            Prisli = chbPrisli.Checked,
            IstoPride = chbIstoPride.Checked,
            Dar = sponzorskyDar
        };

        int? newId;
        try
        {
            newId = Database.UpdateOrCreate(data);
        }
        catch(Exception ex)
        {
            lblError.Text = ex.Message + "<br/>" + ex.InnerException;
            return;
        }
        if (!_id.HasValue && newId.HasValue)
        {
            // just created a user
            Response.Redirect(string.Format("/Detail.aspx?id={0}", newId.Value));
            return;
        }
        if (_id.HasValue && !data.Id.HasValue)
        {
            // user is not in DB
            Response.Redirect("/Detail.aspx");
            return;
        }
        // updated a user
        _reload = true;
        lblSuccess.Text = "Zmeny boli úspešne uložené";
    }