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); }
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 = ""; } } }
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); } }
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); }