Example #1
0
        /// <summary>
        /// Ack() will be called when the transaction is committed.
        /// </summary>
        /// <param name="seqId">Sequence Id of the tuple which is acked.</param>
        /// <param name="parms"></param>
        public void Ack(long seqId, Dictionary <string, Object> parms)
        {
            Context.Logger.Info("Ack, seqId: {0}", seqId);
            State state = stateStore.GetState(seqId);

            state.Commit(true);
        }
Example #2
0
        public void Ack(long seqId, Dictionary <string, Object> parms)
        {
            Context.Logger.Info("Ack, seqId: {0}", seqId);

            if (Context.pluginType != SCPPluginType.SCP_NET_LOCAL)
            {
                State state = stateStore.GetState(seqId);
                state.Commit(true);
            }
        }
Example #3
0
        protected void gvStates_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            try
            {
                TransactionResult result;
                // Get the selected row's state id
                int stateIDToDelete = Convert.ToInt32(gvStates.DataKeys[e.RowIndex].Value);

                // Delete the selected state
                _currentState = new State();
                _currentState.StateID = stateIDToDelete;
                _currentState.ScreenMode = ScreenMode.Delete;
                result = _currentState.Commit();

                // Display the status of the delete
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append("<script>alert('" + result.Message.ToString() + ".');");
                sb.Append("</script>");
                ScriptManager.RegisterStartupScript(this.Page, typeof(string), "MyScript", sb.ToString(), false);

                // If successfully deleted
                if (result.Status == TransactionStatus.Success)
                {
                    ddlStateCountry_SelectedIndexChanged(sender, e);
                    tcntAllCSCTabs.ActiveTab = tpnlStates;
                }
            }
            catch (Exception ex)
            {
                ErrorLog.LogErrorMessageToDB("Countries.aspx", "", "gvStates_RowDeleting", ex.Message.ToString(), new ECGroupConnection());
                throw;
            }
        }
Example #4
0
        protected void btnStateSave_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                // Create a new State Object
                _currentState = new State();

                // Set whether Add / Edit
                if (txtStateID.Text.ToString() != "0")
                    _currentState.AddEditOption = 1;
                else
                    _currentState.AddEditOption = 0;

                // Assign values to the State Object
                _currentState.CountryID = Convert.ToInt32(ddlCountry.SelectedValue.ToString());
                _currentState.StateID = Convert.ToInt32(txtStateID.Text.ToString());
                _currentState.StateDescription = txtState.Text.ToString();

                // Add / Edit the State
                TransactionResult result;
                _currentState.ScreenMode = ScreenMode.Add;
                result = _currentState.Commit();

                // Display the Status - Whether successfully saved or not
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append("<script>alert('" + result.Message.ToString() + ".');");
                sb.Append("</script>");
                ScriptManager.RegisterStartupScript(this.Page, typeof(string), "MyScript", sb.ToString(), false);

                // If successful
                if (result.Status == TransactionStatus.Success)
                {

                    txtStateID.Text = "0";
                    txtState.Text = "";
                    tcntAllCSCTabs.ActiveTab = tpnlStates;
                }
                else
                {

                    txtStateID.Text = "0";
                    txtState.Text = "";
                    tcntAllCSCTabs.ActiveTab = tpnlStates;
                }
                ddlStateCountry_SelectedIndexChanged(sender, e);
            }
            catch (Exception ex)
            {
                ErrorLog.LogErrorMessageToDB("Countries.aspx", "", "btnStateSave_Click", ex.Message.ToString(), new ECGroupConnection());
                throw;
            }
        }