示例#1
0
 // 绘制 map 地图
 public void DrawMap()
 {
     _drawMap.Init();
     _utils = new utils(_drawMap);
     _drawMap.setMap(MapData.getFirstWave(), _utils);
     _drawMap.draw();
 }
示例#2
0
        /// <summary>
        /// Рисует столбиковую диаграмму
        /// </summary>
        /// <param name="pbCanvas">Ccылка на объект PictoreBox для рисования</param>
        /// <param name="IC">Объект InitialCondition, задающий начальные условия</param>
        public static void drawDiagramm(ref PictureBox pbCanvas, utils.InitialConditions IC)
        {
            Color GlaphColor = Color.FromArgb(Globals.glob_colorRed, Globals.glob_colorGreen, Globals.glob_colorBlue);
            Point[] arr = new Point[IC.ctx.Xarr.GetLength(0)];
            Point[] zeroVertexes = new Point[IC.ctx.Xarr.GetLength(0)];

            Point pCenter = new Point();
            pCenter.X = (int)((pbCanvas.Width / (Math.Abs(IC.Xmin) + Math.Abs(IC.Xmax))) * Math.Abs(IC.Xmin));
            pCenter.Y = (int)((pbCanvas.Height / (Math.Abs(IC.Ymin) + Math.Abs(IC.Ymax))) * Math.Abs(IC.Ymax));
            for (int i = 0; i < IC.ctx.Xarr.GetLength(0); i++)
            {
                arr[i].X = (int)(pCenter.X + 2 * (IC.ctx.Xarr[i] * IC.scaleX));
                zeroVertexes[i].X = arr[i].X;
            }
            for (int j = 0; j < IC.ctx.Yarr.GetLength(0); j++)
            {
                arr[j].Y = (int)(pCenter.Y - 2 * (IC.ctx.Yarr[j] * IC.scaleY));
                zeroVertexes[j].Y = pCenter.Y;
            }
            using (Graphics G = pbCanvas.CreateGraphics())
            {
                using (Pen p = new Pen(GlaphColor))
                {
                    p.Width = 3;
                    for (int i = 0; i < zeroVertexes.GetLength(0); i++)
                    {
                        G.DrawLine(p, arr[i], zeroVertexes[i]);
                    }
                }
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            popularGanhadores();
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            carregaCupons();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //Verificar se ainda está logado
            if (Session["cadID"] != null)
            {
                objUtils = new utils();
                string acao = Request["acao"];

                //Verificar se é Cliente Besni
                if (Session["Besni"] != null)
                {
                    if (Session["Besni"].ToString().Length > 15)
                    {
                        tipo = "Sim";
                    }
                }


                link.Attributes.Add("href", "/cadastro.aspx?Editar=" + tipo);
            }
            else
            {
                //DESLOGADO
                Response.Redirect("/login.aspx");
            }

            usuario.InnerHtml += Session["cadNome"].ToString();
            objUtils           = new utils();
            objBD              = new bd();
        }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Verificar se ainda está logado
            if (Session["cadID"] != null)
            {
                objUtils = new utils();
                string acao = Request["acao"];

                switch (acao)
                {
                case "cadastrarCupom":
                    Click();
                    break;

                default:
                    break;
                }
            }
            else
            {
                //DESLOGADO
                Response.Redirect("/login.aspx");
            }

            usuario.InnerHtml += Session["cadNome"].ToString();
            objUtils           = new utils();
            objBD              = new bd();
        }
示例#7
0
        public InitialConditions(utils.Context Ctx,ref System.Windows.Forms.PictureBox pbCanvas)
        {
            try
            {
                Xmin = Xmax = Ctx.Xarr[0];
                Ymin = Ymax = Ctx.Yarr[0];
                foreach (double tmX in Ctx.Xarr)
                {
                    if (tmX > Xmax) Xmax = tmX;
                    if (tmX < Xmin) Xmin = tmX;
                }
                foreach (double tmY in Ctx.Yarr)
                {
                    if (tmY > Ymax) Ymax = tmY;
                    if (tmY < Ymin) Ymin = tmY;
                }
                if (Xmax < 0) Xmax = 0.0;
                if (Xmin > 0) Xmin = 0.0;
                if (Ymax < 0) Ymax = 0.0;
                if (Ymin > 0) Ymin = 0.0;

                numDivX = (uint)((Xmax - Xmin) / stepDiv);
                scaleX = (uint)(pbCanvas.Width / numDivX);
                numDivY = (uint)((Ymax - Ymin) / stepDiv);
                scaleY = (uint)(pbCanvas.Height / numDivY);
                this.ctx = Ctx;
            }
            catch (Exception E)
            {
                System.Windows.Forms.MessageBox.Show(E.Message);
            }
        }
示例#8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            ProximoSorteio();
            PopularInstagram();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            PopularDataInicio();
            carregaCompras(Convert.ToInt16(Request["pagina"]));
        }
示例#10
0
 public GetLogonDataOutlook(ref utils.UserData data)
 {
     _userData = data;
     InitializeComponent();
     txtProfile.Text = data.sOutlookProfile;
     txtUser.Text = data.sUser;
     txtPassword.Text = data.sPassword;
     chkEnableShowDialog.Checked = data.bShowOutlookDialog;
 }
 void Start()
 {
     u = GetComponent<utils>();
     cntCamara = GetComponent<ControlCamara>();
     cntCamara.modo = "inicioPresentacion";
     prota = GameObject.FindWithTag("prota");
     cntGeneral = prota.GetComponent<controlGeneral>();
     transform.position = new Vector3(prota.transform.position.x, prota.transform.position.y, transform.position.z);
 }
示例#12
0
 public GetLogonData(ref utils.UserData data)
 {
     _userData = data;
     InitializeComponent();
     txtDomain.Text = data.sDomain;
     txtUser.Text = data.sUser;
     txtPassword.Text = data.sPassword;
     chkUseProxy.Checked = data.bUseProxy;
 }
示例#13
0
 void Awake()
 {
     u = GetComponent<utils>();
     animator = GetComponent<Animator>();
     NotificationCenter.DefaultCenter().AddObserver(this, "reposicionarCamara");
     NotificationCenter.DefaultCenter().AddObserver(this, "empezarShooter");
     NotificationCenter.DefaultCenter().AddObserver(this, "acabarShooter");
     NotificationCenter.DefaultCenter().AddObserver(this, "empezarTorre");
     NotificationCenter.DefaultCenter().AddObserver(this, "acabarTorre");
     NotificationCenter.DefaultCenter().AddObserver(this, "quitarVidaProta");
     NotificationCenter.DefaultCenter().AddObserver(this, "nivelFinalizadoConExito");
 }
示例#14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            ///objUtils.EnviaEmail("*****@*****.**", "Esqueci a Senha | Promoção Besni", "conteudo", "", "", null, "*****@*****.**", null);
            objUtils.EnviaEmail("*****@*****.**", "teste de envio", "mensagem aqui", "", "", null, "*****@*****.**", "PROMOCAO");

            Contagem();
            //  PegarResultado();
            ExbirResultado();
            resumoImportacao();
        }
    void Awake()
    {
        cntRunner = GetComponent<controlRunner>();
        cntShooter = GetComponent<controlShooter>();
        cntTorre = GetComponent<controlTorre>();
        u = GetComponent<utils>();
        manager = GameObject.Find("Manager").GetComponent<Manager>();
        animator = GetComponent<Animator>();
        cuerpoFisico = GetComponent<Rigidbody2D>();

        NotificationCenter.DefaultCenter().AddObserver(this, "pausar");
        NotificationCenter.DefaultCenter().AddObserver(this, "despausar");
    }
示例#16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            /*INICIO DOS TESTES*/
            // DirectoryInfo dirInfo = new DirectoryInfo(@"e:\home\promocaobesni\web\arquivos");
            DirectoryInfo dirInfo = new DirectoryInfo(@"C:\svn\cartao-premiado\trunk\cartaoPremiado\arquivos");

            BuscaArquivos(dirInfo);

            /*FIM DOS TESTES*/
        }
示例#17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            string acao = Request["acao"];

            switch (acao)
            {
            default:
                carregaCupons(Convert.ToInt16(Request["pagina"]));
                break;
            }
        }
示例#18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();


            if (DateTime.Today.DayOfWeek.ToString() == "Sunday")
            {
                PegarResultado();
            }

            Contagem();
            ExbirResultado();
        }
示例#19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //Verificar se ainda está logado
     if (Session["cadID"] != null)
     {
         objUtils     = new utils();
         h2.InnerHtml = "alterar cadastro";
         PopularCadastro();
     }
     //Verificar se está vindo do Facebook
     if (Session["faceId"] != null)
     {
         PopularCadastroFacebook();
     }
 }
示例#20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Verificar se ainda está logado
            if (Session["cadID"] != null)
            {
                objUtils = new utils();
                string acao = Request["acao"];


                trazerCupons(Convert.ToInt16(Request["total"]));
            }
            else
            {
                //DESLOGADO
                Response.Redirect("/");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            carregaCpfs();
            objUtils = new utils();
            objBD    = new bd();

            string acao = Request["acao"];

            switch (acao)
            {
            case "novoCPF":
                novoCPF(Request["cpf"]);
                break;

            default:
                break;
            }
        }
示例#22
0
        /// <summary>
        /// 发送微博消息
        /// </summary>
        /// <param name="Nick"></param>
        /// <param name="content"></param>
        private void SendWeiboMsg(string nick, string content, string imgUrl, string index)
        {
            WeiboData      data     = new WeiboData();
            List <WeiboID> weiboids = data.GetUserWeiboIDS(nick);

            for (int i = 0; i < weiboids.Count; i++)
            {
                if (data.IsCanSendMsg(nick, weiboids[i], index))
                {
                    Console.Write("sending...\r\n");
                    utils uti = new utils();
                    uti.SendMicroBlog(nick, content, imgUrl, weiboids[i].Key, weiboids[i].Secret);
                    //记录发送数量
                    data.UpdateWeiboNum(nick, index);
                    //记录发送日志
                    data.InsertWeiboSendLog(nick, weiboids[i], content, index);
                }
            }
        }
示例#23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            carregaClientes(Convert.ToInt16(Request["pagina"]));

            string acao = Request["acao"];

            switch (acao)
            {
            case "verUser":
                verUser(Request["CAD_CPF"]);
                break;

            default:
                break;
            }
        }
示例#24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            carregaUsuarios();

            string acao = Request["acao"];

            switch (acao)
            {
            case "verUser":
                verUser(Request["id"]);
                break;

            default:
                break;
            }
        }
示例#25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            //Verificar se ainda está logado
            if (Session["cadID"] != null)
            {
                objUtils = new utils();
                string acao = Request["acao"];
                usuario.InnerHtml += Session["cadNome"].ToString();

                trazerCupons();
            }
            else
            {
                //DESLOGADO
                Response.Redirect("/");
            }
        }
示例#26
0
    public void setMap(MapObj map, utils utilsSys)
    {
        _curMap = map;

        float aspect = CanvasCtrl.deviceWidth / CanvasCtrl.deviceHeight;

        this._gridWidth  = Mathf.FloorToInt(CanvasCtrl.deviceWidth / (_curMap.width + 2));
        this._gridHeight = Mathf.CeilToInt(CanvasCtrl.deviceHeight / (_curMap.height + 2) * aspect);

        this._offsetX = Mathf.CeilToInt(this._gridWidth);
        this._offsetY = Mathf.CeilToInt(_curMap.height / 2 * this._gridHeight);

        GameManagerGlobalData.isFirstTimeGenerateMap = true;
        parseMapData();

        // 更新新的地图数据以及捆绑剧情处理函数
        if (utilsSys != null)
        {
            utilsSys.updateCurMap();
        }
    }
示例#27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            string acao = Request["acao"];

            switch (acao)
            {
            case "aprovar":
                aprovar(Request["id"], Request["valor"]);
                break;

            case "publicar":
                puclicar(Request["CON_ID"]);
                break;

            default:
                carregaUsuarios();
                // carregaAprovados();
                carregaPublicados();
                break;
            }
        }
示例#28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            imagensNaoAprovadas();
            imagensAprovadas();

            string acao = Request["acao"];

            switch (acao)
            {
            case "carregaFotosNaoAp":
                imagensNaoAprovadasResp();
                break;

            case "carregaFotosAp":
                imagensAprovadasResp();
                break;

            default:
                break;
            }
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__data_source_name"></param>
 /// <param name="__initial_catalog"></param>
 /// <param name="__having_security"></param>
 /// <param name="__disk"></param>
 public DataSourceExtracter(string __data_source_name, string __initial_catalog, bool __having_security, utils.ConnectionFactory.AccountDisk __disk)
 {
     initialize( __data_source_name, __having_security, __initial_catalog, __disk );
 }
示例#30
0
        private void processAuthenticKeyboardEvent(AxXMLSPYPLUGINLib.AxAuthentic axActiveAuthenticControl, char cKeyPressed, utils.LocalWindowsHook lwhSender)
        {
            try
            {
                // find out which control is currently selected
                string strCurrentSelectedControl = "";
                if (axActiveAuthenticControl.AuthenticView.Selection.FirstXMLData.kind != XMLSPYPLUGINLib.SPYXMLDataKind.spyXMLDataText)
                    strCurrentSelectedControl = axActiveAuthenticControl.AuthenticView.Selection.FirstXMLData.Name;
                else
                    if (axActiveAuthenticControl.AuthenticView.Selection.FirstXMLData.Parent.kind != XMLSPYPLUGINLib.SPYXMLDataKind.spyXMLDataText)
                    strCurrentSelectedControl = axActiveAuthenticControl.AuthenticView.Selection.FirstXMLData.Parent.Name;
                else
                    strCurrentSelectedControl = "Error in recognizing SPYXMLDataKind";
                // apply Gui Funcionality
                switch (strCurrentSelectedControl)
                {
                    case "value":               // this could be the Target DNS or IP
                        string strParentControl = axActiveAuthenticControl.AuthenticView.Selection.FirstXMLData.Parent.Name;
                        if (cKeyPressed == 0x0d)
                        {
                            // 05-Feb-07: [Dinis], This is a hack to make the Enter work with the DnsName and IP elements (which use an attribute for its value and don't work in the new version of the Authentic component)

                            // get the value of the current element which should be either DnsValue or IP
                            string strValueOfCurrentElement = axActiveAuthenticControl.AuthenticView.Selection.FirstXMLData.TextValue ;
                            // get the parent.parent object which should be a 'Target' Element
                            XMLSPYPLUGINLib.XMLData xdData = axActiveAuthenticControl.AuthenticView.Selection.FirstXMLData.Parent.Parent;
                            if (xdData.Name == "Target")
                            {
                                // Now we are going to create manually either the 'DnsValue' or the 'IP' Element (the name we need is conveiniently in strParentControl)
                                XMLSPYPLUGINLib.XMLData xdXmlDataElement = axActiveAuthenticControl.CreateChild(XMLSPYPLUGINLib.SPYXMLDataKind.spyXMLDataElement);
                                xdXmlDataElement.Name = strParentControl;
                                // create the atribute 'value'
                                XMLSPYPLUGINLib.XMLData xdXmlDataAttribute = axActiveAuthenticControl.CreateChild(XMLSPYPLUGINLib.SPYXMLDataKind.spyXMLDataAttr);
                                xdXmlDataAttribute.Name = "value";
                                // add addit it to the xdXmlDataElement
                                xdXmlDataElement.AppendChild(xdXmlDataAttribute);
                                // now that we have an 'DnsValue' or 'IP' element ready we need to find the correct location to insert it (note that due to the current xsd you cannot append it at the end)
                                // Get first Child
                                XMLSPYPLUGINLib.XMLData xdChild = xdData.GetFirstChild(XMLSPYPLUGINLib.SPYXMLDataKind.spyXMLDataElement);
                                // and go though all childs until we find the current one
                                for (int iChildId = 0; iChildId < xdData.CountChildren(); iChildId++)
                                {
                                    // at lack of better choise we will use the 'value' attribute to try to fing the location to insert (the only problem will happen if there is a duplicate 'value' (which would be a mistake in this case))
                                    if (xdChild.Name == strParentControl && getAttributeFromElement(xdChild, "value") == strValueOfCurrentElement)
                                    {
                                        // This will place the new Element before the current one
                                        xdData.InsertChild(xdXmlDataElement);
                                        // xdData.AppendChild(xdXmlDataElement);   /// this one doesn't work since it all puts it at the end
                                        break;
                                    }
                                    // move to the next child (we need to do this so that the InsertChild works as expected
                                    if (iChildId < xdData.CountChildren() - 1)            // don't go to the next child if we are on the last one
                                        xdChild = xdData.GetNextChild();
                                }
                            }
                        }
                        break;

                        switch (strParentControl)
                        {
                            case "DnsName":
                                authentic.authentic_GotoNextTag(axActiveAuthenticControl);
                                authentic.authentic_GotoNextTag(axActiveAuthenticControl);
                                authentic.authentic_GotoNextTag(axActiveAuthenticControl);
                                authentic.authentic_GotoNextTag(axActiveAuthenticControl);

                                ///string strText =

                                string strParentContol2 = axActiveAuthenticControl.AuthenticView.Selection.FirstXMLData.Name;

                                // bool bResulta = authentic.authentic_InsertElementInCurrentSelectionPos_spyAuthenticInsertBefore(axActiveAuthenticControl, "DnsName");
                                break;
                            case "IP":
                                break;

                        }
                        break;
                    case "level2":
                    case "level3":
                        checkForCtrlVandInsertDataFromClipboard(axActiveAuthenticControl,cKeyPressed, false);
                        checkForEnterAndInsertNewLine(axActiveAuthenticControl,cKeyPressed);

                        //if (0x0d == cKeyPressed)			// 0x0d (13) Enter
                        //	utils.authentic.authentic_InsertNewLine(axActiveAuthenticControl);
                        break;
                    case "AdittionalDetails":
                        checkForCtrlVandInsertDataFromClipboard(axActiveAuthenticControl,cKeyPressed, true);
                        if (0x08 == cKeyPressed)			// 0x08 (08) Del
                            break;
                        checkForEnterAndInsertNewLine(axActiveAuthenticControl, cKeyPressed);
                        //if (0x0d == cKeyPressed)			// 0x0d (13) Enter
                        //	utils.authentic.authentic_InsertNewLine(axActiveAuthenticControl);
                        break;
                }
            }
            catch  (Exception ex)
            {
                MessageBox.Show(ex.Message);      // this was being thrown during normal ORG usage
            }
        }
 public SampleDataController(IConfiguration iconfiguration)
 {
     utils           = new utils(iconfiguration);
     _iconfiguration = iconfiguration;
 }
示例#32
0
        public string getAccessionNumber(string vistaProcedureDateTime, string caseNumber, utils.DateFormat dateFormat)
        {
            if(String.IsNullOrEmpty(caseNumber))
            {
                throw new exceptions.MdoException(exceptions.MdoExceptionCode.ARGUMENT_NULL, "Need to supply the case number");
            }

            if (dateFormat == utils.DateFormat.VISTA)
            {
                if (String.IsNullOrEmpty(vistaProcedureDateTime) || vistaProcedureDateTime.Length < 7)
                {
                    throw new exceptions.MdoException(exceptions.MdoExceptionCode.ARGUMENT_DATE_FORMAT, "Expected a Vista formate timestamp (e.g. 3011225 or 3011225.120005)");
                }
                return vistaProcedureDateTime.Substring(3, 2) +
                    vistaProcedureDateTime.Substring(5, 2) + vistaProcedureDateTime.Substring(1, 2) + "-" + caseNumber;
            }
            if (dateFormat == utils.DateFormat.ISO)
            {
                if (String.IsNullOrEmpty(vistaProcedureDateTime) || vistaProcedureDateTime.Length < 8)
                {
                    throw new exceptions.MdoException(exceptions.MdoExceptionCode.ARGUMENT_DATE_FORMAT, "Expected a ISO formate timestamp (e.g. 20101225)");

                }
                return vistaProcedureDateTime.Substring(4, 2) + vistaProcedureDateTime.Substring(6, 2) +
                    vistaProcedureDateTime.Substring(2, 2) + "-" + caseNumber;
            }
            if (dateFormat == utils.DateFormat.UTC)
            {
                throw new NotSupportedException("UTC format is not currently supported");
            }
            // shouldn't reach here since all enums are accounted for but IDE complains if left out
            return null;
        }
        public void create_travel_times()
        {
            int    intRandomNumber;
            string strRandomNumber;
            string strRandomSave;
            string strMDBFile;
            string strConn;
            string strSQL;
            //string strPsiteRailTravel_YN="N";
            int x;
            int y;

            System.Data.OleDb.OleDbConnection p_conn;
            p_conn = new System.Data.OleDb.OleDbConnection();

            ado_data_access p_ado = new ado_data_access();

            utils p_utils = new utils();

            strMDBFile = this.m_frmMain.frmProject.uc_project1.txtRootDirectory.Text + "\\gis\\db\\gis_travel_times.mdb";
            strConn    = p_ado.getMDBConnString(strMDBFile, "admin", "");
            p_ado.OpenConnection(strConn, ref p_conn);
            p_ado.SqlNonQuery(p_conn, "delete from travel_time");
            if (p_ado.m_intError == 0)
            {
                p_ado.CreateDataSet(p_conn, "select * from plot", "plot");
                if (p_ado.m_intError == 0)
                {
                    p_ado.AddSQLQueryToDataSet(p_conn, ref p_ado.m_OleDbDataAdapter, ref p_ado.m_DataSet, "select * from processing_site where ucase(name) like 'TEST%'", "processing_site");
                    if (p_ado.m_intError == 0)
                    {
                        this.m_frmTherm = new frmTherm();
                        this.m_frmTherm.AbortProcess         = false;
                        this.m_frmTherm.progressBar1.Minimum = 1;
                        this.m_frmTherm.progressBar1.Maximum =
                            p_ado.m_DataSet.Tables["plot"].Rows.Count;
                        m_frmTherm.btnCancel.Visible = true;
                        m_frmTherm.Show();
                        m_frmTherm.Focus();
                        m_frmTherm.Text = "Generating Random Travel Times";
                        m_frmTherm.Refresh();
                        this.m_frmTherm.btnCancel.Click += new System.EventHandler(this.ThermCancel);
                        for (x = 0; x <= p_ado.m_DataSet.Tables["plot"].Rows.Count - 1; x++)
                        {
                            this.m_frmTherm.Increment(x + 1);
                            strRandomSave = "";
                            for (y = 0; y <= p_ado.m_DataSet.Tables["processing_site"].Rows.Count - 1; y++)
                            {
                                for (;;)
                                {
                                    intRandomNumber  = p_utils.RandomNumber(1, 18);
                                    strRandomNumber  = Convert.ToString(intRandomNumber);
                                    intRandomNumber  = p_utils.RandomNumber(0, 9);
                                    strRandomNumber += "." + Convert.ToString(intRandomNumber);
                                    intRandomNumber  = p_utils.RandomNumber(0, 9);
                                    strRandomNumber += Convert.ToString(intRandomNumber);
                                    if (strRandomNumber != strRandomSave)
                                    {
                                        strRandomSave = strRandomNumber;
                                        break;
                                    }
                                }
                                strSQL  = "insert into travel_time (psite_id,biosum_plot_id,travel_mode,travel_time) VALUES ";
                                strSQL += "(" + p_ado.m_DataSet.Tables["processing_site"].Rows[y]["psite_id"].ToString()
                                          + ",'" + p_ado.m_DataSet.Tables["plot"].Rows[x]["biosum_plot_id"].ToString()
                                          + "',1" +
                                          "," + strRandomNumber + ");";
                                p_ado.SqlNonQuery(p_conn, strSQL);
                            }
                            System.Windows.Forms.Application.DoEvents();
                            if (this.m_frmTherm.AbortProcess == true)
                            {
                                break;
                            }
                        }
                        int intStart = 1;
                        this.m_frmTherm.progressBar1.Maximum =
                            p_ado.m_DataSet.Tables["processing_site"].Rows.Count;
                        strRandomSave = "";
                        for (x = 0; x <= p_ado.m_DataSet.Tables["processing_site"].Rows.Count - 1; x++)
                        {
                            this.m_frmTherm.Increment(x + 1);
                            for (y = intStart; y <= p_ado.m_DataSet.Tables["processing_site"].Rows.Count - 1; y++)
                            {
                                strSQL = "";
                                if (p_ado.m_DataSet.Tables["processing_site"].Rows[y]["trancd"].ToString().Trim() == "2")
                                {
                                    strSQL = "insert into travel_time (psite_id,railhead_id,travel_mode,travel_time) values ";
                                }
                                else if (p_ado.m_DataSet.Tables["processing_site"].Rows[y]["trancd"].ToString().Trim() == "3")
                                {
                                    strSQL = "insert into travel_time (psite_id,collector_id,travel_mode,travel_time) values ";
                                }
                                if (strSQL.Trim().Length > 0)
                                {
                                    for (;;)
                                    {
                                        intRandomNumber  = p_utils.RandomNumber(1, 18);
                                        strRandomNumber  = Convert.ToString(intRandomNumber);
                                        intRandomNumber  = p_utils.RandomNumber(0, 9);
                                        strRandomNumber += "." + Convert.ToString(intRandomNumber);
                                        intRandomNumber  = p_utils.RandomNumber(0, 9);
                                        strRandomNumber += Convert.ToString(intRandomNumber);
                                        if (strRandomNumber != strRandomSave)
                                        {
                                            strRandomSave = strRandomNumber;
                                            break;
                                        }
                                    }
                                    strSQL += "(" + p_ado.m_DataSet.Tables["processing_site"].Rows[x]["psite_id"].ToString()
                                              + "," + p_ado.m_DataSet.Tables["processing_site"].Rows[y]["psite_id"].ToString()
                                              + ",2" +
                                              "," + strRandomNumber + ");";
                                    p_ado.SqlNonQuery(p_conn, strSQL);
                                    if (p_ado.m_intError != 0)
                                    {
                                        break;
                                    }
                                }
                            }
                            if (p_ado.m_intError != 0)
                            {
                                break;
                            }
                            intStart++;
                            System.Windows.Forms.Application.DoEvents();
                            if (this.m_frmTherm.AbortProcess == true)
                            {
                                break;
                            }
                        }
                        if (p_ado.m_intError != 0)
                        {
                        }
                        else
                        {
                            MessageBox.Show("Finished Generating Travel Times");
                        }
                        this.m_frmTherm.Close();
                        this.m_frmTherm = null;
                    }
                    p_ado.m_DataSet.Clear();
                    p_ado.m_DataSet = null;
                    p_ado.m_OleDbDataAdapter.Dispose();
                    p_ado.m_OleDbDataAdapter = null;
                    p_conn.Close();

                    p_ado.m_OleDbConnection = null;
                }
            }
            p_conn  = null;
            p_ado   = null;
            p_utils = null;
        }
示例#34
0
 public override void Parse(utils.Xml.Dom.Node e)
 {            
 }
示例#35
0
        /// <summary>
        /// Отрисовывает координатные плоскости
        /// </summary>
        /// <param name="pbCanvas">Ccылка на объект PictoreBox для рисования</param>
        /// <param name="IC">Объект InitialCondition, задающий начальные условия</param>
        public static void drawGrid(ref PictureBox pbCanvas, utils.InitialConditions IC)
        {
            using (Graphics G = pbCanvas.CreateGraphics())
            {
                Point pCenter = new Point();
                pCenter.X = (int)((pbCanvas.Width / (Math.Abs(IC.Xmin)+Math.Abs(IC.Xmax))) * Math.Abs(IC.Xmin));
                pCenter.Y = (int)((pbCanvas.Height / (Math.Abs(IC.Ymin) + Math.Abs(IC.Ymax))) * Math.Abs(IC.Ymax));
                //MessageBox.Show(pCenter.ToString()+ pbCanvas.Width.ToString() + "X" + pbCanvas.Height.ToString() + " Xmin=" + IC.Xmin + " Xmax=" + IC.Xmax + " Ymin=" + IC.Ymin + " Ymax=" + IC.Ymax);

                using (Pen p = new Pen(Color.Black))
                {
                    Point p0X1 = new Point();
                    Point p0X2 = new Point();
                    p0X1.X = 0;
                    p0X1.Y = pCenter.Y;
                    p0X2.X = pbCanvas.Width;
                    p0X2.Y = pCenter.Y;
                    //ось Х
                    p.Width = 2;
                    G.DrawLine(p, p0X1, p0X2);
                    //ось У
                    p0X1.X = pCenter.X;
                    p0X1.Y = 0;
                    p0X2.X = pCenter.X;
                    p0X2.Y = pbCanvas.Height;
                    G.DrawLine(p, p0X1, p0X2);
                    //подпись к осям(X)
                    Point pmaxX = pCenter;
                    pmaxX.X = pbCanvas.Width-10;
                    G.DrawString("X", SystemFonts.DialogFont, Brushes.Black, pmaxX);
                    //подпись к осям(Y)
                    Point pmaxY = pCenter;
                    pmaxY.Y = 0;
                    G.DrawString("Y", SystemFonts.DialogFont, Brushes.Black, pmaxY);
                    //градация осей по Х
                    Point Xdivs = pCenter;
                    Xdivs.Y -= 10;
                    Point divsA = pCenter,divsB = pCenter;
                    for (int i = 0; i < IC.numDivX; i++)
                    {
                        Xdivs.X = (int)(i * IC.scaleX);
                        divsA.X = divsB.X = Xdivs.X;
                        divsA.Y = pCenter.Y - 5;
                        divsB.Y = pCenter.Y + 5;
                        Xdivs.X -= 10;
                        G.DrawString(Convert.ToString(i * IC.stepDiv - Math.Abs(IC.Xmin)), SystemFonts.DialogFont, Brushes.Black, Xdivs);
                        G.DrawLine(p, divsA, divsB);
                    }
                    //градация осей по У
                    Point Ydivs = pCenter;
                    divsA = pCenter;divsB = pCenter;
                    divsA.X -= 5;
                    divsB.X += 5;
                    for (int i = 0; i <= IC.numDivY; i++)
                    {
                        Ydivs.Y = pbCanvas.Height - (int)(i * IC.scaleY)-10;
                        divsA.Y = Ydivs.Y+10;
                        divsB.Y = Ydivs.Y+10;
                        G.DrawString(Convert.ToString(i * IC.stepDiv - Math.Abs(IC.Ymin)), SystemFonts.DialogFont, Brushes.Black, Ydivs);
                        G.DrawLine(p, divsA, divsB);
                    }
                }

            }
            drawPuncture(ref pbCanvas, IC);
        }
示例#36
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            string acao = Request["acao"];

            switch (acao)
            {
            //SITE
            case "buscarCupons":
                buscarCupons(Request["cpf"].ToString(), Request["nascimento"].ToString());
                break;

            case "atualizaEmail":
                atualizaEmail(Request["cpf"].ToString(), Request["email"].ToString());
                break;

            //ADMINISTRACAO
            case "loginAdministrador":
                loginAdministrador(Request["email"].ToString(), Request["password"].ToString());
                break;

            case "filtrarClientes":
                filtrarClientes(Request["cpf"]);
                break;

            case "filtrarCuponsPorCPF":
                filtrarCuponsPorCPF(Request["cpf"]);
                break;

            case "removerCPF":
                removerCPF(Request["cpf"]);
                break;

            case "rangeIdade":
                rangeIdade();
                break;

            case "rangeVendas":
                rangeVendas();
                break;

            case "totalEmail":
                totalEmail();
                break;

            case "donwloadGanhadores":
                donwloadGanhadores();
                break;

            case "donwloadCupons":
                donwloadCupons();
                break;

            case "exportarCompras":
                exportarCompras(Request["dtInicio"], Request["dtFim"]);
                break;

            case "carregaDtFim":
                carregaDtFim(Request["dtInicio"]);
                break;

            case "carregaComprasFiltrada":
                carregaComprasFiltrada(Request["dtInicio"], Request["dtFim"], Convert.ToInt16(Request["pagina"]));
                break;

            default:
                break;
            }
        }
示例#37
0
        /// <summary>
        /// Рисует пунктирные линии по заданию
        /// </summary>
        /// <param name="pbCanvas">Ccылка на объект PictoreBox для рисования</param>
        /// <param name="IC">Объект InitialCondition, задающий начальные условия</param>
        public static void drawPuncture(ref PictureBox pbCanvas, utils.InitialConditions IC)
        {
            Point maxYa, maxYb ,minYa ,minYb;
            maxYa = maxYb = minYa = minYb = new Point();
            Point pCenter = new Point();
            pCenter.X = (int)((pbCanvas.Width / (Math.Abs(IC.Xmin) + Math.Abs(IC.Xmax))) * Math.Abs(IC.Xmin));
            pCenter.Y = (int)((pbCanvas.Height / (Math.Abs(IC.Ymin) + Math.Abs(IC.Ymax))) * Math.Abs(IC.Ymax));
                maxYa = IC.getMaxYPoint();
                maxYa.X *= (int)IC.scaleX*2;
                maxYa.X += pCenter.X;
                maxYa.Y *= (int)IC.scaleY*2;
                maxYa.Y = pCenter.Y - maxYa.Y;
                maxYb.X = pCenter.X;
                maxYb.Y = maxYa.Y;

                minYa = IC.getMinYPoint();
                minYa.X *= (int)IC.scaleX * 2;
                minYa.X += pCenter.X;
                minYa.Y *= (int)IC.scaleY * 2;
                minYa.Y = pCenter.Y - minYa.Y - 2;
                minYb.X = pCenter.X;
                minYb.Y = minYa.Y;

            Color c = Color.Black;
            using (Graphics G = pbCanvas.CreateGraphics())
            {
                using (Pen p = new Pen(c))
                {
                    p.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
                    G.DrawLine(p, maxYa, maxYb);
                    G.DrawLine(p, minYa, minYb);
                }
            }
        }
示例#38
0
 public utils(DrawMap manager)
 {
     _mapManager = manager;
     _instance   = this;
 }
 void Start()
 {
     cntCamara = Camera.main.GetComponent<ControlCamara>();
     u = GetComponent<utils>();
     atlas = transform.parent.FindChild("atlas");
 }
示例#40
0
        //  Thread Atualizador;

        protected void Page_Load(object sender, EventArgs e)
        {
            objUtils = new utils();
            objBD    = new bd();

            string acao = Request["acao"];

            switch (acao)
            {
            case "novoCadastro":
                GerarNovoUsuario(Request["nome"].ToString(), Request["cpf"].ToString(), Request["rg"].ToString(), Request["dtnascimento"].ToString(), Request["sexo"].ToString(), Request["telefone"].ToString(), Request["celular"].ToString(), Request["email"].ToString(), Request["cartao1"].ToString(), Request["cartao2"].ToString(), Request["cartao3"].ToString(), Request["cartao4"].ToString(), Request["cep"].ToString(), Request["logradouro"].ToString(), Request["numero"].ToString(), Request["complemento"].ToString(), Request["bairro"].ToString(), Request["cidade"].ToString(), Request["uf"].ToString(), Request["senha"], Request["termos"], Request["novidades"], Request["CAD_FACEBOK_ID"], Request["CAD_FACEBOK_IMAGEM"]);
                break;

            case "FazerLogin":
                FazerLogin(Request["cpf"].ToString().Replace(".", "").Replace("-", ""), objUtils.getMD5Hash(Request["senha"].ToString()));
                break;

            case "loginAdministrador":
                loginAdministrador(Request["email"].ToString(), Request["password"].ToString());
                break;

            case "logout":
                logout();
                break;

            case "totalSexo":
                totalSexo();
                break;

            case "addInstagram":
                // Atualizador = new Thread(() => InfoInsta(Request["url"],Request["url"], Request["url"], Request["url"], Request["url"], Request["url"]));
                //  Atualizador.Start();
                InfoInsta(Request["url"], Request["id"], Request["imagem"], Request["thumb"], Request["likes"], Request["tags"]);
                break;

            case "mudaStatusFoto":
                mudarStatusFoto(Request["status"], Request["id"]);
                break;

            case "GerarCupom":
                // GerarCupom(Request["cnpj"], Request["data"], Request["cco"], Request["valor"]);
                Teste(Request["cnpj"], Request["data"], Request["cco"], Request["valor"]);
                break;

            case "esqueciSenha":
                EsqueciSenha(Request["cpf"]);
                break;

            case "mudarSenha":
                MudarSenha(Request["senha"], Request["cpf"]);
                break;

            case "validarCPF":
                validarCPF(Request["cpf"].ToString().Replace(".", "").Replace("-", ""));
                break;

            /* ADMIN*/
            case "filtrarUsuario":
                filtrarUsuario(Request["id"]);
                break;

            case "donwloadGanhadores":
                donwloadGanhadores();
                break;

            default:
                break;
            }

            //PegarResultado();
        }
 void Awake()
 {
     gen = GetComponent<controlGeneral>();
     run = GetComponent<controlRunner>();
     u = GetComponent<utils>();
 }
示例#42
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="factory"></param>
 public DataSourceAccessor(utils.ConnectionFactory __factory)
 {
     this.factory_ = __factory;
 }
 /// <summary>
 /// �R���X�g���N�^�Ŏg�p���鏉���������ł��B
 /// </summary>
 /// <param name="__data_source_name"></param>
 /// <param name="__initial_catalog"></param>
 /// <param name="__having_security"></param>
 private void initialize(string __data_source_name, bool __having_security, string __initial_catalog, utils.ConnectionFactory.AccountDisk __disk)
 {
     if ( __disk == null ) {
         this.ssc_factory_ = new SQLClientConnectionFactory( __data_source_name,
                                                             __having_security,
                                                             __initial_catalog
                                                           );
     } else {
         this.ssc_factory_ = new SQLClientConnectionFactory( __data_source_name,
                                                             __having_security,
                                                             __initial_catalog,
                                                             __disk
                                                           );
     }
     this.content_ = new DataSet( __data_source_name );
 }