Beispiel #1
0
 public static void Create(int port, GetData gd, OnJoin join, OnLeft left)
 {
     connects = new Dictionary<ushort, TcpClientm>();
     Socket = new TcpListener(IPAddress.Any, port);
     _gd = gd;
     _join = join;
     _left = left;
 }
Beispiel #2
0
        public void MetaData_AfterLink()
        {
            MetaData Meta = MetaData.GetMetaData(this);

            QHC = Meta.Conn.GetQueryHelper();
            bool   IsAdmin = false;
            string filter;

            if (Meta.GetSys("manage_prestazioni") != null)
            {
                IsAdmin = (Meta.GetSys("manage_prestazioni").ToString() == "S");
            }
            Meta.CanSave       = IsAdmin;
            Meta.CanInsert     = IsAdmin;
            Meta.CanInsertCopy = IsAdmin;
            Meta.CanCancel     = IsAdmin;
            //filter = QHC.AppAnd(Meta.QHC.CmpEq("ayear", Meta.GetSys("esercizio")), QHC.CmpEq("active", "S"));
            filter = QHC.CmpEq("active", "S");
            GetData.SetStaticFilter(DS.apactivitykind, filter);
        }
 protected void setDatas()
 {
     if (Request.QueryString["id"] != null)
     {
         ModifyDB myObjModifyDB = new ModifyDB();
         GetData  myObjGetData  = new GetData();
         try
         {
             string strQry0 = "SELECT a.ID, a.CODE, a.IDCARD, a.FNAME, a.LNAME, a.MNAME, a.BIRTHDATE, a.TEL, a.TEL2, a.EMAIL, a.ADDRESS, CASE WHEN a.GENDER=1 THEN N'Эр' ELSE N'Эм' END AS GENDER, ISNULL(a.PICTURE,'male.jpg') as PICTURE, b.NAME as POSITIONNAME, CASE WHEN a.ISACTIVE=1 THEN '<span class=\"label label-success\">ACTIVE</span>' ELSE '<span class=\"label label-default\">OFF</span>' END as TYPE FROM TBL_STAFF a INNER JOIN TBL_STAFF_POSITION b ON a.STAFF_POSITION_ID=b.ID WHERE a.ID=" + Request.QueryString["id"] + " ORDER BY CODE";
             ds = myObjModifyDB.ExecuteDataSet(strQry0);
             if (ds.Tables[0].Rows[0]["PICTURE"].ToString() == "")
             {
                 staffImage.Src = "../img/staff/male.jpg";
             }
             else
             {
                 staffImage.Src = "../img/staff/" + ds.Tables[0].Rows[0]["PICTURE"].ToString();
             }
             staffDetail.InnerHtml       = ds.Tables[0].Rows[0]["TYPE"].ToString() + "<br><br><span lang=\"mn\">Код:</span> " + ds.Tables[0].Rows[0]["CODE"].ToString() + "<br><br><span lang=\"mn\">" + ds.Tables[0].Rows[0]["GENDER"].ToString() + "</span>";
             staffNamePosition.InnerHtml = ds.Tables[0].Rows[0]["LNAME"].ToString() + " <span class=\"semi-bold\">" + ds.Tables[0].Rows[0]["FNAME"].ToString() + "</span><br><small>" + ds.Tables[0].Rows[0]["POSITIONNAME"].ToString() + "</small>";
             staffMname.InnerHtml        = ds.Tables[0].Rows[0]["MNAME"].ToString();
             staffIDCard.InnerHtml       = ds.Tables[0].Rows[0]["IDCARD"].ToString();
             staffBirthday.InnerHtml     = ds.Tables[0].Rows[0]["BIRTHDATE"].ToString();
             staffPhone.InnerHtml        = ds.Tables[0].Rows[0]["TEL"].ToString() + " " + ds.Tables[0].Rows[0]["TEL2"].ToString();
             staffEmail.InnerHtml        = ds.Tables[0].Rows[0]["EMAIL"].ToString();
             staffAddress.InnerHtml      = ds.Tables[0].Rows[0]["ADDRESS"].ToString();
             //createdInfo.InnerHtml = ds.Tables[0].Rows[0]["CREATED_STAFFID"].ToString() + " " + ds.Tables[0].Rows[0]["CREATED_DATE"].ToString();
             //updatedInfo.InnerHtml = ds.Tables[0].Rows[0]["UPDATED_STAFFID"].ToString() + " " + ds.Tables[0].Rows[0]["UPDATED_DATE"].ToString();
         }
         catch (cs.MyException ex)
         {
             myObjGetData.exeptionMethod(ex);
             Response.Redirect("~/#pg/error500.aspx");
         }
         catch (Exception ex)
         {
             myObjGetData.exeptionMethod(ex);
             Response.Redirect("~/#pg/error500.aspx");
         }
     }
 }
Beispiel #4
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            // progressPanel1.Visible = true;
            //System.Threading.Thread.SpinWait(100);
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                //int iMonth = dateEdit1.DateTime.Month;
                //int iYear = dateEdit1.DateTime.Year;

                Connection.ConnectSQLSERVER();
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "Get_DSKH";
                cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.Add(new SqlParameter("@iMonth", iMonth));
                //cmd.Parameters.Add(new SqlParameter("@iYear", iYear));
                cmd.Connection     = Connection.conn;
                cmd.CommandTimeout = 300;
                // System.Threading.Thread.Sleep(500);
                cmd.ExecuteNonQuery();
                //table D_dmkh luu gia tri thang va nam lay du lieu khach hang
                string SQL1 = "DELETE FROM D_dmkh WHERE thang=" + dateEdit1.DateTime.Month + " AND nam=" + dateEdit1.DateTime.Year;
                bool   t1   = GetData.Excute_SQL_Command(SQL1);
                string SQL  = "INSERT INTO D_dmkh(thang,nam) VALUES(" + dateEdit1.DateTime.Month + "," + dateEdit1.DateTime.Year + ")";
                bool   t    = GetData.Excute_SQL_Command(SQL);
                if (t)
                {
                    MessageBox.Show("Đã lấy dữ liệu xong khách hàng xong !");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Lỗi:" + ex.Message);
            }
            finally
            {
                // progressPanel1.Visible = false;
                Cursor.Current = Cursors.Default;
                Connection.DisconnectData();
            }
        }
        //*******************************************************************
        /// <summary>
        /// 绑定画面
        /// </summary>
        /// <history>
        ///     完成信息:李梓楠      2010/11/8 完成
        ///     更新信息:
        /// </history>
        //*******************************************************************
        private void BandingDgv()
        {
            try
            {
                dataAccess = new DataAccess();
                dataAccess.Open();

                GetData getData = new GetData(dataAccess.Connection);

                SearchParameter sp = new SearchParameter();
                sp.SetValue(":customer_flag", "1");

                DataTable dt = getData.GetTableBySqlStr(Constants.SqlStr.TC_CUSTOMER_RIGHTJOIN_TC_ARCHIVES, sp);

                dgv.AutoGenerateColumns = false;
                dt.Columns.Add("index", typeof(int));
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dt.Rows[i]["index"] = i + 1;
                }
                dgv.DataSource = dt;

                //使被修改对线变为选中行
                if (dgv != null && dgv.Rows.Count > 0 && countNum != 0)
                {
                    dgv.Rows[0].Selected                = false;
                    dgv.Rows[countNum].Selected         = true;
                    dgv.FirstDisplayedScrollingRowIndex = countNum;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("数据加载时发生错误,请检查数据库!", Text, MessageBoxButtons.OK, MessageBoxIcon.Information);

                throw ex;
            }
            finally
            {
                dataAccess.Close();
            }
        }
Beispiel #6
0
        private bool getNewDirection()
        {
            int      distance = 99, temp;
            Waypoint waypoint;
            int      nextStatementID = actualStatementIndex;

            for (int i = actualStatementIndex + 1; i != actualStatementIndex; i++) //checking waypoints and gets the closest one
            {
                lock (list)
                {
                    if (i >= list.Count())
                    {
                        i = 0;
                        if (i == actualStatementIndex)
                        {
                            break;
                        }
                    }

                    if (list[i].type == StatementType.getType["Waypoint"]) // if statement is waypoint
                    {
                        waypoint = (Waypoint)list[i];
                        if (GetData.isOnScreen(waypoint.xPos, waypoint.yPos, waypoint.floor))
                        {
                            if (distance > (temp = GetData.GetDistance(waypoint.xPos, waypoint.yPos) + (int)Math.Abs(i - actualStatementIndex) / 10))//setting the new result
                            {
                                distance        = temp;
                                nextStatementID = i - 1;
                            }
                        }
                    }
                    else if (list[i].type == StatementType.getType["Action"])// if statement is action
                    {
                        //throw new NotImplementedException();
                        //when all conditions are good then go to label
                    }
                }
            }
            actualStatementIndex = nextStatementID;
            return(distance < 99);
        }
 //*******************************************************************
 /// <summary>
 /// 入库页面初始化
 /// </summary>
 /// <history>
 ///     完成信息:吴小科      2010/07/13 完成
 ///     更新信息:
 /// </history>
 //*******************************************************************
 private void InitStorageForm_Load(object sender, EventArgs e)
 {
     try
     {
         //打开数据库
         dataAccess = new DataAccess();
         dataAccess.Open();
         //获取操作类
         GetData getData = new GetData(dataAccess.Connection);
         //设置加载条件
         SearchParameter sp = new SearchParameter();
         sp.SetValue(":input_type", '0');
         //获取绑定数据表
         DataTable dtInput_storage = getData.GetTableBySqlStr(Constants.SqlStr.TC_INPUT_INIT_STORAGE_LEFTJOIN_GOODS, sp);
         //添加序列号
         int countNumber = 0;
         dtInput_storage.Columns.Add("num", typeof(int));
         for (int i = 0; i < dtInput_storage.Rows.Count; i++)
         {
             dtInput_storage.Rows[i]["num"] = ++countNumber;
         }
         //绑定数据
         dataGridView_input_storage.DataSource = dtInput_storage;
         if (dataGridView_input_storage != null && dataGridView_input_storage.Rows.Count > 0 && countNum != 0)
         {
             dataGridView_input_storage.Rows[0].Selected        = false;
             dataGridView_input_storage.Rows[countNum].Selected = true;
         }
         //设定按钮状态
         SetButtonState();
         textBox_input_code.Focus();
     }
     catch (Exception ex)
     {
         MessageBox.Show("请查看数据库是否正常!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     finally
     {   //关闭数据库
         dataAccess.Close();
     }
 }
Beispiel #8
0
        public void OutputJson()
        {
            var data        = new GetData();
            var coal        = data.CoalData;
            var hydro       = data.HydroData;
            var wind        = data.WindData;
            var biomass     = data.BiomassData;
            var gas         = data.GasData;
            var interchange = data.InterchangeData;
            var summary     = data.SummaryData;
            var dataTable   = new Hashtable
            {
                { "summary", summary },
                { "interchange", interchange },
                { "coal", coal },
                { "hydro", hydro },
                { "wind", wind },
                { "biomass", biomass }
            };

            for (int i = 0; i < gas.Count; i++)
            {
                switch (i)
                {
                case 0:
                    dataTable.Add("simple", gas[i]);
                    break;

                case 1:
                    dataTable.Add("cogeneration", gas[i]);
                    break;

                case 2:
                    dataTable.Add("combined", gas[i]);
                    break;
                }
            }
            string output = JsonConvert.SerializeObject(dataTable);

            Console.WriteLine(output);
        }
Beispiel #9
0
        //*******************************************************************
        /// <summary>
        /// 绑定画面
        /// </summary>
        /// <history>
        ///     完成信息:李梓楠      2010/7/26 完成
        ///     更新信息:
        /// </history>
        //*******************************************************************
        private void BandingDgv()
        {
            try
            {
                dataAccess = new DataAccess();
                dataAccess.Open();

                GetData getData = new GetData(dataAccess.Connection);

                SearchParameter sp = new SearchParameter();

                DataTable dtCounter = getData.GetTableBySqlStr(Constants.SqlStr.TC_APPARATUS_QUALITY_SELECT, sp);

                dtCounter.Columns.Remove("customer_code");
                dtCounter.Columns.Remove("input_goods_code");
                dtCounter.Columns.Remove("input_code");
                dtCounter.Columns.Add("index", typeof(int));
                for (int i = 0; i < dtCounter.Rows.Count; i++)
                {
                    dtCounter.Rows[i]["index"] = i + 1;
                }
                dgv.DataSource = dtCounter;

                //使被修改对线变为选中行
                if (dgv != null && dgv.Rows.Count > 0 && countNum != 0)
                {
                    dgv.Rows[0].Selected                = false;
                    dgv.Rows[countNum].Selected         = true;
                    dgv.FirstDisplayedScrollingRowIndex = countNum;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("请查看数据库是否正常!", Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                throw ex;
            }
            finally
            {
                dataAccess.Close();
            }
        }
        private static int PutIntoDeposit(List <DepositItem> toPutInto, int[] field)
        {
            int currentLine = 0;
            int y           = GetData.yPositionOfOpenedWindow(GetData.firstOpenedWindow) + Constants.ItemInOpenedWindowYOffset;

            //put items into depo
            if (toPutInto.Count > 0)
            {
                bool isMoreBackpack = true;

                while (isMoreBackpack)
                {
                    for (int i = 1; i < 18; i++)
                    {
                        List <DepositItem> list = toPutInto.Where(item => item.chestNumber == i).ToList();
                        if (list.Count > 0)
                        {
                            GetData.ScrollUpWindow(GetData.secondOpenedWindow);

                            int chestNumber = list[0].chestNumber - 1;

                            currentLine += ScrollDown(chestNumber, currentLine);
                            int x = field[chestNumber % 4];

                            int        fromX, fromY;
                            List <int> idList = LootItem.ToIdList(list);

                            while (GetData.getItemCoordinatesFromOpenedWindow(out fromX, out fromY, idList, GetData.secondOpenedWindow) && ModulesManager.walker.working)
                            {
                                MouseSimulator.drag(fromX, fromY, x, y, true);
                                Thread.Sleep(500);
                                KeyboardSimulator.Press("Enter");
                            }
                        }
                    }
                    isMoreBackpack = GetData.UseItemFromOpenedWindow(ModulesManager.targeting.nextContainer.ID, GetData.secondOpenedWindow);
                }
            }

            return(y);
        }
Beispiel #11
0
        public void MetaData_AfterLink()
        {
            Meta      = MetaData.GetMetaData(this);
            QHC       = new CQueryHelper();
            QHS       = Meta.Conn.GetQueryHelper();
            esercizio = (int)Meta.GetSys("esercizio");
            string filterEsercizio = QHS.CmpEq("ayear", esercizio);
            string filterPay       = QHS.CmpEq("ypay", esercizio);
            string filterPro       = QHS.CmpGe("ypro", esercizio);
            string filtroSpesa     = QHS.AppAnd(QHS.CmpEq("nphase", Meta.GetSys("maxexpensephase")), QHS.IsNotNull("idpay"));

            filtroSpesa = GetData.MergeFilters(filterEsercizio, filtroSpesa);
            GetData.SetStaticFilter(DS.expenseview, filtroSpesa);
            GetData.SetStaticFilter(DS.payment, filterPay);
            GetData.SetStaticFilter(DS.proceeds, filterPro);
            GetData.SetStaticFilter(DS.sortingview, filterEsercizio);

            object nomeFaseS = Meta.Conn.DO_READ_VALUE("expensephase", QHS.CmpEq("nphase", Meta.GetSys("maxexpensephase")), "description");
            string faseS     = (nomeFaseS != null) ? nomeFaseS.ToString() : "";

            grpSpesa.Text = faseS;
            btnSpesa.Text = faseS;

            standardTagBtnMandato = HelpForm.GetStandardTag(btnMandato.Tag);
            standardTagBtnSpesa   = HelpForm.GetStandardTag(btnSpesa.Tag);

            string filtroEntrata = QHS.AppAnd(QHS.CmpEq("nphase", Meta.GetSys("maxincomephase")), QHS.IsNotNull("idpro"));

            filtroEntrata = GetData.MergeFilters(filterEsercizio, filtroEntrata);
            GetData.SetStaticFilter(DS.incomeview, filtroEntrata);

            object nomeFaseE = Meta.Conn.DO_READ_VALUE("incomephase", QHS.CmpEq("nphase", Meta.GetSys("maxincomephase")), "description");
            string faseE     = (nomeFaseE != null) ? nomeFaseE.ToString() : "";

            grpEntrata.Text = faseE;
            btnEntrata.Text = faseE;

            standardTagBtnReversale  = HelpForm.GetStandardTag(btnReversale.Tag);
            standardTagBtnEntrata    = HelpForm.GetStandardTag(btnEntrata.Tag);
            btnCollegaBankImport.Tag = btnCollegaBankImport.Tag + "." + QHS.DoPar(QHS.CmpEq("ayear", Meta.GetSys("esercizio")));
        }
Beispiel #12
0
        //*******************************************************************
        /// <summary>
        /// 绑定画面
        /// </summary>
        /// <history>
        ///     完成信息:代国明      2010/07/15 完成
        ///     更新信息:
        /// </history>
        //*******************************************************************
        private void BandingDgvUnit()
        {
            try
            {
                //打开数据库连接
                dataAccess = new DataAccess();
                dataAccess.Open();

                //取得操作类
                GetData getData = new GetData(dataAccess.Connection);

                //取得单表数据
                dtUnit = getData.GetSingleTable("tc_unit");

                dtUnit.Columns.Add("index");

                for (int i = 0; i < dtUnit.Rows.Count; i++)
                {
                    dtUnit.Rows[i]["index"] = i + 1;
                }

                //绑定画面
                dgvUnit.DataSource = dtUnit;

                if (dgvUnit != null && dgvUnit.Rows.Count > 0 && countNum != 0)
                {
                    dgvUnit.Rows[0].Selected                = false;
                    dgvUnit.Rows[countNum].Selected         = true;
                    dgvUnit.FirstDisplayedScrollingRowIndex = countNum;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                //关闭数据库连接
                dataAccess.Close();
            }
        }
Beispiel #13
0
        public void Process()
        {
            FullRequest = StringBuilder.ToString();
            var lines = new List <string>(Regex.Split(FullRequest, "\r\n"));

            if (lines != null && lines.Count > 2)
            {
                var requestLine = lines[0].Split(' ');
                if (requestLine.Length == 3)
                {
                    Method = requestLine[0];
                    var requestedPage = requestLine[1].Split('?');
                    if (requestedPage.Length == 2)
                    {
                        var getData = requestedPage[1].Split('&');
                        foreach (var kvp in getData)
                        {
                            var _kvp = kvp.Split('=');
                            if (_kvp.Length == 2 && !GetData.ContainsKey(_kvp[0]))
                            {
                                GetData.Add(_kvp[0], _kvp[1]);
                            }
                        }
                    }
                    RequestedPage = requestedPage[0];
                }

                int contentIndex = lines.IndexOf(string.Empty) + 1;
                if (contentIndex > 0 && contentIndex < lines.Count)
                {
                    for (int i = contentIndex; i < lines.Count; i++)
                    {
                        var line = lines[i].Split('=');
                        if (line.Length == 2 && !PostData.ContainsKey(line[0]))
                        {
                            PostData.Add(line[0], line[1]);
                        }
                    }
                }
            }
        }
Beispiel #14
0
        public MovieInfo(string movieId)
        {
            InitializeComponent();
            GetData GD = new GetData();

            this.AutoScroll = true;
            int place  = 120;
            int place2 = 275;
            Tuple <string, string, string, string, string, string> movieInfo = GD.ShowMovieByID(movieId);

            Label LB1 = new Label();

            LB1.Text        = "Movie selected: " + movieInfo.Item2 + "\n\nYear: " + movieInfo.Item4 + "\n\nAge restriction:  " + movieInfo.Item3 + "\n\nActors:  " + movieInfo.Item5 + "\n\nSummary:  " + movieInfo.Item6;
            LB1.MaximumSize = new Size(600, 0);
            LB1.Location    = new Point(50, place);
            LB1.AutoSize    = true;
            this.Controls.Add(LB1);

            int MovieId = Convert.ToInt32(movieInfo.Item1);

            Tuple <List <DateTime>, List <int>, List <int> > times = GD.GetTime(MovieId);

            for (int i = 0; i < times.Item1.Count; i++)
            {
                Label LB2 = new Label();
                LB2.Location    = new Point(50, place2);
                LB2.AutoSize    = true;
                LB2.BorderStyle = BorderStyle.FixedSingle;
                LB2.Cursor      = Cursors.Hand;

                int dateID     = times.Item2[i];
                int hallNumber = times.Item3[i];

                LB2.Text = times.Item1[i].ToString("HH:mm dd/MM/yyyy");
                this.Controls.Add(LB2);
                LB2.Click      += (sender, EventArgs) => { LB2_Click(sender, EventArgs, movieId, dateID, hallNumber); };
                LB2.MouseEnter += new EventHandler(mouseEnter);
                LB2.MouseLeave += new EventHandler(mouseLeave);
                place2         += 20;
            }
        }
Beispiel #15
0
        public void MetaData_AfterLink()
        {
            MetaData   Meta      = MetaData.GetMetaData(this);
            DataAccess Conn      = MetaData.GetConnection(this);
            string     filter    = Meta.QHS.CmpEq("ayear", Meta.GetSys("esercizio"));
            string     oldfilter = GetData.MergeFilters(null, DS.finlevel);

            if (oldfilter != null)
            {
                GetData.SetStaticFilter(DS.finlevel, filter);
            }
            GetData.CacheTable(DS.finlevel);
            GetData.SetSorting(DS.finview, "printingorder");

            int finkind = CfgFn.GetNoNullInt32(Conn.GetSys("fin_kind"));

            if (finkind == 3)
            {
                dataGrid1.Tag = "TreeNavigator.tree2";
            }
        }
Beispiel #16
0
 void SetGBoxClass(int num, string sortingkind)
 {
     if (sortingkind == "")
     {
         GroupBox G = (GroupBox)GetCtrlByName("gboxclass" + num.ToString());
         G.Visible = false;
     }
     else
     {
         string filter = "(idsorkind=" +
                         QueryCreator.quotedstrvalue(sortingkind, true) + ")";
         GetData.SetStaticFilter(DD.Tables["sorting" + num.ToString()], filter);
         GroupBox gboxclass = (GroupBox)GetCtrlByName("gboxclass" + num.ToString());
         Button   btnCodice = (Button)GetCtrlByName("btnCodice" + num.ToString());
         string   title     = Meta.Conn.DO_READ_VALUE("sortingkind", filter, "description").ToString();
         gboxclass.Text = title;
         gboxclass.Tag  = "AutoManage.txtCodice" + num.ToString() + ".tree." + filter;
         btnCodice.Tag  = "manage.sorting" + num.ToString() + ".tree." + filter;
         DD.Tables["sorting" + num.ToString()].ExtendedProperties[MetaData.ExtraParams] = filter;
     }
 }
Beispiel #17
0
        public void MetaData_AfterLink()
        {
            Meta = MetaData.GetMetaData(this);
            bool IsAdmin = false;

            if (Meta.GetSys("manage_prestazioni") != null)
            {
                IsAdmin = (Meta.GetSys("manage_prestazioni").ToString() == "S");
            }
            Meta.CanSave       = IsAdmin;
            Meta.CanInsert     = IsAdmin;
            Meta.CanInsertCopy = IsAdmin;
            Meta.CanCancel     = IsAdmin;
            string filterEpOperationSF = Meta.QHS.CmpEq("idepoperation", "missioni");
            string filterEpOperationEP = Meta.QHS.CmpEq("idepoperation", "missioni");

            GetData.SetStaticFilter(DS.accmotiveapplied, filterEpOperationSF);
            DS.accmotiveapplied.ExtendedProperties[MetaData.ExtraParams] = filterEpOperationEP;
            HelpForm.SetDenyNull(DS.itinerationrefundkind.Columns["flagbalance"], true);
            HelpForm.SetDenyNull(DS.itinerationrefundkind.Columns["flagadvance"], true);
        }
Beispiel #18
0
        public void MetaData_AfterLink()
        {
            Meta = MetaData.GetMetaData(this);

            QHC       = new CQueryHelper();
            QHS       = Meta.Conn.GetQueryHelper();
            esercizio = Convert.ToInt32(Meta.GetSys("esercizio"));
            DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.incomephase, null, null, null, true);
            codicefase = CfgFn.GetNoNullInt32(Meta.GetSys("maxincomephase"));
            GetData.LockRead(DS.incomeview);
            GetData.DenyClear(DS.incomeview);
            GetData.LockRead(DS.proceedspart);
            FillEntrataView();
            QueryCreator.SetTableForPosting(DS.incomeview, "income");
            HelpForm.SetAllowMultiSelection(DS.incomeview, true);
            Meta.CanCancel     = false;
            Meta.CanInsert     = false;
            Meta.CanInsertCopy = false;
            Meta.CanSave       = false;
            Meta.SearchEnabled = false;
        }
Beispiel #19
0
        public async void LoadDataVtv()
        {
            this.ControlLoadding.set_Visibility(0);
            this._statusLoading = true;
            this._currentPage   = this._currentPage + 1;
            SearchVideo searchVideo = this;
            ObservableCollection <Video> observableCollection = searchVideo._lsVideosLoadNewvtv;

            object[] text = new object[] { "http://vtv.vn/video/tim-kiem.htm?zoneVideoId=0&keywords=", this.TxtSearch.get_Text(), "&page=", this._currentPage };
            ObservableCollection <Video> videoXemLai = await GetData.GetVideoXemLai(string.Concat(text));

            searchVideo._lsVideosLoadNewvtv = videoXemLai;
            searchVideo = null;
            foreach (Video video in this._lsVideosLoadNewvtv)
            {
                this._lsVideosvtv.Add(video);
            }
            this.Lsvtv.set_ItemsSource(this._lsVideosvtv);
            this._statusLoading = false;
            this.ControlLoadding.set_Visibility(1);
        }
Beispiel #20
0
        public void MetaData_AfterLink()
        {
            Meta = MetaData.GetMetaData(this);

            string filteresercizio = "(ayear='" + Meta.GetSys("esercizio").ToString() + "')";

            int numrigheperscontratto = Meta.Conn.RUN_SELECT_COUNT("parasubcontractsetup", filteresercizio,
                                                                   true);

            if (numrigheperscontratto == 1)
            {
                CanGoInsert = false;
                CanGoEdit   = true;
            }
            else
            {
                CanGoInsert = true;
                CanGoEdit   = false;
            }
            GetData.SetStaticFilter(DS.parasubcontractsetup, filteresercizio);
        }
Beispiel #21
0
        private async void LoadDataVtc()
        {
            this.ControlLoadding.set_Visibility(0);
            this._statusLoading = true;
            this._currentPage   = this._currentPage + 1;
            XemLai xemLai = this;
            ObservableCollection <Video> observableCollection = xemLai._lsVideosLoadNew;

            object[] objArray = new object[] { "http://www1.tvnet.gov.vn/modules/process.php?option=vod&cat_id=0&page=", this._currentPage, "&channel_id=", this._kenhDcChon };
            ObservableCollection <Video> videoVtc = await GetData.GetVideoVtc(string.Concat(objArray), "theokenh");

            xemLai._lsVideosLoadNew = videoVtc;
            xemLai = null;
            foreach (Video video in this._lsVideosLoadNew)
            {
                this._lsVideos.Add(video);
            }
            this.LsChannel.set_ItemsSource(this._lsVideos);
            this._statusLoading = false;
            this.ControlLoadding.set_Visibility(1);
        }
Beispiel #22
0
    private bool FillExportVista(string ProcedureName, DataAccess DA)
    {
        ClearDataSet.RemoveConstraints(ExportVista);
        GetData MyGetData = new GetData();

        MyGetData.InitClass(ExportVista, DA, "exportfunction");
        DataRow DR = ExportVista.Tables["exportfunction"].NewRow();

        ExportName = HelpForm.GetField(ProcedureName, 0);
        // title.reportname
        //DR["procedurename"] = ProcedureName;
        DR["procedurename"] = ExportName;

        MyGetData.SEARCH_BY_KEY(DR);
        MyGetData.DO_GET(false, null);
        MyGetData.DO_GET_TABLE(ExportVista.customselection, null, null, false, null);

        ExportDescription = ExportVista.Tables["exportfunction"].Rows[0]["description"].ToString();

        return(true);
    }
Beispiel #23
0
        private static bool ManageModules(bool modulesDisabled)
        {
            bool a = GetData.isAnybodyLoggedIn;

            if (!GetData.isAnybodyLoggedIn)
            {
                if (!modulesDisabled)
                {
                    ModulesManager.DisableAllWorkingModules();
                    modulesDisabled = true;
                    GetData.ResetAllSpottedCreatureList();
                }
            }
            else if (modulesDisabled)
            {
                ModulesManager.EnableAllDisabledModules();
                modulesDisabled = false;
            }

            return(modulesDisabled);
        }
        public App()
        {
            //Register Syncfusion license
            Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("NDM1OTg4QDMxMzkyZTMxMmUzME5wenFtdVBvNHBOWDVCY1o3dWYyVnVadEZ3d1JqTnNFUWYvMW53OHY5dW89");
            GetData set = new GetData();

            set.SetLvl();
            InitializeComponent();
            auth = DependencyService.Get <IAuth>();

            //If the user is signed in navigate to the main menu
            if (auth.IsSignIn())
            {
                MainPage = new NavigationPage(new MainMenu());
            }
            //If the users is not signed in navigate to the login screen
            else
            {
                MainPage = new NavigationPage(new MainPage());
            }
        }
Beispiel #25
0
        public async Task <IActionResult> Query([FromBody] QueryViewModel query)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var dataFrom = query.Range.From;
            var dataTo   = query.Range.To;

            var queryToPreform = query.Targets;

            ITimeSeriesData timeSeriesData = new GetData();

            RequestHandler handler = new RequestHandler(timeSeriesData);

            var outputSeries = await handler.GetOutputSeries(dataTo, dataFrom, queryToPreform, tablename);


            return(Ok(outputSeries));
        }
Beispiel #26
0
        public async void LoadDataVtc()
        {
            this.ControlLoadding.set_Visibility(0);
            this.StatusLoadingvtc = true;
            this._currentPagevtc  = this._currentPagevtc + 1;
            SearchVideo searchVideo = this;
            ObservableCollection <Video> observableCollection = searchVideo._lsVideosLoadNewvtc;

            object[] text = new object[] { "http://www1.tvnet.gov.vn/search.html?search_key=", this.TxtSearch.get_Text(), "&page=", this._currentPagevtc };
            ObservableCollection <Video> videoVtc = await GetData.GetVideoVtc(string.Concat(text), "search");

            searchVideo._lsVideosLoadNewvtc = videoVtc;
            searchVideo = null;
            foreach (Video video in this._lsVideosLoadNewvtc)
            {
                this._lsVideosvtc.Add(video);
            }
            this.LSvtc.set_ItemsSource(this._lsVideosvtc);
            this.StatusLoadingvtc = false;
            this.ControlLoadding.set_Visibility(1);
        }
Beispiel #27
0
        private void btnListClassCode_Click(object sender, EventArgs e)
        {
            string filter = QHS.BitSet("flagvisiblekind", 0);//bit 0: visibile nelle prenotazioni di magazzino e nella vetrina. BitSet confronta con <> 0

            if (chkListTitle.Checked)
            {
                FrmAskDescr  FR = new FrmAskDescr(0);
                DialogResult D  = FR.ShowDialog(this);
                if (D != DialogResult.OK)
                {
                    return;
                }
                filter = GetData.MergeFilters(filter,
                                              "(title like " + QueryCreator.quotedstrvalue(
                                                  "%" + FR.txtDescrizione.Text + "%", true)) + ")";
                MetaData.DoMainCommand(this, "choose.listclass.default." + filter);
                return;
            }
            //DS.listclass.ExtendedProperties[MetaData.ExtraParams] = filter;
            MetaData.DoMainCommand(this, "manage.listclass.bookingtree");
        }
Beispiel #28
0
        public void MetaData_AfterLink()
        {
            Meta = MetaData.GetMetaData(this);
            QHC  = new CQueryHelper();
            QHS  = Meta.Conn.GetQueryHelper();
            string param           = Meta.ExtraParameter as string;
            string filterEsercizio = QHS.CmpEq("ayear", Meta.GetSys("esercizio"));
            string filter          = GetData.MergeFilters(filterEsercizio, param);
            string oldfilter       = GetData.MergeFilters(null, DS.patrimonylevel);

            if (oldfilter != null)
            {
                GetData.SetStaticFilter(DS.patrimonylevel, filter);
            }
            GetData.CacheTable(DS.patrimonylevel);
            if (Meta.edit_type != "treeanew" && Meta.edit_type != "treepnew")
            {
                // Filtro su esercizio deve funzionare acnhe su altri eercizi.
                GetData.SetStaticFilter(DS.patrimony, filter);
            }
        }
Beispiel #29
0
        /// <summary>
        /// Generate a bar graph with the given data
        /// </summary>
        /// <param name="getData">The method to get the data with</param>
        /// <param name="grid">The grid to put the graph into</param>
        /// <param name="title">The title of the graph</param>
        /// <param name="prefix">Prefix for y-axis</param>
        /// <param name="suffix">Suffix for the y-axis</param>
        /// <param name="brushes">Any brushes used to colour the bar graph</param>
        private static void GenerateBarGraph(GetData getData, Grid grid, string title, string prefix = "", string suffix = "", Brush[] brushes = null)
        {
            double[][] data        = new double[1][];
            string[]   xAxisLabels = Array.Empty <string>();
            getData(ref data, ref xAxisLabels, minDate);

            double max = GetMax(data);
            double min = GetMin(data);
            int    length;

            if (data[0] is not null)
            {
                length = data[0].Length;
            }
            else
            {
                length = 0;
            }
            LabelGraph(grid, length, xAxisLabels, title, prefix, suffix, max, min);
            GenerateBars(grid, data, max, min, brushes, prefix);
        }
Beispiel #30
0
        public void MetaData_AfterLink()
        {
            Meta = MetaData.GetMetaData(this);

            QHC = new CQueryHelper();
            QHS = Meta.Conn.GetQueryHelper();

            esercizio  = Convert.ToInt32(Meta.GetSys("esercizio"));
            codicefase = Convert.ToInt32(Meta.GetSys("incomefinphase"));
            GetData.LockRead(DS.incomeview);
            GetData.DenyClear(DS.incomeview);
            GetData.LockRead(DS.creditpart);
            FillEntrataView();
            QueryCreator.SetTableForPosting(DS.incomeview, "income");
            HelpForm.SetAllowMultiSelection(DS.incomeview, true);
            Meta.CanCancel     = false;
            Meta.CanInsert     = false;
            Meta.CanInsertCopy = false;
            Meta.CanSave       = false;
            Meta.SearchEnabled = false;
        }
        public arbolBAsterisco(string archivoArbolPath, string archivoArbolName, ConvertStringToKey convertidorLlave, ConvertStringToData convertidorString, GetData convertidorDatos, int maximaLongitudLlave, GetDataLength maximaLongitudDatos)
        {
            rutaArchivo            = archivoArbolPath + archivoArbolName;
            ConverterStringToTkey  = convertidorLlave;
            ConverterStringToTData = convertidorString;
            retornarDatos          = convertidorDatos;
            tamanioMaximoLlave     = maximaLongitudLlave;
            retornarTamanioDatos   = maximaLongitudDatos;
            StreamReader lector = new StreamReader(archivoArbolPath + archivoArbolName);
            int          RaizposicionPrincipal = int.Parse(lector.ReadLine());

            ultimaPosicion = int.Parse(lector.ReadLine());
            lector.ReadLine();
            Orden  = int.Parse(lector.ReadLine());
            Cuenta = 0;
            Altura = int.Parse(lector.ReadLine());
            espaciosDisponibles = new List <int>();
            lector.Close();
            archivoArbol = File.Open(rutaArchivo, FileMode.Open);
            Raiz         = AccessTonodoB(RaizposicionPrincipal);
        }
Beispiel #32
0
		public void TestService ()
		{
			GetData data = new GetData ();
			
			XmlDocument doc = new XmlDocument ();
			XmlElement elem1 = doc.CreateElement ("one");
			elem1.SetAttribute ("someAtt","someValue");
			XmlElement elem2 = doc.CreateElement ("two");
			elem2.SetAttribute ("someAtt","someValue");
			XmlNode[] nodes = new XmlNode[] {elem1,elem2};
			
			nodes = data.GetTabList (nodes);
			Check ("GetTabList", nodes);
			
			nodes = data.GetTabStruct ("hello", nodes);
			Check ("GetTabStruct", nodes);
			
			Assert.IsTrue (data.RebuildTabList (true), "RebuildTabList 1");
			Assert.IsTrue (!data.RebuildTabList (false), "RebuildTabList 2");
			
			Assert.IsTrue (data.RebuildTabStruct ("a", true), "RebuildTabStruct 1");
			Assert.IsTrue (!data.RebuildTabStruct ("b", false), "RebuildTabStruct 2");
		}
Beispiel #33
0
        /// <summary>
        /// Creates a <see cref="FastPropertyGetter"/> that reads the property with the name "propertyName"
        /// from the Type specified in "type"
        /// </summary>
        /// <param name="propertyName">The name of the property to be read</param>
        /// <param name="type">The name of the type to which the property belongs</param>
        public FastPropertyGetter(string propertyName, Type type)
        {
            Type t;
            GDDelegate = CreateGetValueDelegate(type, propertyName, out t);

            PropertyType = t;
        }
Beispiel #34
0
        /// <summary>
        /// Initializes the server connection with the set tabs to use.
        /// Requests for a username and servername, and then attempt to connect.
        /// </summary>
        /// <param name="channelTabs">The tabs to fill with channels.</param>
        /// <returns>Returns true if successful, false otherwise.</returns>
        public bool Initialize(TabControl channelTabs)
        {
            // Check if the user already setup a server with this control.
            if (userInfo != null)
            {
                // Dipose of and set the user info form to null.
                userInfo.Dispose();
                userInfo = null;
            }

            // Create a new user info form.
            userInfo = new UserInfoForm();

            // Check that the dialog's results were ok.
            if (userInfo.ShowDialog() != DialogResult.OK)
            {
                // If not, return false.
                return false;
            }

            // Set the channel tabs.
            this.channelTabs = channelTabs;

            // Setup the manage data method to handle any data recieved
            // from the server.
            manageData = new GetData(recievedData);
            // Setup the connection to the server's socket.
            mainSocket = connectToServer(userInfo.server, 6667);

            // Check that the socket was successfully created.
            if (mainSocket == null)
            {
                // If not, display an error message.
                MessageBox.Show("Error connecting to server!");
                // Then return false.
                return false;
            }
            else
            {
                // Set the callback method for when data is recieved.
                mainSocket.BeginReceive(dataBytes, 0, dataBytes.Length, SocketFlags.None, new AsyncCallback(dataRecieved), mainSocket);
            }

            // Return true if everything was successful.
            return true;
        }