Ejemplo n.º 1
0
        private bool validatedata()
        {
            CCommonBO comBo = new CCommonBO();
            string    sql   = "Select * From t_Catg Where Catg_Code='" + txtCode.Text.Trim() + "'";

            if (comBo.IsExistCode(sql))
            {
                MessageBox.Show("Item Group Code Already Exist!!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtCode.Text = "";
                txtCode.Focus();
                return(false);
            }
            if (txtCode.Text == "")
            {
                MessageBox.Show("Please Give Group Code", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtCode.Focus();
                return(false);
            }

            if (txtCode.Text.Length != 4)
            {
                MessageBox.Show("Please Enter Four Char in Group Code", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtCode.Focus();
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
 private void btnBackup_Click(object sender, EventArgs e)
 {
     if (CheckData())
     {
         CCommonBO oCommon = new CCommonBO();
         string    loc     = txtLocation.Text.Trim() + "\\" + DateTime.Now.Ticks + "" + txtFileName.Text.Trim();
         if (oCommon.Backupdb(loc))
         {
             MessageBox.Show("BackUp Data Base successfully!!");
             txtLocation.Text = "";
             txtFileName.Text = "";
         }
     }
 }
Ejemplo n.º 3
0
        private void GetGRNextCode()
        {
            CResult   oResult   = new CResult();
            CCommonBO oCommonBO = new CCommonBO();

            oResult = oCommonBO.ReadLastCodeNo("GRMstr_Code", "GRMstr", currentBranch.CompBrn_Code);
            if (oResult.IsSuccess)
            {
                txtGRNo.Text = oResult.Data.ToString();
            }
            else
            {
                MessageBox.Show("Loading error...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 4
0
        private string GetGRmstrCode()
        {
            CResult   oResult    = new CResult();
            CCommonBO oCommonBO  = new CCommonBO();
            string    grmstrCode = null;

            oResult = oCommonBO.ReadLastCodeNo("GRMstr_Code", "GRMstr", currentBranch.CompBrn_Code);
            if (oResult.IsSuccess)
            {
                grmstrCode = oResult.Data.ToString();
            }
            else
            {
                MessageBox.Show("Loading error...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(grmstrCode);
        }