Exemple #1
0
 public void AddBoolParam(string paramName, bool paramValue)
 {
     Hashtable param = new Hashtable();
     param.Add("type", "boolean");
     param.Add("value", paramValue);
     parameters.Add(paramName, param);
 }
    //type = a:1/10, b:1/100, c:1/1000
    public Auth_GetAutoTokenCommand( string playerId,string secret, CompleteDelegate completeDelegate, ErrorDelegate errorDelegate)
    {
        Hashtable batchHash = new Hashtable ();
        batchHash.Add ("authKey", AuthUtils.generateRequestToken (playerId, secret));

        ArrayList commands = new ArrayList();
        Hashtable command = new Hashtable ();
        command.Add ("action", "auth.getAuthToken");
        command.Add ("time", TimeUtils.UnixTime);
        command.Add ("args", new Hashtable () { { "playerId", playerId }, { "secret", secret }});
        //		command.Add ("expectedStatus","");
        command.Add ("requestId", 123);
        //		command.Add ("token", "");
        commands.Add(command);
        batchHash.Add("commands",commands);
        batch = MiniJSON.jsonEncode(batchHash);

        ////////
        this.onComplete = delegate(Hashtable t){
            //{"requestId":null,"messages":{},"result":"aWeha_JMFgzaF5zWMR3tnObOtLZNPR4rO70DNdfWPvc.eyJ1c2VySWQiOiIyMCIsImV4cGlyZXMiOiIxMzg1NzA5ODgyIn0","status":0}
            Hashtable completeParam = new Hashtable();
            completeParam.Add("result",t["result"]);
            completeDelegate(completeParam);
        };
        /////////
        this.onError = delegate(string err_code,string err_msg, Hashtable data){
            errorDelegate(err_code,err_msg,data);
        };
    }
 public static void FireDisplayTextEvent(Component comp, string text, float duration)
 {
     Hashtable param = new Hashtable();
     param.Add("text", text);
     param.Add("duration", duration);
     NotificationCenter.DefaultCenter.PostNotification(comp, "DisplayText", param);
 }
Exemple #4
0
    public void SaveData()
    {
        if(name.Length > 0)
        {
            ArrayList data = new ArrayList();
            ArrayList subs = new ArrayList();

            Hashtable sv = new Hashtable();
            sv.Add(XMLHandler.NODE_NAME, SkillTypeData.SKILLTYPES);

            for(int i=0; i<name[0].Count(); i++)
            {
                Hashtable val = new Hashtable();
                ArrayList s = new ArrayList();

                val.Add(XMLHandler.NODE_NAME, SkillTypeData.SKILLTYPE);
                val.Add("id", i.ToString());

                s = this.SaveLanguages(s, i);
                val.Add(XMLHandler.NODES, s);
                subs.Add(val);
            }
            sv.Add(XMLHandler.NODES, subs);
            data.Add(sv);

            XMLHandler.SaveXML(dir, filename, data);
        }
    }
    /// <summary>
    /// Used for player QA events
    /// </summary>
    /// <param name="businessID">
    /// The event identifier. F.x. "FailedToLoadLevel" <see cref="System.String"/>
    /// </param>
    /// <param name="message">
    /// A string detailing the event, F.x. the stack trace from an exception <see cref="System.String"/>
    /// </param>
    /// <param name="stack">
    /// If true any identical messages in the queue will be merged/stacked as a single message, to save server load
    /// </param>
    private void CreateNewEvent(SeverityType severity, string message, float? x, float? y, float? z, bool stack)
    {
        Hashtable parameters = new Hashtable()
        {
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Severity], severity.ToString() },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Message], message },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Level], GA.SettingsGA.CustomArea.Equals(string.Empty)?Application.loadedLevelName:GA.SettingsGA.CustomArea }
        };

        if (x.HasValue)
        {
            parameters.Add(GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.X], (x*GA.SettingsGA.HeatmapGridSize.x).ToString());
        }

        if (y.HasValue)
        {
            parameters.Add(GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Y], (y*GA.SettingsGA.HeatmapGridSize.y).ToString());
        }

        if (z.HasValue)
        {
            parameters.Add(GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Z], (z*GA.SettingsGA.HeatmapGridSize.z).ToString());
        }

        GA_Queue.AddItem(parameters, GA_Submit.CategoryType.GA_Error, stack);
    }
Exemple #6
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        //上传文件
        UploadFile(StringHelper.ReplaceBadChar(txtfolder.Text));
        Hashtable hs = new Hashtable();
        hs.Add("cname", StringHelper.ReplaceBadChar(txtcname.Text));
        hs.Add("ename", StringHelper.ReplaceBadChar(txtename.Text));
        hs.Add("remark", StringHelper.ReplaceBadChar(txtremark.Text));
        hs.Add("folder", StringHelper.ReplaceBadChar(txtfolder.Text));
        hs.Add("coverimg", txtCoverImg.Text);

        if (!StringHelper.isNum(Request.QueryString["id"]))//插入新纪录
        {
            DataBaseHelper.instance.Insert(hs, "Template");
            if (!Directory.Exists(Server.MapPath("~/templets/" + StringHelper.ReplaceBadChar(txtfolder.Text))))
            {
                Directory.CreateDirectory(Server.MapPath("~/templets/" + StringHelper.ReplaceBadChar(txtfolder.Text)));
            }
        }
        else//更新纪录
        {
            string id = Request.QueryString["id"];
            DataBaseHelper.instance.Update(hs, "Template", "[ID]=" + id);
        }
        Common.MessageBox.ShowAndRedirect(this, "操作成功!", "list.aspx");
    }
Exemple #7
0
    /*
    ============================================================================
    Data handling functions
    ============================================================================
    */
    public Hashtable GetData(Hashtable ht)
    {
        if(this.active)
        {
            ArrayList s = new ArrayList();
            ht.Add("distance", this.distance.ToString());
            ht.Add("layermask", this.layerMask.ToString());
            if(this.ignoreUser) ht.Add("ignoreuser", "true");

            ht = this.mouseTouch.GetData(ht);

            ht.Add("rayorigin", this.rayOrigin.ToString());
            VectorHelper.ToHashtable(ref ht, this.offset);
            if(TargetRayOrigin.USER.Equals(this.rayOrigin))
            {
                s.Add(HashtableHelper.GetContentHashtable(TargetRaycast.CHILD, this.pathToChild));
                if(!this.mouseTouch.Active())
                {
                    VectorHelper.ToHashtable(ref ht, this.rayDirection, "dx", "dy", "dz");
                }
            }
            s.Add(HashtableHelper.GetContentHashtable(TargetRaycast.TARGETCHILD, this.pathToTarget));
            VectorHelper.ToHashtable(ref ht, this.targetOffset, "tx", "ty", "tz");
            if(s.Count > 0) ht.Add(XMLHandler.NODES, s);
        }
        return ht;
    }
    //type = a:1/10, b:1/100, c:1/1000
    public Player_PackageUpdateCommand( string playerId,string authToken, CompleteDelegate completeDelegate, ErrorDelegate errorDelegate)
    {
        Hashtable batchHash = new Hashtable ();
        batchHash.Add ("authKey", authToken);

        ArrayList commands = new ArrayList();
        Hashtable command = new Hashtable ();
        command.Add ("action", "player.bpackUpdate");
        command.Add ("time", TimeUtils.UnixTime);
        command.Add ("args", new Hashtable () { { "playerId", playerId },{"bpack", EquipManager.Instance.dumpDynamicData()}});
        command.Add ("requestId", 123);
        commands.Add(command);
        batchHash.Add("commands",commands);

        batch = MiniJSON.jsonEncode(batchHash);

        ////////
        this.onComplete = delegate(Hashtable t){
            completeDelegate(t);
        };
        /////////
        this.onError = delegate(string err_code,string err_msg, Hashtable data){
            errorDelegate(err_code,err_msg,data);
        };
    }
    private void onSaveWallPhotoComplete(object data)
    {
        DebugConsole.Log("onSaveWallPhotoComplete");

        ArrayList list = data as ArrayList;
        Hashtable rData = list[0] as Hashtable;

        string photoId = rData["id"] as string;

        List<string> uids = _postData["uids"] as List<string>;
        DebugConsole.Log(uids);
        DebugConsole.Log(uids.Count);
        DebugConsole.Log(uids[0]);

        foreach(string user in uids) {
            DebugConsole.Log(user);

            Hashtable param =  new Hashtable();
            param.Add("owner_id", user);
            param.Add("message", _postData["title"]  + "\n" + _postData["text"] + "\n\n" + _postData["url"]);
            param.Add("attachments",  photoId );

            IFrameLib.exec("wall.post", JSON.Encode(param).ToString(), _api.simplePostResult);
        }
    }
    //type = a:1/10, b:1/100, c:1/1000
    public Test_GetGameContentCommand( string playerId,string authToken, CompleteDelegate completeDelegate, ErrorDelegate errorDelegate)
    {
        Hashtable batchHash = new Hashtable ();
        batchHash.Add ("authKey", authToken);

        ArrayList commands = new ArrayList();
        Hashtable command = new Hashtable ();
        command.Add ("action", "player.content.get");
        command.Add ("time", TimeUtils.UnixTime);
        command.Add ("args", new Hashtable () { { "playerId", playerId }});
        command.Add ("requestId", 123);
        commands.Add(command);
        batchHash.Add("commands",commands);

        batch = MiniJSON.jsonEncode(batchHash);

        ////////
        this.onComplete = delegate(Hashtable t){
            completeDelegate(t);
        };
        /////////
        this.onError = delegate(string err_code,string err_msg, Hashtable data){
            errorDelegate(err_code,err_msg,data);
        };
    }
Exemple #11
0
    /// <summary>
    /// Reads all necessary mesh information
    /// </summary>
    public void ReadMesh()
    {
        Hashtable Hash=new Hashtable();
        List<Vector3> pts = new List<Vector3>();
        if (Mesh != mOldMesh || Transform.rotation != mOldRot || Scale != mOldScale) {
            if (Mesh) {
                int[] tris = Mesh.sharedMesh.triangles;
                Vector3[] verts = Mesh.sharedMesh.vertices;
                for (int i = 0; i < verts.Length; i++)
                    verts[i].Scale(Scale);

                for (int t = 0; t < tris.Length; t += 3) {
                    if (!Hash.ContainsKey(Key(tris[t], tris[t + 1]))) {
                        Hash.Add(Key(tris[t], tris[t + 1]), null);
                        pts.Add(verts[tris[t]]);
                        pts.Add(verts[tris[t + 1]]);
                    }
                    if (!Hash.ContainsKey(Key(tris[t + 1], tris[t + 2]))) {
                        Hash.Add(Key(tris[t + 1], tris[t + 2]), null);
                        pts.Add(verts[tris[t + 1]]);
                        pts.Add(verts[tris[t + 2]]);
                    }
                    if (!Hash.ContainsKey(Key(tris[t + 2], tris[t]))) {
                        Hash.Add(Key(tris[t + 2], tris[t]), null);
                        pts.Add(verts[tris[t + 2]]);
                        pts.Add(verts[tris[t]]);
                    }
                }
            }
            mOldMesh = Mesh;
            mOldRot = Transform.rotation;
            mOldScale = Scale;
            Points = pts.ToArray();
        }
    }
Exemple #12
0
    protected void AddNewHiscore(int levelID, int score)
    {
        Hashtable data = new Hashtable();
        data.Add("facebookID", SocialManager.Instance.userData.facebookID);
        data.Add("playerName", SocialManager.Instance.userData.username);
        data.Add("score", score);

        Hashtable time = new Hashtable();
        time.Add(".sv", "timestamp");
        data.Add("time", time);

        HTTP.Request theRequest = new HTTP.Request("post", SocialManager.Instance.FIREBASE  + "/level" + levelID + ".json", data);

        theRequest.Send((request) =>
        {
            Hashtable jsonObj = (Hashtable)JSON.JsonDecode(request.response.Text);
            if (jsonObj == null)
            {
                Debug.LogError("server returned null or malformed response ):");
            }
            Debug.Log("GRABO NUVEO SCORE");
            SetHiscore(levelID,  score);
            //vuelve a levantarlo para grabar el id:
            LoadHiscoreFromDB(levelID);
        });
    }
Exemple #13
0
    public void GetBCList()
    {
        int page = Convert.ToInt32(Request["page"].ToString());
        int rows = Convert.ToInt32(Request["rows"].ToString());
        DataTable dt = bz.GetAllRole((page - 1) * rows + 1, page * rows);
        count = bz.GetRoleCount();
        IList<Hashtable> list = new List<Hashtable>();

        foreach (DataRow item in dt.Rows)
        {
            Hashtable ht = new Hashtable();
            ht.Add("ID_KEY", item["ID_KEY"]);
            ht.Add("T_GRPID", item["T_GRPID"].ToString());
            ht.Add("T_GRPDESC", item["T_GRPDESC"].ToString());
            list.Add(ht);
        }
        object obj = new
        {
            total = count,
            rows = list
        };

        string result = JsonConvert.SerializeObject(obj);
        Response.Write(result);
        Response.End();
    }
    //type = a:1/10, b:1/100, c:1/1000
    public Player_HeroSkillEditCommand( string playerId,string authToken,string herotype,HeroData hd, CompleteDelegate completeDelegate, ErrorDelegate errorDelegate)
    {
        Hashtable batchHash = new Hashtable ();
        batchHash.Add ("authKey", authToken);

        ArrayList commands = new ArrayList();
        Hashtable command = new Hashtable ();
        command.Add ("action", "player.heroSkillEdit");
        command.Add ("time", TimeUtils.UnixTime);
        ArrayList activeSkillIDList = new ArrayList(){"a","b","c"};
        ArrayList passiveSkillIDList = new ArrayList(){"d","e","f"};
        command.Add ("args", new Hashtable () { { "playerId", playerId },{"herotype",herotype},{"as",activeSkillIDList},{"ps",passiveSkillIDList}});
        command.Add ("requestId", 123);
        commands.Add(command);
        batchHash.Add("commands",commands);

        batch = MiniJSON.jsonEncode(batchHash);

        ////////
        this.onComplete = delegate(Hashtable t){
            completeDelegate(t);
        };
        /////////
        this.onError = delegate(string err_code,string err_msg, Hashtable data){
            errorDelegate(err_code,err_msg,data);
        };
    }
    /// <summary>
    /// Used for player purchases
    /// </summary>
    /// <param name="businessID">
    /// The business identifier. F.x. "Rocket Launcher Upgrade" <see cref="System.String"/>
    /// </param>
    /// <param name="currency">
    /// Abbreviation of the currency used for the transaction. F.x. USD (U.S. Dollars) <see cref="System.String"/>
    /// </param>
    /// <param name="amount">
    /// The value of the transaction in the lowest currency unit. F.x. if currency is USD then amount should be in cent <see cref="System.Int32"/>
    /// </param>
    private void CreateNewEvent(string eventName, string currency, int amount, float? x, float? y, float? z)
    {
        Hashtable parameters = new Hashtable()
        {
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.EventID], eventName },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Currency], currency },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Amount], amount.ToString() },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Level], GA.SettingsGA.CustomArea.Equals(string.Empty)?Application.loadedLevelName:GA.SettingsGA.CustomArea }
        };

        if (x.HasValue)
        {
            parameters.Add(GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.X], (x*GA.SettingsGA.HeatmapGridSize.x).ToString());
        }

        if (y.HasValue)
        {
            parameters.Add(GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Y], (y*GA.SettingsGA.HeatmapGridSize.y).ToString());
        }

        if (z.HasValue)
        {
            parameters.Add(GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Z], (z*GA.SettingsGA.HeatmapGridSize.z).ToString());
        }

        GA_Queue.AddItem(parameters, GA_Submit.CategoryType.GA_Purchase, false);
    }
    /// <summary>
    /// Adds information about the user/player
    /// </summary>
    /// <param name="gender">
    /// The gender of the user. If the gender is unknown information will not be submitted.
    /// </param>
    /// <param name="birth_year">
    /// The year the user was born. Set to "null" if unknown.
    /// </param>
    /// <param name="country">
    /// The ISO2 country code the user is playing from. See: http://en.wikipedia.org/wiki/ISO_3166-2. Set to "null" if unknown.
    /// </param>
    /// <param name="state">
    /// The code of the country state the user is playing from. Set to "null" if unknown.
    /// </param>
    /// /// <param name="friend_count">
    /// The number of friends in the user's network. Set to "null" if unknown.
    /// </param>
    private void CreateNewUser(Gender gender, int? birth_year, int? friend_count)
    {
        Hashtable parameters = new Hashtable();

        if (gender == Gender.Male)
        {
            parameters.Add(GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Gender], 'M');
        }
        else if (gender == Gender.Female)
        {
            parameters.Add(GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Gender], 'F');
        }

        if (birth_year.HasValue && birth_year.Value != 0)
        {
            parameters.Add(GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Birth_year], birth_year.ToString());
        }

        if (friend_count.HasValue)
        {
            parameters.Add(GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Friend_Count], friend_count.ToString());
        }

        if (parameters.Count == 0)
        {
            GA.LogWarning("GA: No data to send with NewUser event; event will not be added to queue");
            return;
        }

        GA_Queue.AddItem(parameters, GA_Submit.CategoryType.GA_User, false);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Get the JSON input object from a client.
        Hashtable jsonInput = JSONUtil.GetJSONObject(Request);

        // Read input data from jsonInput: customer ID
        // If you want to know the format of the input and output data,
        // go to the description of function checkIfCustomerExists()
        // in Ex11_CheckIfCustomerExists_Client.js.
        Dictionary<string, object> jsonContent
            = (Dictionary <string, object>)jsonInput["content"];
        string customerId
            = Convert.ToString(jsonContent["customer_id"]);

        // Check if the customer exists in the database.
        HomeShoppingDataManager dataManager = HomeShoppingDataManager.getInstance();
        bool ifCustomerExists = dataManager.checkIfCustomerExists(customerId);

        // Create output JSON object.
        Hashtable jsonOutput        = new Hashtable();
        Hashtable jsonOutputHeader  = new Hashtable();
        Hashtable jsonOutputContent = new Hashtable();

        jsonOutputHeader .Add("svc_res_code", 100);
        jsonOutputContent.Add("if_customer_exists", ifCustomerExists);
        jsonOutput       .Add("header", jsonOutputHeader);
        jsonOutput       .Add("content", jsonOutputContent);

        // Send the output JSON object to the client.
        // Serializing is needed to transform the object to a string.
        Response.Write(JSONUtil.toStringFromJSON(jsonOutput));
        Response.End();
    }
Exemple #18
0
    void AddNewUserTODB(string username, string email, string password)
    {
        Debug.Log("AddNewUser" + username + "_" + email + "_" + password);

        Hashtable data = new Hashtable();

        data.Add("username", username);
        data.Add("email", email);
        data.Add("password", password);
        data.Add("achievements", "");

        Hashtable blockContent = new Hashtable();
        blockContent.Add("title", "");
        blockContent.Add("content", "");

        data.Add("block", blockContent);

        HTTP.Request theRequest = new HTTP.Request("post", SocialManager.Instance.FIREBASE + "/users.json", data);
        theRequest.Send((request) =>
        {
            Hashtable jsonObj = (Hashtable)JSON.JsonDecode(request.response.Text);
            if (jsonObj == null)
            {
                Debug.LogError("server returned null or malformed response ):");
            }
            else
            {
                Debug.Log("nuevo usuario!!");
                GetObjectID(email);
            }
        });
    }
 void PerformLogin()
 {
     Hashtable parameters = new Hashtable();
     parameters.Add("username", "a1phanumeric");
     parameters.Add("password", "superSecret");
     API.Post(gameObject, "/user/login", parameters, "TestCallback");
 }
    IEnumerator AlignTheStars()
    {
        Debug.Log("Align");
        int x = listOfStars.Count-1;
        for (int i = 0; i <= x; i++)
        {
            string starN = "star" + (i.ToString());
            GameObject person = GameObject.Find(starN);
            string position = i.ToString();
            int location = int.Parse(position);
            location = location * 5;
            Hashtable moveparams3 = new Hashtable();
            moveparams3.Add("x", location);
            moveparams3.Add("y", -20);
            moveparams3.Add("time", 1);
            moveparams3.Add("easetype", "easeInOutSine");
           iTween.MoveTo(person, moveparams3);

            if (i == x)
            {
                StartCoroutine("BottomPosition");
            }
        }
           yield return new WaitForSeconds(.5f);
    }
    // Use this for initialization
    void Start()
    {
        play = new Rect(0,420, 1280, 133);
        //settings = new Rect(0,560, 1280, 94);

        fadeIn = new Hashtable();
        fadeIn.Add("alpha", 1);
        fadeIn.Add("time", 2);
        fadeIn.Add("delay", 0.1);
        fadeIn.Add("easeType", "easeOutBack");

        btnFade = new Hashtable();
        btnFade.Add("from", 0);
        btnFade.Add("to", 1);
        btnFade.Add("time", 1);
        btnFade.Add("delay", 1);
        btnFade.Add("onupdate", "onBtnFadeHandler");
        btnFade.Add("onupdatetarget", gameObject);
        btnFade.Add("easeType", "easeOutBack");

        fadeOut = new Hashtable();
        fadeOut.Add("alpha", 0);
        fadeOut.Add("time", 2);
        fadeOut.Add("easeType", "easeOutBack");

        iTween.ColorTo(background, new Color(0.5F, 0.5F, 0.5F, 0), 0);
        iTween.ColorTo(loader, new Color(0.5F, 0.5F, 0.5F, 0), 0);
        iTween.FadeTo(background, fadeIn);
        iTween.ValueTo(gameObject, btnFade);
    }
Exemple #22
0
    /*
    ============================================================================
    Data handling functions
    ============================================================================
    */
    public Hashtable GetData(Hashtable ht)
    {
        ArrayList s = new ArrayList();

        if(this.firstMove)
        {
            ht.Add("firstmove", "true");
            ht.Add("firstmoverounds", this.firstMoveRounds.ToString());
        }
        ht.Add("timebar", this.timebar.ToString());

        for(int i=0; i<this.setStatus.Length; i++)
        {
            if(this.setStatus[i] && DataHolder.StatusValue(i).IsConsumable())
            {
                Hashtable ht2 = HashtableHelper.GetTitleHashtable(XMLName.VALUE, i);
                ht2.Add("value", this.status[i].ToString());
                s.Add(ht2);
            }
        }

        for(int i=0; i<this.effect.Length; i++)
        {
            if(!SkillEffect.NONE.Equals(this.effect[i]))
            {
                Hashtable ht2 = HashtableHelper.GetTitleHashtable(XMLName.EFFECT, i);
                ht2.Add("type", this.effect[i].ToString());
                s.Add(ht2);
            }
        }

        if(s.Count > 0) ht.Add(XMLHandler.NODES, s);
        return ht;
    }
    /// <summary>
    /// Saves the assignment data in a hashtable and creates a new assignment and adds it to the AssignmentObject.
    /// </summary>
	public override void FinalizeAssignment () {
		Hashtable h = new Hashtable ();
		h.Add ("photosNeeded", Int32.Parse(assignmentMaker.typeInputField.text));
		h.Add ("missionDescription", assignmentMaker.descriptionField.text + ". " + assignmentMaker.assignmentExplanation.text);
		Assignment newCameraAssignment = new Assignment (0,"Camera", h);
		assignmentMaker.assignmentObject.AddAssignment(newCameraAssignment);
	}
Exemple #24
0
    /// <summary>Call to send an action. Optionally finish the turn, too.</summary>
    /// <param name="move"></param>
    /// <param name="finished"></param>
    public void SendMove(object move, bool finished)
    {
        if (IsFinishedByMe)
        {
            UnityEngine.Debug.LogWarning("Can't SendMove. Turn is finished by this player.");
            return;
        }

        // along with the actual move, we have to send which turn this move belongs to
        Hashtable moveHt = new Hashtable();
        moveHt.Add("turn", Turn);
        moveHt.Add("move", move);

        byte evCode = (finished) ? EvFinalMove : EvMove;
        PhotonNetwork.RaiseEvent(evCode, moveHt, true, new RaiseEventOptions() { CachingOption = EventCaching.AddToRoomCache });
        if (finished)
        {
            PhotonNetwork.player.SetFinishedTurn(Turn);
        }


        // the server won't send the event back to the origin (by default). to get the event, call it locally 
        // (note: the order of events might be mixed up as we do this locally)
        OnEvent(evCode, moveHt, PhotonNetwork.player.ID);
    }
Exemple #25
0
	public static Hashtable SerializeVector3( Vector3 v ) {
		Hashtable data = new Hashtable();
		data.Add("x", (double)v.x );
		data.Add("y", (double)v.y );
		data.Add("z", (double)v.z );
		return data;
	}
Exemple #26
0
	public static WWW Put(string url, System.Collections.Generic.Dictionary<string, string> parameters)
	{
		Hashtable putHeader = new Hashtable();
		putHeader.Add("Content-Type", "application/json");
		putHeader.Add("X-HTTP-Method-Override", "PUT");
		return new WWW(AppendParametersToUrl(url, parameters), m_utf8.GetBytes("{}"), putHeader);
	}
Exemple #27
0
	public static WWW Delete(string url, string json, System.Collections.Generic.Dictionary<string, string> otherParameters)
	{
		Hashtable header = new Hashtable();
		header.Add("Content-Type", "application/json");
		header.Add("X-HTTP-Method-Override", "DELETE");
		return new WWW(AppendParametersToUrl(url, otherParameters), m_utf8.GetBytes(json), header);
	}
    protected void Bind(string keyWord)
    {
        DataBase DB = new DataBase();

        Hashtable ht1 = new Hashtable();
        ht1.Add("Title", keyWord);
        ht1.Add("AnswerA", keyWord);
        ht1.Add("AnswerB", keyWord);
        ht1.Add("AnswerC", keyWord);
        ht1.Add("AnswerD", keyWord);

        DataSet ds1 = DB.AdvancedSearch("SingleProblem", ht1);

        if (ds1.Tables[0].Rows.Count > 0)//判断下是否有单选题
        {
            GridView11.DataSource = ds1;
            GridView11.DataBind();
        }

        DataSet ds2 = DB.AdvancedSearch("MultiProblem", ht1);
        if (ds2.Tables[0].Rows.Count > 0)
        {
            GridView2.DataSource = ds2;
            GridView2.DataBind();
        }

        Hashtable ht2 = new Hashtable();
        ht2.Add("Title", keyWord);
        DataSet ds3 = DB.AdvancedSearch("JudgeProblem", ht2);
        if (ds3.Tables[0].Rows.Count > 0)
        {
            GridView3.DataSource = ds3;
            GridView3.DataBind();
        }
    }
 protected override void Execute()
 {
     // temp
     if (m_Config == null || m_Config.Path == null)
     {
         Debuger.Log("No Data in this MoveTransformFrame"); return;
     }
     //
     if (m_Config.Path.Count <= 0) { Debug.Log("No Path"); return; }
     Vector3[] path = new Vector3[m_Config.Path.Count];
     for (int i = 0; i < path.Length; i++)
     {
         path[i] = m_Config.Path[i].GetVector3();
     }
     Hashtable args = new Hashtable();
     args.Add("path", path);
     args.Add("easeType", iTween.EaseType.linear);
     args.Add("time", m_Config.MoveTime);
     args.Add("orienttopath", m_Config.IsAutoRotate);
     args.Add("movetopath", false);
     foreach (GameObject obj in TargetObjects)
     {
         Rigidbody body = obj.GetComponent<Rigidbody>();
         if (body)
         {
             body.isKinematic = true;
         }
         iTween.MoveTo(obj, args);
     }
 }
Exemple #30
0
    /// <summary>
    /// Mail potwierdzający wysyłke zamówienia
    /// </summary>
    /// <param name="a_strMailAddress"></param>
    /// <param name="a_gActivationCode"></param>
    /// <param name="a_ctlOwner"></param>
    public static void SendShippedOrderEmail(string emailAddress, Order order)
    {
        MailDefinition mailDefinition = new MailDefinition();
        mailDefinition.BodyFileName = "~/MailTemplates/ZamowienieWyslane.html";
        mailDefinition.IsBodyHtml = true;
        mailDefinition.Subject = "Nazwa firmy - Zamówienie wysłano";
        IDictionary replacements = new Hashtable();

        //Dodawanie znaczników, które zostaną podmienione w szablonie maila na właściwe wartości
        replacements.Add("<%OrderDate%>", order.OrderDate.ToString("dd-MM-yyyy"));
        Address address = order.CustomerFacility.Address;
        String strAddress = "ul. " + address.Street +
            address.HouseNr + "/" + address.ApartmentNr + ", " +
            address.ZipCode + " " + address.City.Name + " " + address.Country.Name;
        replacements.Add("<%Address%>", strAddress);
        replacements.Add("<%Total%>", order.Total.ToString("0.00 zł"));

        MailMessage msg = mailDefinition.CreateMailMessage(emailAddress, replacements, new Panel());
        MailAddress mailFrom = new MailAddress(msg.From.Address, "Nazwa firmy");
        msg.From = mailFrom;

        SmtpClient client = new SmtpClient();
        client.EnableSsl = true;
        client.Send(msg);
    }
Exemple #31
0
        public string TaxSummary()
        {
            string TaxSummaryContent = string.Empty;

            TaxSummaryContent = TaxSummaryContent + "<table border=\"1\"> ";
            TaxSummaryContent = TaxSummaryContent + "<tr class=\"heading\"> ";
            TaxSummaryContent = TaxSummaryContent + "<td>  Tax Percentage</td>";
            TaxSummaryContent = TaxSummaryContent + "<td>  SubTotal</td>";
            TaxSummaryContent = TaxSummaryContent + "<td>  %</td>";
            TaxSummaryContent = TaxSummaryContent + "<td>  CGST</td>";
            TaxSummaryContent = TaxSummaryContent + "<td>  %</td>";
            TaxSummaryContent = TaxSummaryContent + "<td>  SGST</td>";
            TaxSummaryContent = TaxSummaryContent + "<td>  %</td>";
            TaxSummaryContent = TaxSummaryContent + "<td>  IGST</td>";
            TaxSummaryContent = TaxSummaryContent + "<td>  Tax Total</td>";
            TaxSummaryContent = TaxSummaryContent + "<td>  Total</td>";
            TaxSummaryContent = TaxSummaryContent + "</tr> ";

            if (TaxSummarylist == null)
            {
                TaxSummarylist = new Hashtable();
                TaxSummarylist.Add(18, 1200);
                TaxSummarylist.Add(24, 1500);
            }


            foreach (DictionaryEntry item in TaxSummarylist)
            {
                TaxSummaryContent = TaxSummaryContent + "<tr class=\"item\"> ";
                TaxSummaryContent = TaxSummaryContent + "<td> " + item.Key + " </td>";
                TaxSummaryContent = TaxSummaryContent + "<td> " + item.Value + " </td>";

                if (isIGST == false)
                {
                    TaxSummaryContent = TaxSummaryContent + "<td> " + Convert.ToInt32(item.Key) / 2 + "</td>";
                    TaxSummaryContent = TaxSummaryContent + "<td> " + (Convert.ToInt32(item.Value) * Convert.ToInt32(item.Key) / 2) / 100 + "</td>";
                    TaxSummaryContent = TaxSummaryContent + "<td> " + Convert.ToInt32(item.Key) / 2 + "</td>";
                    TaxSummaryContent = TaxSummaryContent + "<td> " + (Convert.ToInt32(item.Value) * Convert.ToInt32(item.Key) / 2) / 100 + "</td>";
                    TaxSummaryContent = TaxSummaryContent + "<td> -- </td>";
                    TaxSummaryContent = TaxSummaryContent + "<td> -- </td>";
                }
                else
                {
                    TaxSummaryContent = TaxSummaryContent + "<td>  --</td>";
                    TaxSummaryContent = TaxSummaryContent + "<td>  --</td>";
                    TaxSummaryContent = TaxSummaryContent + "<td>  --</td>";
                    TaxSummaryContent = TaxSummaryContent + "<td>  --</td>";
                    TaxSummaryContent = TaxSummaryContent + "<td>" + Convert.ToInt32(item.Key) + "</td>";
                    TaxSummaryContent = TaxSummaryContent + "<td>" + (Convert.ToInt32(item.Value) * Convert.ToInt32(item.Key)) / 100 + "</td>";
                }

                TaxSummaryContent = TaxSummaryContent + "<td>" + (((Convert.ToInt32(item.Value) * Convert.ToInt32(item.Key)) / 100)) + "</td>";
                TaxSummaryContent = TaxSummaryContent + "<td>" + (((Convert.ToInt32(item.Value) * Convert.ToInt32(item.Key)) / 100) + (Convert.ToInt32(item.Value))) + "</td>";
                TaxSummaryContent = TaxSummaryContent + "</tr> ";
            }



            TaxSummaryContent = TaxSummaryContent + "</table> ";
            return(TaxSummaryContent);
        }
Exemple #32
0
        public static void LoadPlugins(Splash s)
        {
            string basedir = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "Plugins");

            string[] tmp = Directory.GetFiles(basedir, "*.dll");
            string[] p   = new string[tmp.Length + 1];

            p[0] = System.Reflection.Assembly.GetExecutingAssembly().Location;
            for (int i = 0; i < tmp.Length; i++)
            {
                p[i + 1] = tmp[i];
            }

            int count = 0;

            foreach (string fn in p)
            {
                try
                {
                    s.Message  = Catalog.GetString("Inspecting ") + fn;
                    s.Progress = ++count / (float)(tmp.Length + 1);
                    Assembly a = Assembly.LoadFrom(fn);

                    foreach (Type t in a.GetTypes())
                    {
                        if (t.GetInterface(typeof(IFactory).FullName) != null && !t.IsAbstract)
                        {
                            IFactory f = (IFactory)Activator.CreateInstance(t);

                            switch (f.Type)
                            {
                            case IType.In:
                                In.Add(f);
                                break;

                            case IType.Out:
                                Out.Add(f);
                                break;

                            case IType.ImgProc:
                                ImgProc.Add(f);
                                break;

                            case IType.ResProc:
                                ResProc.Add(f);
                                break;

                            case IType.Comparator:
                                Comparator.Add(f);
                                break;

                            case IType.Other:
                                Other.Add(f);
                                break;
                            }

                            Origin.Add(f, new Source(Path.GetFileName(fn), t.FullName));
                            RevOrigin.Add(new Source(Path.GetFileName(fn), t.FullName), f);
                        }
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(Catalog.GetString("Error while processing {0}: {1}"), fn, e.Message);
                }
            }
        }
Exemple #33
0
        private void AddGroupTotalDataRow(Hashtable htQtyTotal, Hashtable htDppmTotal, string strPrevErrorGroupCode)
        {
            // 添加汇总行
            object[] objRow = new object[this.gridWebGrid.Columns.Count];
            objRow[0] = "Total";
            foreach (object objIdx in htQtyTotal.Keys)
            {
                objRow[Convert.ToInt32(objIdx)] = Convert.ToInt32(htQtyTotal[objIdx]);
            }
            this.gridWebGrid.Rows.Add(new UltraGridRow(objRow));
            this.gridWebGrid.Rows[this.gridWebGrid.Rows.Count - 1].Style.ForeColor = Color.Crimson;
            this.gridWebGrid.Rows[this.gridWebGrid.Rows.Count - 1].Style.Font.Bold = true;
            // 添加汇总的DPPM
            objRow    = new object[this.gridWebGrid.Columns.Count];
            objRow[0] = "DPPM";
            foreach (object objIdx in htDppmTotal.Keys)
            {
                objRow[Convert.ToInt32(objIdx)] = Convert.ToInt32(htDppmTotal[objIdx]);
            }
            this.gridWebGrid.Rows.Add(new UltraGridRow(objRow));
            this.gridWebGrid.Rows[this.gridWebGrid.Rows.Count - 1].Style.ForeColor = Color.Green;
            this.gridWebGrid.Rows[this.gridWebGrid.Rows.Count - 1].Style.Font.Bold = true;
            // 添加不良代码组汇总不良率
            objRow    = new object[this.gridWebGrid.Columns.Count];
            objRow[0] = strPrevErrorGroupCode + " Y/R";
            foreach (object objIdx in htQtyTotal.Keys)
            {
                string[] strDateItem = (string[])this._htDateItemIdx[objIdx];
                if (strDateItem == null)
                {
                    continue;
                }
                string strDateGroup = strDateItem[0];
                string strModelCode = strDateItem[1];
                if (this._htOutputQty.Contains(strDateGroup + ":" + strModelCode) &&
                    Convert.ToInt32(this._htOutputQty[strDateGroup + ":" + strModelCode]) != 0)
                {
                    objRow[Convert.ToInt32(objIdx)] = (Convert.ToInt32(this._htOutputQty[strDateGroup + ":" + strModelCode]) - Convert.ToInt32(htQtyTotal[objIdx])) * 100 / Convert.ToInt32(this._htOutputQty[strDateGroup + ":" + strModelCode]);
                    objRow[Convert.ToInt32(objIdx)] = Math.Round(Convert.ToDecimal(objRow[Convert.ToInt32(objIdx)]), 1).ToString() + "%";
                }
            }
            this.gridWebGrid.Rows.Add(new UltraGridRow(objRow));
            this.gridWebGrid.Rows[this.gridWebGrid.Rows.Count - 1].Style.ForeColor = Color.Red;
            this.gridWebGrid.Rows[this.gridWebGrid.Rows.Count - 1].Style.Font.Bold = true;

            if (_htQtyTotalAll == null)
            {
                _htQtyTotalAll = new Hashtable();
            }
            foreach (object objIdx in htQtyTotal.Keys)
            {
                if (_htQtyTotalAll.ContainsKey(objIdx) == false)
                {
                    _htQtyTotalAll.Add(objIdx, htQtyTotal[objIdx]);
                }
                else
                {
                    _htQtyTotalAll[objIdx] = Convert.ToInt32(_htQtyTotalAll[objIdx]) + Convert.ToInt32(htQtyTotal[objIdx]);
                }
            }
        }
        public static void onRobot(mj_huanghuang_table _table, Int64 site)
        {
            if (!_table.site[site].is_robot)
            {
                return;
            }

            if (_table._hh_state == hh_state.peng)
            {
                if (site != _table.processer)
                {
                    return;
                }

                for (int i = 0; i < 2; i++)
                {
                    _table.player_cards[_table.processer].Remove(_table.processer_card);
                }
                _table.player_peng[_table.processer].Add(_table.processer_card);

                _table.broadcast("mj_huanghuang", "pengpai", _table.processer, _table.processer_card);
                _table.card_righter = _table.processer;
                _table.broadcast("mj_huanghuang", "right", _table.card_righter);

                _table.processer_card = 0;
                _table.play_state     = false;

                robotPlay(_table, site);
            }
            else if (_table._hh_state == hh_state.gang)
            {
                if (site != _table.processer)
                {
                    return;
                }

                if (_table.processer == _table.card_righter)
                {
                    return;
                }

                if (_table.site[_table.processer].is_robot)
                {
                    _table.card_righter = _table.next_card_righter;
                    log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "CheckAndProcessRobotProcess guo");
                    _table.draw();
                }
            }
            else if (_table._hh_state == hh_state.dian_hu)
            {
                if (site != _table.processer)
                {
                    return;
                }

                HupaiState state = mj_huanghuang_check.check_dian_hu(_table.player_cards[_table.processer], _table.laizi, _table.processer_card);
                if (state == HupaiState.no_hu)
                {
                    log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "can not hu");
                    return;
                }

                _table.last_card();

                int rate = 1;
                if (state == HupaiState.hard_hu)
                {
                    rate *= 2;
                }

                Hashtable score = new Hashtable();

                Int64 tmp_score = (Int64)_table.site[_table.play_carder].player_info["base"] * (Int64)_table.site[_table.processer].player_info["base"] * _table.score * rate;
                _table.site[_table.play_carder].player_info["score"] = (Int64)_table.site[_table.play_carder].player_info["score"] - tmp_score;
                _table.site[_table.processer].player_info["score"]   = (Int64)_table.site[_table.processer].player_info["score"] + tmp_score;

                score[_table.site[_table.play_carder].player_info["unionid"]] = 0 - tmp_score;
                score[_table.site[_table.processer].player_info["unionid"]]   = tmp_score;

                if (_table.payRule == (Int64)GameCommon.PayRule.MatchPay)
                {
                    foreach (DictionaryEntry k_v in score)
                    {
                        hub.hub.hubs.call_hub("lobby", "match", "wind_up", hub.hub.name, k_v.Key, k_v.Value);
                    }
                }

                _table.broadcast("mj_huanghuang", "hupai", _table.player_cards[_table.processer], _table.processer_card, _table.processer);

                ArrayList other_pai = new ArrayList();
                Int64     _player   = (Int64)_table.GetNextSite((GameCommon.mjSite)_table.processer);
                while (_player != _table.processer)
                {
                    Hashtable pai_info = new Hashtable();
                    pai_info.Add("player", _player);
                    pai_info.Add("pai", _table.player_cards[_player]);
                    other_pai.Add(pai_info);

                    _player = (Int64)_table.GetNextSite((GameCommon.mjSite)_player);
                }
                _table.broadcast("mj_huanghuang", "otherpai", other_pai);

                _table.broadcast("mj_huanghuang", "huscore", score);

                _table.is_hu          = true;
                _table.hu_player      = _table.processer;
                _table.card_righter   = _table.processer;
                _table.processer_card = 0;
                _table.end_game();
            }
            else if (_table._hh_state == hh_state.hu)
            {
                if (site != _table.card_righter)
                {
                    return;
                }

                if (site != _table.processer)
                {
                    return;
                }

                HupaiState state = mj_huanghuang_check.check_hu(_table.player_cards[_table.card_righter], _table.laizi, _table.processer_card);
                if (state == HupaiState.no_hu)
                {
                    log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "can not hu");
                    return;
                }

                _table.last_card();

                int rate = 1;
                if (state == HupaiState.hard_hu)
                {
                    rate *= 2;
                }

                Hashtable score  = new Hashtable();
                Int64     player = (Int64)_table.GetNextSite((GameCommon.mjSite)_table.card_righter);
                while (player != _table.card_righter)
                {
                    Int64 tmp_score = (Int64)_table.site[player].player_info["base"] * (Int64)_table.site[_table.card_righter].player_info["base"] * _table.score * rate;
                    _table.site[player].player_info["score"] = (Int64)_table.site[player].player_info["score"] - tmp_score;
                    _table.site[_table.card_righter].player_info["score"] = (Int64)_table.site[_table.card_righter].player_info["score"] + tmp_score;

                    score[_table.site[player].player_info["unionid"]] = 0 - tmp_score;
                    if (score[_table.site[_table.card_righter].player_info["unionid"]] == null)
                    {
                        score[_table.site[_table.card_righter].player_info["unionid"]] = (Int64)0;
                    }
                    score[_table.site[_table.card_righter].player_info["unionid"]] = (Int64)score[_table.site[_table.card_righter].player_info["unionid"]] + tmp_score;

                    player = (Int64)_table.GetNextSite((GameCommon.mjSite)player);
                }
                log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "end score :{0}", Json.Jsonparser.pack((Hashtable)score));

                if (_table.payRule == (Int64)GameCommon.PayRule.MatchPay)
                {
                    foreach (DictionaryEntry k_v in score)
                    {
                        hub.hub.hubs.call_hub("lobby", "match", "wind_up", hub.hub.name, k_v.Key, k_v.Value);
                    }
                }

                _table.broadcast("mj_huanghuang", "hupai", _table.player_cards[_table.card_righter], _table.processer_card, _table.card_righter);

                ArrayList other_pai = new ArrayList();
                Int64     _player   = (Int64)_table.GetNextSite((GameCommon.mjSite)_table.card_righter);
                while (_player != _table.card_righter)
                {
                    Hashtable pai_info = new Hashtable();
                    pai_info.Add("player", _player);
                    pai_info.Add("pai", _table.player_cards[_player]);
                    other_pai.Add(pai_info);

                    _player = (Int64)_table.GetNextSite((GameCommon.mjSite)_player);
                }
                _table.broadcast("mj_huanghuang", "otherpai", other_pai);

                _table.broadcast("mj_huanghuang", "huscore", score);

                _table.is_hu          = true;
                _table.hu_player      = _table.card_righter;
                _table.processer_card = 0;
                _table.end_game();
            }
            else
            {
                robotPlay(_table, site);
            }
        }
Exemple #35
0
        protected void RadAsyncUpload1_FileUploaded(object sender, Telerik.Web.UI.FileUploadedEventArgs e)
        {
            //check file size
            //if (e.File.ContentLength < 5000)
            //{
            //}
            string filename = DateTime.Now.ToString("yyyyMMdd") + "_" + Guid.NewGuid().ToString() + e.File.GetExtension();

            var physicalSavePath = MapPath(Config.UploadInvoiceVirtualPath) + filename;

            //Save physical file on disk
            e.File.SaveAs(physicalSavePath, true);

            //Add receipt to uploaded iamge
            //create upload receipt record


            ClientManager.insertRedemptionByPointReceipt(
                (Guid)Membership.GetUser().ProviderUserKey,
                filename,
                Config.ClientId,
                (int)RedemptionByPointReceiptState.PENDING_PROCESS, 0, 0, "", null);

            var    client       = ClientManager.getClient(Config.ClientId);
            string emailLogoUrl = Config.SiteRootUrl + client.logoimagename;

            Hashtable values = new Hashtable();

            values.Add("[/logo/]", emailLogoUrl);
            values.Add("[/SiteRootUrl/]", Config.SiteRootUrl);
            var  redemptionMember = ClientManager.getRedemptionMember((Guid)Membership.GetUser().ProviderUserKey);
            bool canSendEmail     = EmailManager.SendClaimPointAckMail(
                Membership.GetUser().Email,
                redemptionMember.firstname,
                values, this.Response);

            // e.IsValid = true;

            /*
             * BtnSubmit.Visible = false;
             * RefreshButton.Visible = true;
             * RadAsyncUpload1.Visible = false;
             *
             * var liItem = new HtmlGenericControl("li");
             * liItem.InnerText = e.File.FileName;
             *
             *
             * if (totalBytes < MaxTotalBytes)
             * {
             *  // Total bytes limit has not been reached, accept the file
             *  e.IsValid = true;
             *  totalBytes += e.File.ContentLength;
             * }
             * else
             * {
             *  // Limit reached, discard the file
             *  e.IsValid = false;
             * }
             *
             * if (e.IsValid)
             * {
             *
             *  ValidFiles.Visible = true;
             *  ValidFilesList.Controls.AddAt(0, liItem);
             *
             * }
             * else
             * {
             *
             *  InvalidFiles.Visible = true;
             *  InValidFilesList.Controls.AddAt(0, liItem);
             * }*/
        }
 //parameters: the merged columns indexes, common title of the merged columns
 public void AddMergedColumns(int[] columnsIndexes, string title)
 {
     MergedColumns.AddRange(columnsIndexes);
     StartColumns.Add(columnsIndexes[0], columnsIndexes.Length);
     Titles.Add(columnsIndexes[0], title);
 }
        /// <summary>
        /// responsavel por buscar os parametros no banco da procedure
        /// </summary>
        /// <param name="Command"></param>
        //private void DeriveParameters(SqlCommand Command)
        //{
        //    SqlParameter[] iStoredParameters;
        //    SqlParameter[] iCommandParameters;


        //    /*
        //     * Verifica se já existe a collection parameters criada
        //     */
        //    iStoredParameters = (SqlParameter[])mobjHashTableParameters[Command.CommandText];

        //    if (iStoredParameters != null)
        //    {
        //        iCommandParameters = CloneParameters(iStoredParameters);
        //        foreach (IDataParameter p in iCommandParameters)
        //            Command.Parameters.Add(p);

        //        Command.Connection = SqlConn.Conexao;

        //        ////atribui a transacao se for o caso
        //        if (SqlConn.Trans != null)
        //            Command.Transaction = SqlConn.Trans;
        //    }
        //    else
        //    {
        //        //Se não existir, consulta
        //        //associar a conexão para listar os parâmetros da proc
        //        Command.Connection = SqlConn.Conexao;
        //        SqlCommandBuilder.DeriveParameters((SqlCommand)Command);

        //        //Adiciona na collection
        //        iStoredParameters = new SqlParameter[Command.Parameters.Count];

        //        Command.Parameters.CopyTo(iStoredParameters, 0);
        //        mobjHashTableParameters.Add(Command.CommandText, iStoredParameters);

        //        foreach (SqlParameter parameter in Command.Parameters)
        //        {
        //            if (parameter.SqlDbType != SqlDbType.Structured)
        //            {
        //                continue;
        //            }
        //            string name = parameter.TypeName;
        //            int index = name.IndexOf(".");
        //            if (index == -1)
        //            {
        //                continue;
        //            }
        //            name = name.Substring(index + 1);
        //            if (name.Contains("."))
        //            {
        //                parameter.TypeName = name;
        //            }
        //        }

        //        //devolve o cammand para a conexão original
        //        Command.Connection = SqlConn.Conexao;

        //        //atribui a transacao se for o caso
        //        if (SqlConn.Trans != null)
        //            Command.Transaction = SqlConn.Trans;
        //    }
        //}
        private void DeriveParameters(ref IDbCommand pobjCommand)
        {
            string strCommandText;

            IDataParameter[] iStoredParameters;
            IDataParameter[] iCommandParameters;


            /*
             * Verifica se já existe a collection parameters criada
             */
            iStoredParameters = (IDataParameter[])mobjHashTableParameters[pobjCommand.CommandText];

            if (iStoredParameters != null)
            {
                iCommandParameters = CloneParameters(iStoredParameters);
                foreach (IDataParameter p in iCommandParameters)
                {
                    pobjCommand.Parameters.Add(p);
                }

                pobjCommand.Connection = SqlConn.Conexao;

                //atribui a transacao se for o caso
                if (SqlConn.Trans != null)
                {
                    pobjCommand.Transaction = SqlConn.Trans;
                }
            }
            else
            {
                //Se não existir, consulta

                //associar a conexão para listar os parâmetros da proc
                pobjCommand.Connection = SqlConn.Conexao;

                //atribui a transacao se for o caso
                if (SqlConn.Trans != null)
                {
                    pobjCommand.Transaction = SqlConn.Trans;
                }

                switch (menuProvider)
                {
                case ProviderType.SqlClient:
                    SqlCommandBuilder.DeriveParameters((SqlCommand)pobjCommand);
                    break;

                case ProviderType.OleDb:
                    OleDbCommandBuilder.DeriveParameters((OleDbCommand)pobjCommand);
                    break;

                case ProviderType.ODBC:
                    strCommandText          = pobjCommand.CommandText;
                    pobjCommand.CommandText = strCommandText.Substring(strCommandText.IndexOf(".") + 1);

                    OdbcCommandBuilder.DeriveParameters((OdbcCommand)pobjCommand);
                    pobjCommand.CommandText = strCommandText;
                    break;

                case ProviderType.OracleClient:
                    //strCommandText = pobjCommand.CommandText;
                    //pobjCommand.CommandText = strCommandText;
                    //pobjCommand.CommandText = strCommandText.Substring(strCommandText.IndexOf(".") + 1);

                    //OracleCommandBuilder.DeriveParameters((OracleCommand)pobjCommand);
                    //pobjCommand.CommandText = strCommandText;
                    break;

                case ProviderType.MySqlClient:
                    //MySqlCommandBuilder.DeriveParameters((MySqlCommand)pobjCommand);
                    break;
                }

                //Adiciona na collection
                iStoredParameters = new IDataParameter[pobjCommand.Parameters.Count];

                pobjCommand.Parameters.CopyTo(iStoredParameters, 0);
                mobjHashTableParameters.Add(pobjCommand.CommandText, iStoredParameters);

                if (menuProvider == ProviderType.SqlClient)
                {
                    /* TASK #7296 - Necessidade de passar o DATATABLE direto */
                    //Para parametros DataTable funcionarem, é necessario realizar a verificação do TypeName gerado através do SqlCommandBuilder.DeriveParameters
                    //pois ele é gereado concatenado com o nome do banco de dados e é necessário remover ele para que funcione.
                    foreach (SqlParameter parameter in pobjCommand.Parameters)
                    {
                        if (parameter.SqlDbType != SqlDbType.Structured)
                        {
                            continue;
                        }
                        string name  = parameter.TypeName;
                        int    index = name.IndexOf(".");
                        if (index == -1)
                        {
                            continue;
                        }
                        name = name.Substring(index + 1);
                        if (name.Contains("."))
                        {
                            parameter.TypeName = name;
                        }
                    }
                }

                //devolve o cammand para a conexão original
                pobjCommand.Connection = SqlConn.Conexao;

                //atribui a transacao se for o caso
                if (SqlConn.Trans != null)
                {
                    pobjCommand.Transaction = SqlConn.Trans;
                }
            }
        }
Exemple #38
0
        /// <summary>
        /// 将实体对象的属性值转化为Hashtable对应的键值
        /// </summary>
        /// <param name="obj">有效的实体对象</param>
        /// <returns>包含键值映射的Hashtable</returns>
        protected override Hashtable GetHashByEntity(YljxkhzbzdzbInfo obj)
        {
            YljxkhzbzdzbInfo info = obj as YljxkhzbzdzbInfo;
            Hashtable        hash = new Hashtable();

            hash.Add("ID", info.ID);
            hash.Add("ZBZD_ID", info.ZBZD_ID);
            hash.Add("XMBH", info.XMBH);
            hash.Add("XMMC", info.XMMC);
            hash.Add("ZBMC", info.ZBMC);
            hash.Add("Desc", info.Desc);
            hash.Add("WeightPoint", info.WeightPoint);
            hash.Add("OrderNo", info.OrderNo);
            hash.Add("Creator", info.Creator);
            hash.Add("CreateTime", info.CreateTime);
            hash.Add("Editor", info.Editor);
            hash.Add("EditTime", info.EditTime);
            hash.Add("Note", info.Note);

            return(hash);
        }
Exemple #39
0
        /// <summary>
        /// 直接使用嵌套循环的方法进行搜索,所以说是“笨搜索”
        /// </summary>
        /// <param name="ipPtFeaCls">点图层</param>
        /// <returns></returns>
        private bool SearchStupid(IFeatureClass ipPtFeaCls)
        {
            if (ipPtFeaCls == null)
            {
                return(false);
            }

            // 遍历源图层要素

            IQueryFilter ipQuery = new QueryFilterClass();

            ipQuery.SubFields = "OBJECTID,Shape";
            IFeatureCursor ipFeatCursor = ipPtFeaCls.Search(ipQuery, true);
            IFeature       ipFeature    = ipFeatCursor.NextFeature();

            IGeometry ipGeometry = null;
            int       OID1       = -1;
            string    str;

            while (ipFeature != null)
            {
                ipGeometry = ipFeature.Shape;
                OID1       = ipFeature.OID;
                if (ipGeometry == null)
                {
                    ipFeature = ipFeatCursor.NextFeature();
                    continue;
                }
                else
                {
                    if (ipGeometry.GeometryType == esriGeometryType.esriGeometryPoint ||
                        ipGeometry.GeometryType == esriGeometryType.esriGeometryMultipoint)
                    {
                        PointXY pt  = new PointXY();
                        IPoint  ipT = (IPoint)ipGeometry;
                        pt.dx = ipT.X;
                        pt.dy = ipT.Y;
                        str   = OID1.ToString();
                        m_MapOIDFeature1.Add(str, pt);
                        m_MapOIDFeature2.Add(str, pt);
                    }
                }
                Marshal.ReleaseComObject(ipFeature);
                ipFeature = ipFeatCursor.NextFeature();
            }


            string  rsOID, rsOID2;
            PointXY rsGeometry;
            PointXY rsGeometry2;

            m_aryResult = new List <PointDistInfo>();
            foreach (DictionaryEntry dn in m_MapOIDFeature1)
            {
                rsOID      = (string)dn.Key;
                rsGeometry = (PointXY)dn.Value;
                foreach (DictionaryEntry dn2 in m_MapOIDFeature2)
                {
                    rsOID2      = (string)dn2.Key;
                    rsGeometry2 = (PointXY)dn2.Value;

                    // 两点间距离
                    double dDist = (rsGeometry2.dx - rsGeometry.dx) * (rsGeometry2.dx - rsGeometry.dx) +
                                   (rsGeometry2.dy - rsGeometry.dy) * (rsGeometry2.dy - rsGeometry.dy);

                    if (rsOID != rsOID2 && Math.Sqrt(dDist) < m_pPara.dPointDist)
                    {
                        // 添家结果记录
                        PointDistInfo PtInfo = new PointDistInfo();

                        PtInfo.dDistance = Math.Round(Math.Sqrt(dDist), 2);

                        PtInfo.OID1 = Convert.ToInt32(rsOID);
                        PtInfo.OID2 = Convert.ToInt32(rsOID2);
                        m_aryResult.Add(PtInfo);
                        break;
                    }
                }
            }


            ClearMap();

            return(true);
        }
Exemple #40
0
        private void ShowTotalInfo()
        {
            int selectedchargeUserId = 0;

            DataTable tbHandIn = AccountBookController.GetAccountList(dtpFrom.Value, dtpEnd.Value);

            List <PrivyAccountBook> lstAllBooks = new List <PrivyAccountBook>();

            #region 得到缴款员
            Hashtable htCharge = new Hashtable();
            for (int i = 0; i < tbHandIn.Rows.Count; i++)
            {
                int chargeUserId = Convert.ToInt32(tbHandIn.Rows[i]["AccountCode"]);
                if (!htCharge.ContainsKey(chargeUserId))
                {
                    htCharge.Add(chargeUserId, chargeUserId);
                }
            }
            #endregion

            #region 生成账单明细,并合并
            foreach (object obj in htCharge)
            {
                int       chargeUserId  = Convert.ToInt32(((DictionaryEntry)obj).Value);
                DataRow[] drsAccount    = tbHandIn.Select("ACCOUNTCODE=" + chargeUserId, "ACCOUNTDATE asc");
                int[]     accountIdList = new int[drsAccount.Length];
                for (int i = 0; i < drsAccount.Length; i++)
                {
                    accountIdList[i] = Convert.ToInt32(drsAccount[i]["ACCOUNTID"]);
                }
                DataTable tbInvoice;
                DataTable tbInvoiceDetail;
                AccountBookController.GetAccountData(chargeUserId, accountIdList, out tbInvoice, out tbInvoiceDetail);
                //个人所有账单
                List <PrivyAccountBook> lstBook = new List <PrivyAccountBook>();

                for (int i = 0; i < drsAccount.Length; i++)
                {
                    int accountId         = Convert.ToInt32(drsAccount[i]["ACCOUNTID"]);
                    PrivyAccountBook book = AccountBookController.GetPrivyAccountBook(chargeUserId, accountId, tbInvoice, tbInvoiceDetail, tbHandIn);
                    lstBook.Add(book);
                }

                PrivyAccountBook totalBook = AccountBookController.CollectPrivyAccountBook(lstBook);

                lstAllBooks.Add(totalBook);
            }
            #endregion

            CollectAccountBook allBook = AccountBookController.CollectAllAccountBook(lstAllBooks);

            List <FundInfo> lstFundInfo = new List <FundInfo>();
            if (allBook.TallyPart.Details != null)
            {
                for (int i = 0; i < allBook.TallyPart.Details.Length; i++)
                {
                    lstFundInfo.Add(allBook.TallyPart.Details[i]);
                }
            }

            FundInfo fdFavor = new FundInfo();
            fdFavor.Money   = allBook.FavorPart.TotalMoney;
            fdFavor.PayName = "优惠金额";
            lstFundInfo.Add(fdFavor);

            FundInfo fdCash = new FundInfo();
            fdCash.Money   = allBook.CashPart.TotalMoney;
            fdCash.PayName = "实收现金";
            lstFundInfo.Add(fdCash);



            FundInfo[] allInfo = lstFundInfo.ToArray();

            DataTable tbTotalInfo = new DataTable();
            for (int i = 0; i < 10; i++)
            {
                DataColumn col = new DataColumn();
                col.ColumnName = "C_" + i.ToString();
                tbTotalInfo.Columns.Add(col);
            }

            int colIndex = 0;
            tbTotalInfo.Rows.Add(tbTotalInfo.NewRow());
            int rowIndex = tbTotalInfo.Rows.Count - 1;
            //记账
            for (int i = 0; i < allInfo.Length; i++)
            {
                if (colIndex == 10)
                {
                    tbTotalInfo.Rows.Add(tbTotalInfo.NewRow());
                    rowIndex = tbTotalInfo.Rows.Count - 1;
                    colIndex = 0;
                }

                tbTotalInfo.Rows[rowIndex][colIndex]     = allInfo[i].PayName;
                tbTotalInfo.Rows[rowIndex][colIndex + 1] = allInfo[i].Money;
                colIndex = colIndex + 2;
            }
            dgvTotalInfo.Tag = allInfo;
            tbTotalInfo.Columns.Add("C_EMPTY");
            tbTotalInfo.Rows[tbTotalInfo.Rows.Count - 1]["C_EMPTY"] = "合计:" + allBook.InvoiceItemSumTotal.ToString();
            dgvTotalInfo.DataSource = tbTotalInfo;
            dgvTotalInfo.Columns[dgvTotalInfo.Columns.Count - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;

            for (int i = 0; i < dgvTotalInfo.Columns.Count; i++)
            {
                if (i % 2 == 1)
                {
                    dgvTotalInfo.Columns[i].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                }
                else
                {
                    dgvTotalInfo.Columns[i].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                }
            }
        }
Exemple #41
0
        public override void ExecuteCommand(ClientManager clientManager, Common.Protobuf.Command command)
        {
            System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch();
            stopWatch.Start();
            int    overload         = 1;
            string exceptionMessage = null;

            NCache nCache = clientManager.CmdExecuter as NCache;

            try
            {
                if (nCache != null)
                {
                    _command = command.messagePublishCommand;
                    var operationContext = new OperationContext(OperationContextFieldName.OperationType, OperationContextOperationType.CacheOperation);
                    if (command.commandVersion < 1)
                    {
                        operationContext.Add(OperationContextFieldName.ClientLastViewId, forcedViewId);
                    }
                    else
                    {
                        operationContext.Add(OperationContextFieldName.ClientLastViewId, command.clientLastViewId.ToString(CultureInfo.InvariantCulture));
                    }
                    CommandsUtil.PopulateClientIdInContext(ref operationContext, clientManager.ClientAddress);
                    BitSet flag = BitSet.CreateAndMarkInUse(clientManager.CacheFakePool, NCModulesConstants.SocketServer);
                    flag.Data = ((byte)(byte)_command.flag);
                    try
                    {
                        foreach (KeyValuePair pair in _command.keyValuePair)
                        {
                            _metaData.Add(pair.key, pair.value);
                        }

                        ICollection dataList = _command.data as ICollection;
                        if (dataList != null)
                        {
                            _value = UserBinaryObject.CreateUserBinaryObject(dataList);
                        }
                        else
                        {
                            _value = _command.data;
                        }

                        nCache.Cache.PublishMessage(_command.messageId,
                                                    _value,
                                                    _command.creationTime,
                                                    _command.expiration,
                                                    _metaData,
                                                    flag,
                                                    operationContext
                                                    );
                        stopWatch.Stop();
                    }
                    finally
                    {
                        flag?.MarkFree(NCModulesConstants.SocketServer);
                    }
                    //
                    MessagePublishResponse messagePublishResponse = new MessagePublishResponse();
                    //response.requestId = Convert.ToInt64(_command.requestId);
                    //response.commandID = command.commandID;
                    //response.responseType = Response.Type.MESSAGE_PUBLISH;
                    //_serializedResponsePackets.Add(Common.Util.ResponseHelper.SerializeResponse(response,Common.Protobuf.Response.Type.MESSAGE_PUBLISH));

                    if (clientManager.ClientVersion >= 5000)
                    {
                        Common.Util.ResponseHelper.SetResponse(messagePublishResponse, command.requestID, command.commandID);
                        _serializedResponsePackets.Add(Common.Util.ResponseHelper.SerializeResponse(messagePublishResponse, Common.Protobuf.Response.Type.MESSAGE_PUBLISH));
                    }
                    else
                    {
                        //PROTOBUF:RESPONSE
                        Response response = new Response();
                        response.messagePublishResponse = messagePublishResponse;
                        Common.Util.ResponseHelper.SetResponse(response, command.requestID, command.commandID, Common.Protobuf.Response.Type.MESSAGE_PUBLISH);
                        _serializedResponsePackets.Add(Alachisoft.NCache.Common.Util.ResponseHelper.SerializeResponse(response));
                    }
                }
            }
            catch (System.Exception exc)
            {
                exceptionMessage = exc.ToString();
                _serializedResponsePackets.Add(Common.Util.ResponseHelper.SerializeExceptionResponseWithType(exc, command.requestID, command.commandID, clientManager.ClientVersion));
            }
            finally
            {
                TimeSpan executionTime = stopWatch.Elapsed;
                try
                {
                    if (Alachisoft.NCache.Management.APILogging.APILogManager.APILogManger != null && Alachisoft.NCache.Management.APILogging.APILogManager.EnableLogging)
                    {
                        APILogItemBuilder log          = new APILogItemBuilder(MethodsName.PublishMessageOnTopic);
                        int            size            = _value != null ? ((UserBinaryObject)_value).Size : 0;
                        bool           notifyOnFailure = bool.Parse(_metaData[TopicConstant.NotifyOption] as string);
                        DeliveryOption deliveryOption  = (DeliveryOption)(int.Parse(_metaData[TopicConstant.DeliveryOption] as string));
                        string         topicName       = _metaData[TopicConstant.TopicName] as string;
                        topicName = topicName.Split(TopicConstant.TopicSeperator)[1];

                        log.GeneratePublishTopicMessageAPILogItem(topicName, _command.messageId, size, deliveryOption, notifyOnFailure, _command.expiration, executionTime, clientManager.ClientID, clientManager.ClientIP, overload, exceptionMessage);
                    }
                }
                catch
                {
                }
            }
        }
Exemple #42
0
    protected void lbtUpdate_Click(object sender, EventArgs e)
    {
        string sScritp = "<script>";

        sScritp += "window.location.href=\"/Admin/Modules/Content/ContentList.aspx?TopicID=" + ddlModID.SelectedValue + "\";";
        sScritp += "</script>";

        //string sql = "SELECT Tag_Url FROM tbl_Tag";
        //DataSet dsSQL = UpdateData.UpdateBySql(sql);
        //DataRowCollection rowsSQL = dsSQL.Tables[0].Rows;
        //ArrayList arrSQL = FunctionDB.GetRowAsArrayList(dsSQL, "Tag_Url");

        //DataSet dsM = UpdateData.UpdateBySql("SELECT MAX(Content_ID) AS maxID FROM tbl_Content");
        //DataRowCollection rowsM = dsM.Tables[0].Rows;
        //int maxID = Convert.ToInt32(rowsM[0]["maxID"].ToString())+1;

        //string[] mID = txtTag.Text.Split(',');

        //for (int i = 0; i < mID.Length; i++)
        //{
        //    if (mID[i] != "")
        //    {
        //        string nTag = mID[i].ToString().Trim();
        //        string uTag = ApplicationUtil.GetTitle(mID[i].ToString().Trim());
        //        Hashtable tbTag = new Hashtable();
        //        //if (act == "add")
        //        //    tbTag.Add("Content_ID", maxID.ToString());
        //        tbTag.Add("Tag_Name", nTag);
        //        tbTag.Add("Tag_Url", uTag);
        //        if (arrSQL.Contains(uTag))
        //        {
        //            UpdateData.Update("tbl_Tag", tbTag, "Tag_Url='" + uTag + "'");
        //            UpdateData.UpdateBySql("UPDATE tbl_Tag SET Tag_Count=Tag_Count+1 WHERE Tag_Url='" + uTag + "'");
        //        }
        //        else
        //        {
        //            UpdateData.Insert("tbl_Tag", tbTag);
        //            arrSQL = FunctionDB.GetRowAsArrayList(dsSQL, "Tag_Url");
        //        }
        //    }
        //}
        //string url = txtURL.Text.Trim() == "" ? ApplicationUtil.GetTitle(txtName.Text.ToString()).ToLower() : txtURL.Text.Trim().ToLower();
        string title = txtTitle.Text.Trim() == "" ? txtName.Text.ToString().ToLower() : txtTitle.Text.Trim();
        string date  = txtDate.Text == "" ? DateTime.Now.ToString("MM/dd/yyyy") : txtDate.Text;
        //string urlTag = txtTag.Text.Trim() == "" ? ApplicationUtil.GetTitle(txtKey.Text.ToString()).ToLower() : ApplicationUtil.GetTitle(txtTag.Text.Trim()).ToLower();
        Hashtable tbIn = new Hashtable();

        string isUse  = (cbIsUse.Checked == true) ? "1" : "0";
        string isHot  = (cbIsHot.Checked == true) ? "1" : "0";
        string isHome = (cbIsHome.Checked == true) ? "1" : "0";

        tbIn.Add("Mod_ID", ddlModID.SelectedValue);
        tbIn.Add("User_ID", Session["UserID"].ToString());
        tbIn.Add("Content_Name", txtName.Text);
        tbIn.Add("Content_Code", txtCode.Text);
        tbIn.Add("Content_Intro", CKTeaser.Text);
        tbIn.Add("Content_Text", CKContent.Text);
        tbIn.Add("Content_Img", txtImg.Text);
        //tbIn.Add("Content_Avata", txtAvata.Text.Replace("/upload", "upload"));
        tbIn.Add("Content_Date", date);
        tbIn.Add("Content_URL", "");
        tbIn.Add("Content_Title", title);
        tbIn.Add("Content_Key", txtKey.Text);
        tbIn.Add("Content_Des", txtMeta.Text);
        //tbIn.Add("Content_Tag", txtTag.Text);
        //tbIn.Add("Content_UrlTags", urlTag);
        tbIn.Add("Content_Pos", txtPos.Text);
        tbIn.Add("Content_Status", isUse);
        tbIn.Add("Content_Hot", isHot);
        tbIn.Add("Content_Home", isHome);
        //string DesignID = "";
        //for (int i = 0; i < cblDesign.Items.Count; i++)
        //{
        //    if (cblDesign.Items[i].Selected == true)
        //        DesignID += cblDesign.Items[i].Value + ",";
        //}
        //tbIn.Add("Content_Lienquan", DesignID);
        if (act == "add")
        {
            tbIn.Add("lang", Session["lang"].ToString());
            bool _insert = UpdateData.Insert("tbl_Content", tbIn);
            if (_insert)
            {
                FunctionDB.AddLog(Session["DepartID"].ToString(), Session["Username"].ToString(), "Thêm ", "Bài: " + txtName.Text);
            }
        }
        if (act == "edit")
        {
            tbIn.Add("Content_Editdate", DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss"));
            //UpdateData.UpdateOrder("UPDATE tbl_Content SET Content_Editdate=getdate() WHERE Content_ID=" + id);
            bool _update = UpdateData.Update("tbl_Content", tbIn, "Content_ID=" + id);
            if (_update)
            {
                FunctionDB.AddLog(Session["DepartID"].ToString(), Session["Username"].ToString(), "Sửa", "Bài: " + txtName.Text);
            }
            else
            {
                Response.Write("Lỗi");
            }
        }
        Response.Write(sScritp);
    }
Exemple #43
0
        /// <summary>
        /// Generates the code from the contents of the address space.
        /// </summary>
        public WiresharkGenerator(
            string inputPath,
            string outputDirectory,
            Dictionary <string, string> knownFiles,
            string resourcePath)
            :
            base(inputPath, outputDirectory, knownFiles, resourcePath)
        {
            // load and validate type dictionary.
            m_validator = new TypeDictionaryValidator(knownFiles, resourcePath);
            m_validator.Validate(inputPath);

            TargetLanguage    = Language.Wireshark;
            m_lstFields       = new List <HFEntry>();
            m_hashSimpleTypes = new Hashtable();

            m_hashSimpleTypes.Add("Boolean", null);
            m_hashSimpleTypes.Add("Byte", null);
            m_hashSimpleTypes.Add("SByte", null);
            m_hashSimpleTypes.Add("UInt16", null);
            m_hashSimpleTypes.Add("Int16", null);
            m_hashSimpleTypes.Add("UInt32", null);
            m_hashSimpleTypes.Add("Int32", null);
            m_hashSimpleTypes.Add("UInt64", null);
            m_hashSimpleTypes.Add("Int64", null);
            m_hashSimpleTypes.Add("Float", null);
            m_hashSimpleTypes.Add("Double", null);
            m_hashSimpleTypes.Add("Counter", null);
            m_hashSimpleTypes.Add("IntegerId", null);
            m_hashSimpleTypes.Add("String", null);
            m_hashSimpleTypes.Add("Duration", null);
            m_hashSimpleTypes.Add("DateTime", null);
            m_hashSimpleTypes.Add("UtcTime", null);
            m_hashSimpleTypes.Add("Guid", null);
            m_hashSimpleTypes.Add("StatusCode", null);
            m_hashSimpleTypes.Add("ByteString", null);
            m_hashSimpleTypes.Add("XmlElement", null);

            m_sHeader = "/******************************************************************************\n" +
                        "** $Id$\n" +
                        "**\n" +
                        "** Copyright (C) 2006-2008 ascolab GmbH. All Rights Reserved.\n" +
                        "** Web: http://www.ascolab.com\n" +
                        "** \n" +
                        "** This program is free software; you can redistribute it and/or\n" +
                        "** modify it under the terms of the GNU General Public License\n" +
                        "** as published by the Free Software Foundation; either version 2\n" +
                        "** of the License, or (at your option) any later version.\n" +
                        "** \n" +
                        "** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE\n" +
                        "** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\n" +
                        "** \n" +
                        "** Project: OpcUa Wireshark Plugin\n" +
                        "**\n" +
                        "** Description: {0}\n" +
                        "**\n" +
                        "** DON'T MODIFY THIS FILE!\n" +
                        "**\n" +
                        "******************************************************************************/\n" +
                        "\n";
        }
Exemple #44
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ipPtFeaCls"></param>
        /// <returns></returns>
        private bool SearchPoints(IFeatureClass ipPtFeaCls)
        {
            if (ipPtFeaCls == null)
            {
                return(false);
            }
            try
            {
                // 遍历源图层要素
                IQueryFilter ipQuery = new QueryFilterClass();
                ipQuery.SubFields = "OBJECTID,Shape,BSM";
                IFeatureCursor ipFeatCursor = ipPtFeaCls.Search(ipQuery, true);
                IFeature       ipFeature    = ipFeatCursor.NextFeature();

                IGeometry ipGeometry = null;
                int       OID1       = -1;
                m_aryResult = new List <PointDistInfo>();
                int iDecimal = 0;

                int iParmer = GetParameter(m_pPara.dPointDist, out iDecimal);
                while (ipFeature != null)
                {
                    ipGeometry = ipFeature.Shape;
                    OID1       = ipFeature.OID;
                    if (ipGeometry == null)
                    {
                        ipFeature = ipFeatCursor.NextFeature();
                        continue;
                    }
                    else
                    {
                        if (ipGeometry.GeometryType == esriGeometryType.esriGeometryPoint ||
                            ipGeometry.GeometryType == esriGeometryType.esriGeometryMultipoint)
                        {
                            IPoint ipT = (IPoint)ipGeometry;
                            int    dx  = Convert.ToInt32(Math.Round(ipT.X, iDecimal) * iParmer);
                            int    dy  = Convert.ToInt32(Math.Round(ipT.Y, iDecimal) * iParmer);
                            string str = dx.ToString() + "_" + dy.ToString();
                            if (!m_PointtoOID.Contains(str))
                            //构建一hashtable,以点的“x_y”坐标组成的字符串为key键,其中,x、y均取一位小数,仅针对两点距离的参数设置"<=0.1"有效,如果“x_y”key值不同,则两点间距离肯定>=0.1
                            {
                                m_PointtoOID.Add(str, OID1);
                            }
                            else
                            {
                                object   OID           = m_PointtoOID[str];
                                IFeature OriginFeature = ipPtFeaCls.GetFeature((int)OID);
                                IPoint   OriginPoint   = (IPoint)OriginFeature.Shape;
                                // 两点间距离
                                double dDist = (ipT.X - OriginPoint.X) * (ipT.X - OriginPoint.X) +
                                               (ipT.Y - OriginPoint.Y) * (ipT.Y - OriginPoint.Y);
                                ///查找错误结果集
                                if ((int)OID != OID1 && Math.Round(Math.Sqrt(dDist), 2) < m_pPara.dPointDist)
                                {
                                    //m_OIDtoOID.Add(OID1, OID);

                                    if (!m_RepeatOIDtoOID.Contains(str))
                                    {
                                        string strTemp = OID1.ToString();
                                        m_RepeatOIDtoOID.Add(str, strTemp);
                                    }
                                    else
                                    {
                                        string strTemp = m_RepeatOIDtoOID[str].ToString() + "," + OID1;
                                        m_RepeatOIDtoOID[str] = strTemp;
                                    }

                                    //// 添家结果记录
                                    //PointDistInfo PtInfo = new PointDistInfo();

                                    //PtInfo.dDistance = Math.Round(Math.Sqrt(dDist), 2);

                                    //PtInfo.OID1 = Convert.ToInt32(OID1);
                                    //PtInfo.OID2 = Convert.ToInt32(OID);

                                    //m_aryResult.Add(PtInfo);
                                }
                            }
                        }
                    }
                    ipFeature = ipFeatCursor.NextFeature();
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
            return(true);
        }
        protected void btnUploadProceed_Click(object sender, EventArgs e)
        {
            try
            {
                string folderPath = this.Server.MapPath(@"..\ImportFromExcelFile");

                if (fileUploadExcel.HasFile)
                {
                    //checking extension
                    if (!(fileUploadExcel.FileName.EndsWith(".xls", StringComparison.OrdinalIgnoreCase) || fileUploadExcel.FileName.EndsWith(".xlsx", StringComparison.OrdinalIgnoreCase)))
                    {
                        lblFileError.Text = "Invalid File Extension.";
                        return;
                    }
                    //code to upload file.
                    CreateFileInServer(folderPath);
                    //checking if data and columns of Excel are valid
                    string proceed = CheckExcelForValidData(folderPath + "\\" + fileUploadExcel.FileName);
                    if (proceed.Equals(string.Empty))
                    {
                        clsOthers oImportFromExcel = new clsOthers();

                        string SourceTableName = string.Empty;
                        SourceTableName = "ImportPRN_" + String.Format("{0:d_M_yyyy_HH_mm_ss}", System.DateTime.Now);// System.DateTime.Now.ToShortDateString();

                        //SourceTableName = SourceTableName.Replace(':', '_');
                        //SourceTableName = SourceTableName.Replace(':', '_');

                        string message = oImportFromExcel.CreateTable(folderPath + "\\" + fileUploadExcel.FileName, SourceTableName);

                        Hashtable oHt = new Hashtable();
                        oHt.Add("AcademicYearID", hidAcademicYearID.Value);
                        oHt.Add("SourceFileName", fileUploadExcel.FileName);
                        oHt.Add("SourceTableName", SourceTableName);
                        clsUser oUser = (clsUser)Session["user"];
                        oHt.Add("ImportedBy", oUser.User_ID);

                        bool insertTableEntryFlag = oImportFromExcel.SavePRNImportSourceTableEntry(oHt);

                        if (message.Equals("0") && insertTableEntryFlag)
                        {
                            hidSourceFileName.Value   = fileUploadExcel.FileName;
                            hidSourceTableName.Value  = SourceTableName;
                            divFileUplToHide.Disabled = true;
                            fileUploadExcel.Enabled   = false;
                            btnUploadProceed.Enabled  = false;
                            ShowDiscrepancyStats();
                        }
                        else
                        {
                            lblFileError.Text     = message;
                            lblFileError.CssClass = "errorNote";
                        }

                        oImportFromExcel = null;
                    }
                    else
                    {
                        FileInfo fi = new FileInfo(folderPath + "\\" + fileUploadExcel.FileName);
                        if (fi.Exists)
                        {
                            fi.Delete();
                        }
                        lblFileError.Text = proceed;
                        return;
                    }
                }
                else
                {
                    lblFileError.Text = "Please select valid file";
                    return;
                }
            }
            catch (Exception ex)
            {
                lblFileError.Text = ex.Message;
            }
        }
    void Start()
    {
        actionHash = new Hashtable();

        XmlDocument doc = new XmlDocument();

        doc.Load("Assets/Resources/DB/Data/ActionData.xml");                 //加载Xml文件
        XmlElement  actionData  = doc.DocumentElement;                       //获取根节点
        XmlNodeList actionNodes = actionData.GetElementsByTagName("Action"); //获取Person子节点集合

        foreach (XmlNode node in actionNodes)
        {
            BaseAction action = new BaseAction();
            string     str;

            str = ((XmlElement)node).GetAttribute("name");
            if (str != "")
            {
                action.name = str;
            }
            str = ((XmlElement)node).GetAttribute("icon");
            if (str != "")
            {
                action.icon = Resources.Load(iconPath + str, typeof(Texture2D)) as Texture2D;
            }
            str = ((XmlElement)node).GetAttribute("prefab");
            if (str != "")
            {
                action.prefab = Resources.Load(prefabPath + str, typeof(GameObject)) as GameObject;
            }
            str = ((XmlElement)node).GetAttribute("animationName");
            if (str != "")
            {
                action.animationName = str;
            }
            str = ((XmlElement)node).GetAttribute("speed");
            if (str != "")
            {
                action.speed = float.Parse(str);
            }
            str = ((XmlElement)node).GetAttribute("prepareTime");
            if (str != "")
            {
                action.prepareTime = float.Parse(str);
            }
            str = ((XmlElement)node).GetAttribute("finishTime");
            if (str != "")
            {
                action.finishTime = float.Parse(str);
            }
            str = ((XmlElement)node).GetAttribute("isCurrent");
            if (str != "")
            {
                action.isCurrent = bool.Parse(str);
            }
            str = ((XmlElement)node).GetAttribute("reducedMoveSpeed");
            if (str != "")
            {
                string[] reducedMoveSpeed = str.Split(',');
                action.reducedMoveSpeed[0] = float.Parse(reducedMoveSpeed[0]);
                action.reducedMoveSpeed[1] = float.Parse(reducedMoveSpeed[1]);
            }
            str = ((XmlElement)node).GetAttribute("manaCost");
            if (str != "")
            {
                action.manaCost = int.Parse(str);
            }

            int index = int.Parse(((XmlElement)node).GetAttribute("index"));
            actionHash.Add(index, action);
        }
    }
        public SelfCertificateDialog(IServiceProvider serviceProvider)
            : base(serviceProvider)
        {
            InitializeComponent();
            cbStore.SelectedIndex   = 0;
            cbLength.SelectedIndex  = 3;
            cbHashing.SelectedIndex = 1;
            txtCommonName.Text      = Environment.MachineName;

            if (Environment.OSVersion.Version < Version.Parse("6.2"))
            {
                // IMPORTANT: WebHosting store is available since Windows 8.
                cbStore.Enabled = false;
            }

            if (!Helper.IsRunningOnMono())
            {
                NativeMethods.TryAddShieldToButton(btnOK);
            }

            var container = new CompositeDisposable();

            FormClosed += (sender, args) => container.Dispose();

            container.Add(
                Observable.FromEventPattern <EventArgs>(txtName, "TextChanged")
                .ObserveOn(System.Threading.SynchronizationContext.Current)
                .Subscribe(evt =>
            {
                btnOK.Enabled = !string.IsNullOrWhiteSpace(txtName.Text);
            }));

            container.Add(
                Observable.FromEventPattern <EventArgs>(btnOK, "Click")
                .ObserveOn(System.Threading.SynchronizationContext.Current)
                .Subscribe(evt =>
            {
                var name = txtCommonName.Text;
                // Generate certificate
                string defaultIssuer  = string.Format("CN={0}", name);
                string defaultSubject = defaultIssuer;
                byte[] sn             = Guid.NewGuid().ToByteArray();
                string subject        = defaultSubject;
                string issuer         = defaultIssuer;
                DateTime notBefore    = DateTime.Now;
                DateTime notAfter     = new DateTime(643445675990000000); // 12/31/2039 23:59:59Z

                RSA issuerKey  = new RSACryptoServiceProvider(int.Parse(cbLength.Text));
                RSA subjectKey = null;

                CspParameters subjectParams   = new CspParameters();
                CspParameters issuerParams    = new CspParameters();
                BasicConstraintsExtension bce = new BasicConstraintsExtension
                {
                    PathLenConstraint    = BasicConstraintsExtension.NoPathLengthConstraint,
                    CertificateAuthority = true
                };
                ExtendedKeyUsageExtension eku = new ExtendedKeyUsageExtension();
                eku.KeyPurpose.Add("1.3.6.1.5.5.7.3.1");
                SubjectAltNameExtension alt = null;
                string p12File = Path.GetTempFileName();
                string p12pwd  = "test";

                // serial number MUST be positive
                if ((sn[0] & 0x80) == 0x80)
                {
                    sn[0] -= 0x80;
                }

                if (subject != defaultSubject)
                {
                    issuer    = subject;
                    issuerKey = null;
                }
                else
                {
                    subject    = issuer;
                    subjectKey = issuerKey;
                }

                if (subject == null)
                {
                    throw new Exception("Missing Subject Name");
                }

                X509CertificateBuilder cb = new X509CertificateBuilder(3);
                cb.SerialNumber           = sn;
                cb.IssuerName             = issuer;
                cb.NotBefore        = notBefore;
                cb.NotAfter         = notAfter;
                cb.SubjectName      = subject;
                cb.SubjectPublicKey = subjectKey;
                // extensions
                if (bce != null)
                {
                    cb.Extensions.Add(bce);
                }
                if (eku != null)
                {
                    cb.Extensions.Add(eku);
                }
                if (alt != null)
                {
                    cb.Extensions.Add(alt);
                }

                IDigest digest = new Sha1Digest();
                byte[] resBuf  = new byte[digest.GetDigestSize()];
                var spki       = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(DotNetUtilities.GetRsaPublicKey(issuerKey));
                byte[] bytes   = spki.PublicKeyData.GetBytes();
                digest.BlockUpdate(bytes, 0, bytes.Length);
                digest.DoFinal(resBuf, 0);

                cb.Extensions.Add(new SubjectKeyIdentifierExtension {
                    Identifier = resBuf
                });
                cb.Extensions.Add(new AuthorityKeyIdentifierExtension {
                    Identifier = resBuf
                });
                SubjectAltNameExtension subjectAltNameExtension = new SubjectAltNameExtension(
                    new string[0],
                    new string[1] {
                    name
                },
                    new string[0],
                    new string[0])
                {
                    Critical = false
                };
                cb.Extensions.Add(subjectAltNameExtension);
                // signature
                string hashName = cbHashing.SelectedIndex == 0 ? "SHA1" : "SHA256";
                cb.Hash         = hashName;
                byte[] rawcert  = cb.Sign(issuerKey);

                PKCS12 p12   = new PKCS12();
                p12.Password = p12pwd;

                ArrayList list = new ArrayList();
                // we use a fixed array to avoid endianess issues
                // (in case some tools requires the ID to be 1).
                list.Add(new byte[] { 1, 0, 0, 0 });
                Hashtable attributes = new Hashtable(1);
                attributes.Add(PKCS9.localKeyId, list);

                p12.AddCertificate(new X509Certificate(rawcert), attributes);
                p12.AddPkcs8ShroudedKeyBag(subjectKey, attributes);
                p12.SaveToFile(p12File);

                Item = new X509Certificate2(p12File, p12pwd)
                {
                    FriendlyName = txtName.Text
                };
                Store = cbStore.SelectedIndex == 0 ? "Personal" : "WebHosting";

                try
                {
                    using (var process = new Process())
                    {
                        // add certificate
                        var start       = process.StartInfo;
                        start.Verb      = "runas";
                        start.FileName  = "cmd";
                        start.Arguments = string.Format("/c \"\"{4}\" /f:\"{0}\" /p:{1} /n:\"{2}\" /s:{3}\"",
                                                        p12File,
                                                        p12pwd,
                                                        txtName.Text,
                                                        cbStore.SelectedIndex == 0 ? "MY" : "WebHosting",
                                                        Path.Combine(Environment.CurrentDirectory, "certificateinstaller.exe"));
                        start.CreateNoWindow = true;
                        start.WindowStyle    = ProcessWindowStyle.Hidden;
                        process.Start();
                        process.WaitForExit();
                        File.Delete(p12File);
                        if (process.ExitCode == 0)
                        {
                            DialogResult = DialogResult.OK;
                        }
                        else
                        {
                            MessageBox.Show(process.ExitCode.ToString());
                        }
                    }
                }
                catch (Win32Exception ex)
                {
                    // elevation is cancelled.
                    if (ex.NativeErrorCode != Microsoft.Web.Administration.NativeMethods.ErrorCancelled)
                    {
                        Rollbar.Report(ex, ErrorLevel.Error, new Dictionary <string, object> {
                            { "native", ex.NativeErrorCode }
                        });
                        // throw;
                    }
                }
                catch (Exception ex)
                {
                    Rollbar.Report(ex, ErrorLevel.Error);
                }
            }));
        }
Exemple #48
0
 public void Add(string strOrderField, QueryOperationSign.OrderOperation orderSign)
 {
     hsOrder.Add(strOrderField, orderSign);
 }
Exemple #49
0
 static ProMetaConst()
 {
     //regist support data types
     datatypes_.Add(DATATYPE_INT8, DATATYPE_INT8);
     datatypes_.Add(DATATYPE_INT16, DATATYPE_INT16);
     datatypes_.Add(DATATYPE_INT32, DATATYPE_INT32);
     datatypes_.Add(DATATYPE_INT64, DATATYPE_INT64);
     datatypes_.Add(DATATYPE_UINT32, DATATYPE_UINT32);
     datatypes_.Add(DATATYPE_FLOAT32, DATATYPE_FLOAT32);
     datatypes_.Add(DATATYPE_TIMESTAMP, DATATYPE_TIMESTAMP);
     datatypes_.Add(DATATYPE_STATICSTRING, DATATYPE_STATICSTRING);
     datatypes_.Add(DATATYPE_LOCALSTRUCT, DATATYPE_LOCALSTRUCT);
     datatypes_.Add(DATATYPE_GLOBALSTRUCT, DATATYPE_GLOBALSTRUCT);
     datatypes_.Add(DATATYPE_SERIALIZEOBJ, DATATYPE_SERIALIZEOBJ);
 }
        //##########################################################################################
        //# Private Static Functions
        //##########################################################################################
        ///###############################################################
        /// <summary>
        /// Retrieves the running system's assembly information.
        /// </summary>
        /// <returns>Hashtable where each index represents a key/value pair of the running systems assembly information.</returns>
        ///###############################################################
        /// <LastUpdated>March 5, 2007</LastUpdated>
        private static Hashtable GetAssemblyInfo()
        {
            Hashtable h_sReturn = new Hashtable();
            Assembly  oAssembly = Assembly.GetEntryAssembly();

            //#### If the oAssembly was not successfully collected via .GetEntryAssembly above, reset it to .GetCallingAssembly
            if (oAssembly == null)
            {
                oAssembly = Assembly.GetCallingAssembly();
            }

            //#### If the oAssembly is still null, reset our h_sReturn value to null
            if (oAssembly == null)
            {
                h_sReturn = null;
            }
            //#### Else we have a valid oAssembly
            else
            {
/*				object[] a_oAttributes;
 *                              string sName;
 *                              string sValue;
 *
 *                                      //#### Collect the a_oAttributes from the oAssembly
 *                              a_oAttributes = oAssembly.GetCustomAttributes(false);
 *
 *                                      //#### Traverse the a_oAttributes, one oAttribute at a time
 *                              foreach (Object oAttribute in a_oAttributes) {
 *                                              //#### Collect the sName and reset the sValue for this loop
 *                                      sName = oAttribute.GetType().ToString();
 *                                      sValue = "";
 *
 *                                              //#### Determine the value of sName and process accordingly
 *                                      switch (sName) {
 *                                              case "System.Reflection.AssemblyTrademarkAttribute": {
 *                                                      sName = "Trademark";
 *                                                      sValue = ((AssemblyTrademarkAttribute)oAttribute).Trademark.ToString();
 *                                                      break;
 *                                              }
 *                                              case "System.Reflection.AssemblyProductAttribute": {
 *                                                      sName = "Product";
 *                                                      sValue = ((AssemblyProductAttribute)oAttribute).Product.ToString();
 *                                                      break;
 *                                              }
 *                                              case "System.Reflection.AssemblyCopyrightAttribute": {
 *                                                      sName = "Copyright";
 *                                                      sValue = ((AssemblyCopyrightAttribute)oAttribute).Copyright.ToString();
 *                                                      break;
 *                                              }
 *                                              case "System.Reflection.AssemblyCompanyAttribute": {
 *                                                      sName = "Company";
 *                                                      sValue = ((AssemblyCompanyAttribute)oAttribute).Company.ToString();
 *                                                      break;
 *                                              }
 *                                              case "System.Reflection.AssemblyTitleAttribute": {
 *                                                      sName = "Title";
 *                                                      sValue = ((AssemblyTitleAttribute)oAttribute).Title.ToString();
 *                                                      break;
 *                                              }
 *                                              case "System.Reflection.AssemblyDescriptionAttribute": {
 *                                                      sName = "Description";
 *                                                      sValue = ((AssemblyDescriptionAttribute)oAttribute).Description.ToString();
 *                                                      break;
 *                                              }
 *                                              default: {
 *                                                //sName = sName;
 *                                                      sValue = "";
 *                                                      break;
 *                                              }
 *                                      }
 *
 *                                              //#### If a sValue was set above, .Add it into the h_sReturn value
 *                                      if (sValue.Length > 0) {
 *                                              h_sReturn.Add(sName, sValue);
 *                                      }
 *                              }
 */
                //#### .Add in the additional assembly info
                h_sReturn.Add("CodeBase", oAssembly.CodeBase.Replace("file:///", ""));
                h_sReturn.Add("Version", oAssembly.GetName().Version.ToString());
                h_sReturn.Add("FullName", oAssembly.FullName);
            }

            //#### Return the above determined h_sReturn value to the caller
            return(h_sReturn);
        }
Exemple #51
0
        /// <summary>
        /// Create summary boxes for each Column of the DataGridView
        /// </summary>
        private void reCreateSumBoxes()
        {
            ReadOnlyTextBox sumBox;

            foreach (Control control in sumBoxHash.Values)
            {
                this.Controls.Remove(control);
            }
            sumBoxHash.Clear();

            int iCnt = 0;

            List <DataGridViewColumn> sortedColumns = SortedColumns;

            foreach (DataGridViewColumn dgvColumn in sortedColumns)
            {
                sumBox = new ReadOnlyTextBox();
                sumBoxHash.Add(dgvColumn, sumBox);

                sumBox.Top         = 0;
                sumBox.Height      = dgv.RowTemplate.Height;
                sumBox.BorderColor = dgv.GridColor;
                if (summaryRowBackColor == null)
                {
                    sumBox.BackColor = dgv.DefaultCellStyle.BackColor;
                }
                else
                {
                    sumBox.BackColor = summaryRowBackColor;
                }
                sumBox.BringToFront();

                if (dgv.ColumnCount - iCnt == 1)
                {
                    sumBox.IsLastColumn = true;
                }

                if (dgv.SummaryColumns != null && dgv.SummaryColumns.Length > 0)
                {
                    for (int iCntX = 0; iCntX < dgv.SummaryColumns.Length; iCntX++)
                    {
                        if (dgv.SummaryColumns[iCntX] == dgvColumn.DataPropertyName ||
                            dgv.SummaryColumns[iCntX] == dgvColumn.Name)
                        {
                            dgvColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

                            dgvColumn.CellTemplate.Style.Format = dgv.FormatString;
                            sumBox.TextAlign = TextHelper.TranslateGridColumnAligment(dgvColumn.DefaultCellStyle.Alignment);
                            sumBox.IsSummary = true;

                            sumBox.FormatString = dgvColumn.CellTemplate.Style.Format;
                            if (dgvColumn.ValueType == typeof(System.Int32) || dgvColumn.ValueType == typeof(System.Int16) ||
                                dgvColumn.ValueType == typeof(System.Int64) || dgvColumn.ValueType == typeof(System.Single) ||
                                dgvColumn.ValueType == typeof(System.Double) || dgvColumn.ValueType == typeof(System.Single) ||
                                dgvColumn.ValueType == typeof(System.Decimal))
                            {
                                sumBox.Tag = System.Activator.CreateInstance(dgvColumn.ValueType);
                            }
                        }
                    }
                }

                sumBox.BringToFront();
                this.Controls.Add(sumBox);
                iCnt++;
            }

            if (dgv.DisplaySumRowHeader)
            {
                sumRowHeaderLabel.Font      = new Font(dgv.DefaultCellStyle.Font, dgv.SumRowHeaderTextBold ? FontStyle.Bold : FontStyle.Regular);
                sumRowHeaderLabel.Anchor    = AnchorStyles.Left;
                sumRowHeaderLabel.TextAlign = ContentAlignment.MiddleLeft;
                sumRowHeaderLabel.Height    = sumRowHeaderLabel.Font.Height;
                sumRowHeaderLabel.Top       = Convert.ToInt32(Math.Floor(Math.Abs(Convert.ToDecimal(this.InitialHeight - sumRowHeaderLabel.Height) / 2)));
                sumRowHeaderLabel.Text      = dgv.SumRowHeaderText;

                //sumRowHeaderLabel.ForeColor = dgv.DefaultCellStyle.ForeColor;
                sumRowHeaderLabel.ForeColor = Color.Red;
                sumRowHeaderLabel.Margin    = new Padding(0);
                sumRowHeaderLabel.Padding   = new Padding(0);

                this.Controls.Add(sumRowHeaderLabel);
            }
            calcSummaries();
            resizeSumBoxes();
        }
    // Find all the WheelColliders down in the hierarchy.
    void Start()
    {
        carBodyRigidbody = carObject.GetComponent <Rigidbody>();
        wd       = carObject.GetComponent <WheelDrive>();
        m_Wheels = carObject.GetComponentsInChildren <WheelCollider>();

        Debug.Log(Application.persistentDataPath + Path.DirectorySeparatorChar + "parameter.json");
        string jsonStr = "";

        if (File.Exists(Application.persistentDataPath + Path.DirectorySeparatorChar + "parameter.json"))
        {
            jsonStr = File.ReadAllText(Application.persistentDataPath + Path.DirectorySeparatorChar + "parameter.json");
        }
        else
        {
            jsonStr = Resources.Load <TextAsset>("parameter").text;
        }
        parameterJson    = MiniJSON.jsonDecode(jsonStr) as Hashtable;
        slidersMultiples = new Dictionary <string, InputField>();
        foreach (Slider slider in allSliders)
        {
            slider.value = -1;
            InputField inputField = Instantiate(inputFieldPrefab);
            inputField.gameObject.SetActive(true);
            inputField.transform.parent = slider.transform;
            inputField.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, 0);
            inputField.onValueChanged.AddListener(delegate
            {
                slider.maxValue = float.Parse(inputField.text);
                parameterJson[slider.name + "_Times"] = inputField.text;
                SaveParameter();
            });
            (inputField.placeholder as Text).text = "倍数";
            slidersMultiples.Add(slider.name, inputField);

            Text text = Instantiate(textPrefab);
            text.name = slider.name + "Text";
            text.gameObject.SetActive(true);
            text.transform.parent = slider.transform;
            text.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, 0);

            slider.onValueChanged.AddListener(delegate
            {
                SliderValueChange(slider.name, slider.value);
                parameterJson[slider.name] = slider.value;
                text.text = GetParameterAnnotation(slider.name) + "(" + slider.value + ") = " + slider.value + "  ";
                SaveParameter();
            });
            if (!parameterJson.ContainsKey(slider.name))
            {
                parameterJson.Add(slider.name, slider.value);
            }
            if (!parameterJson.ContainsKey(slider.name + "_Times"))
            {
                parameterJson.Add(slider.name + "_Times", inputField.text);
            }
            inputField.text = parameterJson[(slider.name + "_Times")].ToString();
            slider.maxValue = float.Parse(inputField.text);
            slider.value    = float.Parse(parameterJson[slider.name].ToString());
        }
        inputFieldPrefab.gameObject.SetActive(false);
        textPrefab.gameObject.SetActive(false);

        List <Dropdown.OptionData> options = new List <Dropdown.OptionData>();

        for (int i = 0; i < 3; i++)
        {
            options.Add(new Dropdown.OptionData(((DriveType)i).ToString()));
        }
        deiveTypeInput.options = options;
        deiveTypeInput.onValueChanged.AddListener(delegate
        {
            DriveTypeChange();
        });
        deiveTypeInput.value = 0;

        ParameterShowableChange();
    }
Exemple #53
0
        public Usuario ValidarSenha(string _login, IList <string> _possiveisSenhas, string ip)
        {
            Validar.Condicao(_possiveisSenhas.Count == 64, "Problemas identificados ao tentar válidar a senha, se chegou nessa mensagem de próposito entre em contato com [email protected] que eu tenho um emprego para você.");

            var o = base.Single(a => a.Usuario1.ToLower() == _login.ToLower());

            var v = false;

            if (o != null)
            {
                foreach (string Item in _possiveisSenhas)
                {
                    if (Item.Length == 6)
                    {
                        if (Util.Criptografia.GerarHash(Item, Util.Criptografia.HashMethod.MD5) == o.Senha)
                        {
                            v = true;
                            break; // TODO: might not be correct. Was : Exit For
                        }
                    }
                }

                if (o.LoginUltimoFalha.GetValueOrDefault().AddMinutes(5) > DateTime.Now && o.LoginQuantidadeSucessivaFalha >= 3)
                {
                    v = false;
                }
            }



            if (v)
            {
                o.LoginQuantidadeTotalSucesso += 1;

                o.LoginQuantidadeSucessivaSucesso += 1;

                o.LoginUltimoSucesso            = DateTime.Now;
                o.LoginQuantidadeSucessivaFalha = 0;
                SaveChanges();
                return(o);
            }
            else
            {
                if (o != null)
                {
                    o.LoginQuantidadeTotalFalha     += 1;
                    o.LoginQuantidadeSucessivaFalha += 1;
                    o.LoginUltimoFalha = DateTime.Now;
                    o.LoginQuantidadeSucessivaSucesso = 0;
                    SaveChanges();

                    if (o.LoginQuantidadeSucessivaFalha <= 3)
                    {
                        Hashtable Parametros = new Hashtable();
                        Parametros.Add("NOME-DE-USUARIO", o.Nome);
                        Parametros.Add("LOGIN", o.Usuario1);
                        Parametros.Add("IP", ip);
                        new BLLEmail().EnviarEmailMaster(o.Email, "Login Malsucedido", Parametros, "LoginIncorreto");
                    }
                }

                return(null);
            }
        }
Exemple #54
0
 /// <summary>
 /// Adds new Element Types to the Hashtable
 /// Use this function to register new SASL mechanisms
 /// </summary>
 /// <param name="mechanism"></param>
 /// <param name="t"></param>
 public static void AddMechanism(string mechanism, System.Type t)
 {
     m_table.Add(mechanism, t);
 }
 static Class627()
 {
     hashtable_0.Add(BookmarkStart.b("稶樸缺似帾㙀", 0x11), BookmarkStart.b("䰶स଺഼ా煀獂畄灆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶笸䤺䠼䰾⥀", 0x11), BookmarkStart.b("䰶स଺഼ా煀獂畄♆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("父䠸为尼䬾⡀ⱂ⭄", 0x11), BookmarkStart.b("䰶स଺഼ా煀獂畄Ն摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶堸堺嘼帾♀♂", 0x11), BookmarkStart.b("䰶स଺഼ా煀獂畄ц摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("搶嘸为匼嬾ፀ♂♄", 0x11), BookmarkStart.b("䰶स଺഼ా煀獂畄͆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("稶椸场尼䘾⑀ㅂ", 0x11), BookmarkStart.b("䰶स଺഼ా煀獂畄Ɇ摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("怶椸簺似帾ㅀ⭂ⱄ⑆筈穊", 0x11), BookmarkStart.b("䰶स଺഼ା≀筂⅄罆摈筊経罎慐繒敔杖楘歚灜㱞兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊Ṍ❎㹐⑒答晖歘", 0x11), BookmarkStart.b("䰶稸紺़社瑀療̈́獆摈獊ୌ睎晐繒慔ፖ浘汚灜杞兠Ⅲ❤䩦屨卪嵬坮䁰䕲䅴㕶㭸䡺㭼䝾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊Ṍ❎㹐⑒答恖", 0x11), BookmarkStart.b("䰶簸稺਼紾@ق牄睆摈ൊཌ籎ፐ繒摔晖ᩘ὚灜Ṟ塠卢噤䩦奨孪ⱬ⹮䅰䍲䁴䙶䥸㹺㱼䱾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊Ṍ❎㹐⑒答潖", 0x11), BookmarkStart.b("䰶༸༺Լ฾祀݂瑄睆摈罊ୌ癎ፐ繒摔晖ᩘᵚ灜杞坠♢⑤䩦奨孪ⱬ⹮䅰䍲㝴乶䭸䉺㡼䝾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊Ṍ❎㹐⑒ᡔ㙖㩘⥚㉜ᩞའɢݤ୦౨ཪ䍬幮䍰", 0x11), BookmarkStart.b("䰶紸砺഼ാ煀灂瑄灆摈๊筌੎捐繒慔ᙖ潘楚灜ᵞ塠╢⑤䩦⭨塪⡬⥮㑰䉲䍴䅶䭸䵺㭼䭾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊Ṍ⍎㡐㝒ご祖桘楚", 0x11), BookmarkStart.b("䰶स༺Լ稾̀睂癄Ɇ摈祊経穎桐繒慔敖歘ᵚ灜晞呠♢啤䩦屨幪婬⭮ば䩲䍴䝶䩸䍺㱼㥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊Ṍ⍎㡐㝒ご祖湘", 0x11), BookmarkStart.b("䰶簸稺਼紾@ق牄癆摈ൊཌ籎ፐ繒摔晖ᩘ὚灜Ṟ塠卢噤䩦奨孪ⱬ⹮䅰䍲䁴䙶䥸㹺㱼䱾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊Ṍ⍎㡐㝒ご祖慘", 0x11), BookmarkStart.b("䰶༸༺Լ฾祀݂瑄癆摈罊ୌ癎ፐ繒摔晖ᩘᵚ灜杞坠♢⑤䩦奨孪ⱬ⹮䅰䍲㝴乶䭸䉺㡼䝾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊Ṍ⍎㡐㝒ごᩖ㡘㡚⽜ぞ①ൢѤզը๪६䅮䁰䅲", 0x11), BookmarkStart.b("䰶ਸ砺఼ܾрɂD獆摈ॊ์絎摐繒慔晖橘潚灜ᵞ噠❢⍤䩦塨⹪⹬⹮䁰䁲䙴䁶㵸㽺㥼㱾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊Ṍ⍎㡐㝒ごіㅘ㑚⩜煞偠兢", 0x11), BookmarkStart.b("䰶稸紺़社瑀療̈́獆摈獊ୌ睎晐繒慔ፖ浘汚灜杞兠Ⅲ❤䩦屨卪嵬坮䁰䕲䅴㕶㭸䡺㭼䝾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊Ṍ⍎㡐㝒ごіㅘ㑚⩜煞奠", 0x11), BookmarkStart.b("䰶༸༺Լ฾祀݂瑄睆摈罊ୌ癎ፐ繒摔晖ᩘᵚ灜杞坠♢⑤䩦奨孪ⱬ⹮䅰䍲㝴乶䭸䉺㡼䝾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊Ṍ⍎㡐㝒ごіㅘ㑚⩜቞`bᝤࡦⱨժ౬൮ᵰᙲᅴ奶䡸䥺", 0x11), BookmarkStart.b("䰶紸砺഼ാ煀灂瑄灆摈๊筌੎捐繒慔ᙖ潘楚灜ᵞ塠╢⑤䩦⭨塪⡬⥮㑰䉲䍴䅶䭸䵺㭼䭾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊᥌⩎㱐⍒㥔㙖ⵘ㹚獜湞占", 0x11), BookmarkStart.b("䰶ฺุ礼༾灀獂牄睆摈穊罌籎敐繒慔捖᱘扚灜杞占╢卤䩦⵨⥪塬⵮䉰䩲㑴䍶乸㡺䱼䱾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊᥌⩎㱐⍒㥔㙖ⵘ㹚獜杞", 0x11), BookmarkStart.b("䰶༸༺Լ฾祀݂瑄癆摈罊ୌ癎ፐ繒摔晖ᩘᵚ灜杞坠♢⑤䩦奨孪ⱬ⹮䅰䍲㝴乶䭸䉺㡼䝾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊᥌⩎㱐⍒㥔㙖ⵘ㹚ၜ㹞ɠᅢ੤≦ݨ੪ཬͮᑰᝲ孴䙶䭸", 0x11), BookmarkStart.b("䰶砸稺఼ା݀穂ل繆摈絊罌ൎ摐繒慔慖橘汚灜杞⁠⁢兤䩦全⵪彬婮㍰㕲䝴乶㵸乺㱼䡾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊ᩌ♎⭐㉒❔㍖睘捚", 0x11), BookmarkStart.b("䰶༸༺Լ฾祀݂瑄睆摈罊ୌ癎ፐ繒摔晖ᩘᵚ灜杞坠♢⑤䩦奨孪ⱬ⹮䅰䍲㝴乶䭸䉺㡼䝾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("怶嘸䤺夼ᄾՀⱂ♄㉆⑈⹊⍌㭎罐扒杔", 0x11), BookmarkStart.b("䰶缸༺਼ਾ畀B籄Ն摈絊祌ॎ摐繒慔ᕖ浘歚灜杞⁠╢兤䩦彨屪呬塮䉰䅲㑴㑶䥸䵺䵼䡾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("怶嘸䤺夼ᄾՀⱂ♄㉆⑈⹊⍌㭎罐敒", 0x11), BookmarkStart.b("䰶स଺഼ാ煀穂畄睆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("怶嘸䤺夼ᄾՀⱂ♄㉆⑈⹊⍌㭎罐歒", 0x11), BookmarkStart.b("䰶स଺഼ാ煀穂畄煆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("怶嘸䤺夼ᄾՀⱂ♄㉆⑈⹊⍌㭎᱐㉒㙔╖㙘Ṛ㍜㹞͠རdͦ䝨婪彬", 0x11), BookmarkStart.b("䰶࠸̺簼༾着ł獄Ն摈祊ୌ籎ᝐ繒慔ቖ歘ᥚ灜Ṟ坠剢呤䩦屨奪⽬⩮䝰䁲䑴㕶䭸㽺佼䵾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("怶嘸䤺夼ᄾเ㍂⁄⥆ൈ⑊⹌㩎㱐㙒㭔⍖൘㹚╜⭞你剢坤", 0x11), BookmarkStart.b("䰶࠸示༼ा灀ł睄畆摈੊์祎ၐ繒慔ቖ潘捚灜Ṟ奠呢啤䩦⡨⥪塬彮䥰䍲ぴ佶佸䍺䩼㵾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("怶嘸䤺夼ᄾᅀ⩂♄㍆㱈㥊⡌慎材", 0x11), BookmarkStart.b("䰶स଺഼ാ煀穂畄癆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("怶嘸䤺夼ᄾᅀ⩂♄㍆㱈㥊⡌慎楐", 0x11), BookmarkStart.b("䰶स଺഼ാ煀穂畄灆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("怶嘸䤺夼ᄾፀᝂ̈́楆煈", 0x11), BookmarkStart.b("䰶स଺഼ാ煀穂畄煆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("怶嘸䤺夼ᄾᕀ♂⡄㝆╈⩊㥌⩎罐扒杔", 0x11), BookmarkStart.b("䰶8਺༼績̀B灄畆摈硊筌੎捐繒慔恖桘潚灜杞①啢坤䩦⡨卪⽬塮䉰ひ㑴䉶㱸䡺䑼佾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("怶嘸䤺夼ᄾᕀ♂⡄㝆╈⩊㥌⩎罐歒", 0x11), BookmarkStart.b("䰶स଺഼ാ煀穂畄煆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("怶嘸䤺夼ᄾᕀ♂⡄㝆╈⩊㥌⩎᱐㉒㙔╖㙘Ṛ㍜㹞͠རdͦ䝨婪彬", 0x11), BookmarkStart.b("䰶ĸ稺଼ാ畀灂組罆摈੊ౌ絎晐繒慔摖᱘歚灜杞塠╢嵤䩦孨⩪屬嵮㍰㕲㍴䁶㭸㡺㹼㭾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("父䄸堺堼匾潀ɂ㕄㝆╈≊⹌⹎═㩒㩔㥖睘橚潜", 0x11), BookmarkStart.b("䰶स଺഼ാ畀療畄睆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("父䄸堺堼匾潀Bⵄ♆㭈㽊捌穎", 0x11), BookmarkStart.b("䰶स଺഼ാ煀筂瑄癆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("父䄸堺堼匾潀Bⵄ♆㭈㽊捌睎", 0x11), BookmarkStart.b("䰶स଺഼ാ煀筂睄癆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("父䄸堺堼匾潀Bᙄᅆ", 0x11), BookmarkStart.b("䰶स଺഼ാ煀筂癄畆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("父䄸堺堼匾潀ూ㕄≆❈ཊ≌ⱎ⑐㹒ご㥖ⵘ࡚ⵜⵞѠɢŤᑦŨ๪࡬᭮彰䉲䝴", 0x11), BookmarkStart.b("䰶簸稺缼簾рBńՆ摈ࡊ์繎ቐ繒慔ᙖ潘ᵚ灜ᵞ啠♢噤䩦幨⵪啬坮䥰㉲䁴㙶㵸㵺㹼䝾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("父䄸堺堼匾潀၂ⵄ≆ⱈ㽊捌繎捐", 0x11), BookmarkStart.b("䰶स଺഼ാ煀筂癄睆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("父䄸堺堼匾潀၂ⵄ≆ⱈ㽊捌穎", 0x11), BookmarkStart.b("䰶स଺഼ാ煀筂瑄睆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("父䄸堺堼匾潀၂ⵄ≆ⱈ㽊捌睎", 0x11), BookmarkStart.b("䰶स଺഼ാ煀筂睄睆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("父䄸堺堼匾潀၂ⵄ≆ⱈ㽊ཌ♎㽐㉒❔⹖ᑘ㩚㹜ⵞ๠♢୤٦୨ݪ࡬୮彰䉲䝴", 0x11), BookmarkStart.b("䰶स଺഼ാ煀筂癄瑆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("父䄸堺堼匾潀၂ⵄ≆ⱈ㽊L⹎㉐⅒㩔ቖ㝘㩚㽜㍞Ѡݢ䭤噦孨", 0x11), BookmarkStart.b("䰶स଺഼ാ煀筂癄畆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("父䄸堺堼匾潀ᝂ⁄⩆㥈❊ⱌ㭎㑐絒浔", 0x11), BookmarkStart.b("䰶स଺഼ാ煀筂睄睆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("父䄸堺堼匾潀ᝂ⁄⩆㥈❊ⱌ㭎㑐Ṓ㑔㑖⭘㑚ᡜㅞ`Ţ।ɦ൨", 0x11), BookmarkStart.b("䰶स଺഼ാ煀筂癄畆摈筊経罎慐繒敔杖楘歚灜ᱞ兠卢啤䩦奨孪嵬彮䅰䍲䕴䝶䥸䭺䥼䥾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶堸刺匼䬾潀ፂⱄ⑆㵈㹊㽌⩎", 0x11), BookmarkStart.b("䰶紸࠺砼ా畀ł睄癆摈牊ौ硎摐繒摔杖桘ᩚ灜杞≠偢Ⅴ䩦奨孪ⱬ⹮䅰䍲䑴㙶䡸䵺䡼䵾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("朶嘸䰺堼䴾ᅀⱂⱄ⥆㵈敊Ɍ㽎㑐㵒ᅔ㡖㩘⹚ぜ㩞འᝢ㕤ᕦ౨ᡪ࡬ŮհቲŴṶᙸᕺ卼乾뎀", 0x11), BookmarkStart.b("䰶娸ऺԼാ畀牂牄╆摈祊筌祎捐繒慔捖㭘捚灜杞`婢兤䩦婨४୬८䝰䉲ᙴ䉶䥸䉺䵼佾ﲀ", 0x11));
     hashtable_0.Add(BookmarkStart.b("堶䤸帺匼嬾⹀⁂い⩆ⱈ╊㥌慎ᕐ⅒㑔⁖ᵘ㑚㹜⩞ౠ٢୤፦䝨婪", 0x11), BookmarkStart.b("䰶സ༺Լ紾̀瑂牄癆摈ࡊୌ੎捐繒慔恖ᩘ潚灜ᵞ≠❢⍤䩦塨⵪⽬⥮䉰䑲䵴㉶䭸䭺佼㱾ﲀ", 0x11));
 }
Exemple #56
0
        protected override Usuario UpdateRule(Usuario entity)
        {
            Validar.StringVazia(entity.CPF, "Informe um CPF");
            Validar.Condicao(Validar.CPF(entity.CPF), "Informe um CPF");

            var bllUC = new BLLUsuarioContato(_context);
            var bllUF = new BLLUsuarioFoto(_context);

            var u = SelectByKey(entity.ID);

            bool PrimeiroAcesso = (u.CPF == null);

            u.Nome      = entity.Nome;
            u.Sobrenome = entity.Sobrenome;
            u.CPF       = entity.CPF;
            u.DataUpd   = DateTime.Now;
            if (entity.Senha != null && entity.Senha.Trim() != String.Empty && entity.Senha.Length == 6)
            {
                u.Senha = Util.Criptografia.GerarHash(entity.Senha, Util.Criptografia.HashMethod.MD5);
            }

            while (u.UsuarioContato.Count > 0)
            {
                bllUC.Delete(u.UsuarioContato.First());
            }

            foreach (var item in entity.UsuarioContato)
            {
                if (item.UsuarioContato1.Trim() != String.Empty)
                {
                    var uc = new UsuarioContato();
                    uc.UsuarioContatoTipo_ID = item.UsuarioContatoTipo_ID;
                    uc.UsuarioContato1       = item.UsuarioContato1;
                    uc.Publico = item.Publico;
                    u.UsuarioContato.Add(uc);
                }
            }

            while (u.UsuarioFoto.Count > 0)
            {
                bllUF.Delete(u.UsuarioFoto.First());
            }

            if (entity.UsuarioFoto.Count > 0)
            {
                u.NomeArquivoFotoPrincipal = entity.UsuarioFoto.First().NomeArquivo;
                foreach (var item in entity.UsuarioFoto)
                {
                    if (item.NomeArquivo.Trim() != String.Empty)
                    {
                        var uf = new UsuarioFoto();
                        uf.NomeArquivo = item.NomeArquivo;
                        uf.DataInc     = DateTime.Now;
                        u.UsuarioFoto.Add(uf);
                    }
                }
            }
            else
            {
                u.NomeArquivoFotoPrincipal = null;
            }



            if (entity.Endereco != null)
            {
                if (u.Endereco == null)
                {
                    u.Endereco = new Endereco();
                }

                u.Endereco.EnderecoCep_ID = entity.Endereco.EnderecoCep_ID;
                u.Endereco.Complemento    = entity.Endereco.Complemento;
            }


            //validar aqui se o usuário foi convidado e adicionar os pontos a quem convidou.

            if (PrimeiroAcesso && u.UsuarioIndicou_ID != null)
            {
                int premioQualificacao = 5;

                //trocar por metodo credita qualificação
                u.Usuario4.QualificacaoPositiva += premioQualificacao;

                //enviar email

                var bllemail = new BLLEmail();

                Hashtable Parametros = new Hashtable();
                Parametros.Add("NOME-DE-USUARIO", u.Usuario4.Nome);
                Parametros.Add("NOME-DE-USUARIO-NOVO", u.Nome);
                Parametros.Add("PONTOS", premioQualificacao);


                new BLLEmail().EnviarEmailMaster(u.Usuario4.Email, "Parabéns, você recebeu uma qualificação positiva do muambba.com.br", Parametros, "IndicacaoPremio");
            }

            return(u);
        }
Exemple #57
0
        protected ObjectBase(XmlElement ns, XmlElement elem, bool is_interface) : base(ns, elem)
        {
            this.is_interface = is_interface;
            XmlElement class_elem = null;
            Hashtable  vms        = new Hashtable();
            Hashtable  signal_vms = new Hashtable();

            if (this.ParserVersion == 1)
            {
                class_struct_name = this.CName + (is_interface ? "Iface" : "Class");
            }

            foreach (XmlNode node in elem.ChildNodes)
            {
                if (!(node is XmlElement))
                {
                    continue;
                }
                XmlElement member = node as XmlElement;

                switch (node.Name)
                {
                case "virtual_method":
                    if (this.ParserVersion == 1)
                    {
                        if (is_interface)                         // Generating non-signal GObject virtual methods is not supported in compatibility mode
                        {
                            AddVM(member, false, is_interface);
                        }
                    }
                    else
                    {
                        vms.Add(member.GetAttribute("cname"), member);
                    }
                    break;

                case "signal":
                    if (this.ParserVersion == 1 || member.GetAttribute("field_name") == "")
                    {
                        AddVM(member, true, is_interface);
                    }
                    else
                    {
                        signal_vms.Add(member.GetAttribute("field_name"), member);
                    }

                    if (member.GetAttribute("hidden") != "1")
                    {
                        string name = member.GetAttribute("name");
                        while (sigs.ContainsKey(name))
                        {
                            name += "mangled";
                        }
                        sigs.Add(name, new Signal(member, this));
                    }
                    break;

                case "class_struct":
                    class_elem = member;
                    break;
                }
            }

            if (class_elem == null)
            {
                return;
            }
            class_struct_name = class_elem.GetAttribute("cname");

            for (int node_idx = 0; node_idx < class_elem.ChildNodes.Count; node_idx++)
            {
                XmlNode node = class_elem.ChildNodes [node_idx];
                if (!(node is XmlElement))
                {
                    continue;
                }
                XmlElement member = (XmlElement)node;

                switch (member.Name)
                {
                case "method":
                    string     vm_name;
                    XmlElement vm_elem;
                    bool       is_signal_vm = member.HasAttribute("signal_vm");
                    if (is_signal_vm)
                    {
                        vm_name = member.GetAttribute("signal_vm");
                        vm_elem = signal_vms [vm_name] as XmlElement;
                    }
                    else
                    {
                        vm_name = member.GetAttribute("vm");
                        vm_elem = vms [vm_name] as XmlElement;
                    }

                    AddVM(vm_elem, is_signal_vm, is_interface);
                    break;

                case "field":
                    if (node_idx == 0)
                    {
                        continue;                                    // Parent class
                    }
                    ClassField field = new ClassField(member, this);
                    class_fields.Add(field);
                    class_members.Add(field);
                    break;

                default:
                    Console.WriteLine("Unexpected node " + member.Name + " in " + class_elem.GetAttribute("cname"));
                    break;
                }
            }
        }
    //called when cutter object exit's from another object's collider
    void OnTriggerExit2D(Collider2D col)
    {
        if (Time.time > lastCutTime + 0.01f)       // && !col.isTrigger) //wait 0.2 before second cut, used to avoid double cut when this trigger exits 2 collider simultaneously
        {
            if (cutCount < maxCutCount && cutting && col.transform.parent && col.tag == "rope2D" && col.GetComponent <HingeJoint2D>())
            {
                if (col.gameObject.GetComponent <Breakable>() != null && col.gameObject.GetComponent <Breakable>().CortesNecesariosParaRomper > 1)
                {
                    col.gameObject.GetComponent <Breakable>().UnCorte();
                    //if(!audioSrc.isPlaying)
                    //{
                    audioSrc.clip = hitChainSound;
                    audioSrc.Play();
                    //}
                }
                else
                {
                    //if limitCutPerObject is set to true, check if we can cut it again
                    if (limitCutPerObject)
                    {
                        var id = col.transform.parent.GetInstanceID();                         //get object ID

                        if (ropeHash.ContainsKey(id))
                        {
                            if ((int)ropeHash[id] < maxCutPerObject - 1)                            //rope can be cut again
                            {
                                cut          = true;
                                ropeHash[id] = (int)ropeHash[id] + 1;
                            }
                            else
                            {
                                cut = false;
                            }
                        }
                        else
                        {
                            ropeHash.Add(id, 0);
                            cut = true;
                        }
                    }

                    //if we can cut rope
                    if (!limitCutPerObject || (limitCutPerObject && cut))
                    {
                        //if audio isn't playing, play cut sound
                        if (!audioSrc.isPlaying)
                        {
                            audioSrc.clip = cutSound;
                            audioSrc.Play();
                        }

                        col.GetComponent <HingeJoint2D>().enabled = false;                        //disable cut object's HingeJoint2D component, so it won't be connected to another object
                        col.isTrigger        = true;
                        col.renderer.enabled = false;
                        col.transform.parent.gameObject.GetComponent <CadenaCompletaScriptMastrom>().QuemarCadena = true;

                        //if cutFX object is set (from inspector window), instantiate that object at cut position
                        if (cutFX)
                        {
                            var obj = Instantiate(cutFX, col.transform.position, Quaternion.identity) as GameObject;
                            Destroy(obj, 1);
                        }

                        //if rope has attached "UseLineRenderer" script call its Split function
                        if (col.transform.parent && col.transform.parent.GetComponent <UseLineRenderer>())
                        {
                            col.transform.parent.GetComponent <UseLineRenderer>().Split(col.name, newMatPerChunk);
                        }

                        if (limitCutCount)
                        {
                            cutCount++;
                        }
                    }
                    lastCutTime = Time.time;
                }
            }
        }
    }
        private void reCreateSumBoxes()
        {
            ReadOnlyTextBox sumBox;

            foreach (Control control in sumBoxHash.Values)
            {
                this.Controls.Remove(control);
            }
            sumBoxHash.Clear();

            int iCnt = 0;

            List <DataGridViewColumn> sortedColumns = SortedColumns;

            foreach (DataGridViewColumn dgvColumn in sortedColumns)
            {
                sumBox = new ReadOnlyTextBox();
                if (!sumBoxHash.ContainsKey(dgvColumn))
                {
                    sumBoxHash.Add(dgvColumn, sumBox);
                }

                sumBox.Top         = 0;
                sumBox.Height      = dgv.RowTemplate.Height;
                sumBox.BorderColor = dgv.GridColor;
                sumBox.TextAlign   = TextHelper.TranslateGridColumnAligment(dgvColumn.DataGridView.DefaultCellStyle.Alignment);
                sumBox.Font        = dgvColumn.DataGridView.DefaultCellStyle.Font;
                sumBox.TabStop     = false;
                if (summaryRowBackColor == null)
                {
                    sumBox.BackColor = dgvColumn.DefaultCellStyle.BackColor;
                }
                else
                {
                    sumBox.BackColor = summaryRowBackColor;
                }
                sumBox.BringToFront();

                if (dgv.ColumnCount - iCnt == 1)
                {
                    sumBox.IsLastColumn = true;
                }

                sumBox.BringToFront();
                this.Controls.Add(sumBox);

                iCnt++;
            }

            if (dgv.DisplaySumRowHeader)
            {
                sumRowHeaderLabel.Font      = new Font(dgv.DefaultCellStyle.Font, dgv.SumRowHeaderTextBold ? FontStyle.Bold : FontStyle.Regular);
                sumRowHeaderLabel.Anchor    = AnchorStyles.Left;
                sumRowHeaderLabel.TextAlign = ContentAlignment.MiddleLeft;
                sumRowHeaderLabel.Height    = sumRowHeaderLabel.Font.Height;
                sumRowHeaderLabel.Top       = Convert.ToInt32(Convert.ToDouble(this.InitialHeight - sumRowHeaderLabel.Height) / 2F);
                sumRowHeaderLabel.Text      = dgv.SumRowHeaderText;

                sumRowHeaderLabel.ForeColor = dgv.DefaultCellStyle.ForeColor;
                sumRowHeaderLabel.Margin    = new Padding(0);
                sumRowHeaderLabel.Padding   = new Padding(0);

                this.Controls.Add(sumRowHeaderLabel);
            }
            resizeSumBoxes();
        }
Exemple #60
0
 private void AddMoreElements(string threadName)
 {
     _hashGrandDaughter.Add("Key_" + threadName, threadName);
 }