コード例 #1
0
 private void frmConfiguration_Load(object sender, EventArgs e)
 {
     cv = new clsValidation();
     LoadINI();
     LoadSetting();
     CheckDatabaseConnection();
 }
コード例 #2
0
        private int GetLastIDofBilling()
        {
            clsValidation cv     = new clsValidation();
            int           result = 0;

            try
            {
                string    Query      = "SELECT sysID from tbl_condo_billinginfo order by sysID DESC LIMIT 1";
                DataTable dtResult   = dtrans.SelectData(Query);
                string    ResultData = string.Empty;

                if (dtResult.Rows.Count > 0)
                {
                    ResultData = dtResult.Rows[0]["sysId"].ToString();
                }

                if (ResultData == "")
                {
                    ResultData = "1";
                    return(int.Parse(ResultData));
                }

                if (cv.isInteger(ResultData))
                {
                    return(int.Parse(ResultData) + 1);
                }
            }
            catch (Exception ex)
            {
            }
            return(result);
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: hoanghadhpt/Smarter-Cleanup
 // Token: 0x060000C0 RID: 192 RVA: 0x000B958C File Offset: 0x000B858C
 private void btnCleanup_Click(object sender, EventArgs e)
 {
     if (this.WorkId == 0)
     {
         clsCleanup clsCleanup = new clsCleanup();
         clsCleanup.Cleanup(this.txtInputCleanup.Text, this.txtOutput.Text, this.txtConfigCleanup.Text, this.txtLogCleanup.Text);
         //Interaction.MsgBox("Over", MsgBoxStyle.OkOnly, null);
     }
     else if (this.WorkId == 1)
     {
         clsRemoveEmphasis clsRemoveEmphasis = new clsRemoveEmphasis();
         clsRemoveEmphasis.RemoveEmphasis(this.txtInputCleanup.Text, this.txtOutput.Text, this.txtConfigCleanup.Text, this.txtLogCleanup.Text);
         //Interaction.MsgBox("Over", MsgBoxStyle.OkOnly, null);
     }
     else if (this.WorkId == 2)
     {
         clsValidation clsValidation = new clsValidation();
         clsValidation.Validate(this.txtInputCleanup.Text, this.txtOutput.Text, this.txtConfigCleanup.Text, this.txtLogCleanup.Text);
         //Interaction.MsgBox("Over", MsgBoxStyle.OkOnly, null);
     }
     else
     {
         Interaction.MsgBox("Can not perform this operation!!!!", MsgBoxStyle.OkOnly, null);
     }
 }
コード例 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            clsValidation cv = new clsValidation();

            if (dataGridView1.Rows.Count == 0)
            {
                MessageBox.Show("Error: No Details to save on this Billing. Please check", "Cannot save Billing Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (cbCutoff.Text == "")
            {
                MessageBox.Show("Error: No Cut-off defined on this Billing. Please check", "Cannot save Billing Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            DialogResult dr = MessageBox.Show("Are you sure you want to save this Billing Information?", "Confirm Saving Billing Information", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                string PrimaryKey               = GetLastIDofBilling().ToString("000000000000");
                string checkUnitCutoff          = "SELECT * FROM tbl_condo_billinginfo WHERE cutoffID = " + cv.GetSysID("where PrimaryKey ='" + cbCutoff.Text.ToString() + "'", "tbl_condo_cutoffinfo") + " AND unitno = " + cbUnitNo.SelectedValue;
                bool   isUnitCheckAgainstCutoff = dtrans.SelectData(checkUnitCutoff).Rows.Count > 0 ? true : false;
                if (isUnitCheckAgainstCutoff)
                {
                    MessageBox.Show("Error: Cannot save details for this cut-off. Please check", "Cut-off already exists", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                string BillingInfoQuery = "Insert into tbl_condo_billinginfo(PrimaryKey,CutoffID,CustomerID,UnitNo,TotalAmountDue,PreviousBalanceAsOf,CurrentCharges,CreatedBy)Values('" + PrimaryKey + "'," + cv.isInteger(cv.GetSysID("where PrimaryKey ='" + cbCutoff.Text.ToString() + "'", "tbl_condo_cutoffinfo").ToString()) + "," + lblCustomerID.Text + "," + cbUnitNo.SelectedValue + "," + tbTotalAmount.Text + "," + PreviousBalance + "," + lblCurrenttotal.Text + "," + UserID + ")";
                bool   isErrorFound     = false;
                if (dtrans.InsertData(BillingInfoQuery))
                {
                    if (dataGridView1.Rows.Count > 0)
                    {
                        string GetSySID = cv.GetSysID("where PrimaryKey='" + PrimaryKey + "'", "tbl_condo_billinginfo").ToString();
                        if (GetSySID == "0")
                        {
                            MessageBox.Show("Error: Cannot save billing. Please check", "Error Saving", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            string DeleteDetails = "Delete from tbl_condo_billinginfo where primarykey='" + PrimaryKey + "'";
                            dtrans.InsertData(DeleteDetails);
                            isErrorFound = true;
                            return;
                        }
                        foreach (DataGridViewRow dgrow in dataGridView1.Rows)
                        {
                            string GetManualNotes      = string.IsNullOrEmpty(dgrow.Cells["ManualNotes"].Value.ToString()) ? dgrow.Cells["ManualNotes"].Value.ToString() : string.Empty;
                            string BillingRefID        = GetLastIDofBillingDetails(GetSySID).ToString();
                            string BillingDetailsQuery = "Insert into tbl_condo_billingdetails(PrimaryKey,BillingRefID,BillingDescription,BillingAmount,BillingNotes,CreatedBy)values('" + PrimaryKey + "_" + BillingRefID + "'," + GetSySID + ",'" + dgrow.Cells["Transaction"].Value.ToString() + "'," + dgrow.Cells["Amount"].Value.ToString() + ",'" + GetManualNotes + "'," + UserID + ")";
                            if (!dtrans.InsertData(BillingDetailsQuery))
                            {
                                MessageBox.Show("Error: Cannot save billing details. Please check", "Error Saving", MessageBoxButtons.OK, MessageBoxIcon.Error);
                                string DeleteDetails = "Delete from tbl_condo_billingdetails where billingRefID=" + GetSySID;
                                dtrans.InsertData(DeleteDetails);
                                isErrorFound = true;
                                break;
                            }
                        }
                    }
                    if (!isErrorFound)
                    {
                        MessageBox.Show("Billing information saved", "Done Saving", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    TransactionTable();
                    dataGridView1.DataSource = dtTransactions;
                }
            }
        }
コード例 #5
0
ファイル: Form1.cs プロジェクト: zenitsuga/Zenitsuga-Systems
 private void Form1_Load(object sender, EventArgs e)
 {
     cv = new clsValidation();
     LoadSettings(false);
     UnmaskPassword = cv.UnMaskPassword();
 }