//NEW
        protected void btnAddNew_Click(object sender, EventArgs e)
        {
            int intCounter;

            intCounter = CommonCodes.getCount(CommonCodes.gUserDatafile);

            txtUserID.Text     = Convert.ToString(intCounter);
            txtStatus.Text     = CommonCodes.STATUS_DRAFT;
            txtUsername.Text   = string.Empty;
            txtFirstname.Text  = string.Empty;
            txtLastname.Text   = string.Empty;
            txtDepartment.Text = string.Empty;
            txtEmail.Text      = string.Empty;

            displayEditForm("New user", false, true, true, true, false);
        }
Exemplo n.º 2
0
        protected void btnAddNew_Click(object sender, EventArgs e)
        {
            int intCounter;

            intCounter = CommonCodes.getCount(CommonCodes.gVATCodeDatafile);

            txtID.Text            = Convert.ToString(intCounter);
            txtStatus.Text        = CommonCodes.STATUS_DRAFT;
            txtVATCode.Text       = string.Empty;
            txtDescription.Text   = string.Empty;
            txtVATPercentage.Text = string.Empty;
            rbInput.Checked       = false;
            rbOutput.Checked      = false;

            displayEditForm("New tax code", false, true, true, true, false);
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (CommonCodes.gLog == null)
                {
                    CommonCodes.initialize();
                    //CommonCodes.gLog = new JELogHelper(CommonCodes.gLogDatafile, CommonCodes.gUserDatafile, CommonCodes.gUsername);
                }
                if (CommonCodes.gUser.username == null)
                {
                    Response.Redirect("2.Users.aspx");
                }
                Label mpPageTitle = (Label)Page.Master.FindControl("lblPageTitle");
                Label mpMessage   = (Label)Page.Master.FindControl("lblMessage");
                mpPageTitle.Text = "Main page";
                mpMessage.Text   = "...";

                CommonCodes.gLog.logEvent("Opening " + strPagetitle);
            }
        }
Exemplo n.º 4
0
        //NEW
        protected void btnAddNew_Click(object sender, EventArgs e)
        {
            int intCounter;

            intCounter          = CommonCodes.getCount(CommonCodes.gCompanyDatafile);
            txtCompanyID.Text   = Convert.ToString(intCounter);
            selectedApprovers   = new List <string>();
            selectedDepartments = new List <string>();
            selectedApprovers.Add("");
            selectedDepartments.Add("");
            txtCompanyCode.Text = string.Empty;
            txtCompanyName.Text = string.Empty;
            txtAddress.Text     = string.Empty;
            //txtHomeCurrency.Text = string.Empty;
            ddlCurrency.Text = string.Empty;
            //chkApprovers.ClearSelection();
            chkApprovers.Items.Clear();
            //chkDepartments.ClearSelection();
            chkDepartments.Items.Clear();
            displayEditForm("New company", false, true, true, true, false);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //setting variables
         if (CommonCodes.gLog == null)
         {
             CommonCodes.initialize();
         }
         if (CommonCodes.gUser.username != null)
         {
             lblUserName.Text       = CommonCodes.gUser.username;
             lblUserDepartment.Text = CommonCodes.gUser.department;
             lblUserRoles.Text      = "[" + string.Join("], [", CommonCodes.gUser.roles) + "]";
             SetButtons(CommonCodes.gUser);
         }
         else
         {
             lblMessage.Text = "Username " + CommonCodes.gUsername + " missing!";
         }
     }
 }
Exemplo n.º 6
0
        //ACTION-BUTTONS
        //NEW
        protected void btnAddNew_Click(object sender, EventArgs e)
        {
            try
            {
                CommonCodes.gJEDoc = new JEDoc();
                int intCounter = CommonCodes.getCount(CommonCodes.gJEDocDatafile);

                //CommonCodes.gJEDoc.processinghistory.Clear();
                //CommonCodes.gJEDoc.rows.Clear();
                CommonCodes.gJEDoc.id = Convert.ToString(intCounter);

                CommonCodes.gJEDoc.author = CommonCodes.gUsername;

                addNewStatus(CommonCodes.STATUS_DRAFT, "New JE document");

                //populating fields
                txtID.Text             = Convert.ToString(intCounter);
                ddlPeriod.Text         = string.Empty;
                ddlType.Text           = string.Empty;
                txtDocumentNumber.Text = string.Empty;
                txtDate.Text           = string.Empty;
                txtAuthor.Text         = CommonCodes.gUsername;
                ddlApprover.Text       = string.Empty;
                ddlApprover.Items.Clear();
                txtCompanyCode.Text  = string.Empty;
                txtCompanyName.Text  = string.Empty;
                ddlCompany.Text      = string.Empty;
                ddlDepartment.Text   = string.Empty;
                txtHomeCurrency.Text = string.Empty;

                ddlDepartment.Text = string.Empty;
                ddlDepartment.Items.Clear();
                txtHeadertext.Text          = string.Empty;
                txtHomeCurrency.Text        = string.Empty;
                ddlCurrency.Text            = string.Empty;
                txtCurrencyRate.Text        = string.Empty;
                txtInformation.Text         = string.Empty;
                ltProcessingHistoryAll.Text = "";
                lblDebetTotal.Text          = string.Empty;
                lblCreditTotal.Text         = string.Empty;
                lblDifference.Text          = string.Empty;
                ltDataRows.Text             = "";
                //display processing history
                if (CommonCodes.gJEDoc.processinghistory != null)
                {
                    foreach (JEDocStatus status in CommonCodes.gJEDoc.processinghistory)
                    {
                        ltProcessingHistoryAll.Text += string.Format("<tr class='listRow'><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td></tr>",
                                                                     status.id, status.status, status.username, status.date, status.message);
                    }
                }

                displayEditForm("New JE document", false, true, true, true, false);
            }
            catch (Exception ex)
            {
                CommonCodes.gLog.logError(strPagetitle + ", creating new JE document: ", ex);

                mpMessage.Text = "<br />" + ex.Message;
            }
        }