Ejemplo n.º 1
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     string _sql = "SELECT * FROM tblUnitType WHERE comID = " + Session["trkCompany"].ToString() +
                   " AND typeName = '"+_txtTypeName.Text.ToString()+"';";
     ExecuteSQL haveData = new ExecuteSQL();
     if (!haveData.IsExistData(_sql))
     {
         if (_txtTypeName.Text.Length > 0)
         {
             SaveUnitType();
         }
     }
     else
     {
         _lblMessage.ForeColor = System.Drawing.Color.Red;
         _lblMessage.Text = "Unit type " + _txtTypeName.Text.ToString() + " already exist for this company ";
     }
 }
Ejemplo n.º 2
0
        public static bool isExist(string _SQL)
        {
            bool rc = false;

            ExecuteSQL _execSQL = new ExecuteSQL();
            try
            {
                rc = _execSQL.IsExistData(_SQL);
            }
            catch (Exception ex)
            {
                throw new Exception("Utilities::Utility::"+ex.Message);
            }
            finally
            {
                _execSQL = null;
            }

            return rc;
        }
Ejemplo n.º 3
0
    private bool UnitExist(string uID)
    {
        ExecuteSQL _execute = new ExecuteSQL();

        try
        {

            string _strSQL = "SELECT * FROM tblUnits JOIN tblUnitType" +
                             " ON (tblUnits.typeID = tblUnitType.typeID)" +
                             " WHERE tblUnits.typeID = " + uID +
                             " AND coalesce(tblUnits.isDelete,'0' ) != '1';";
            if (_execute.IsExistData(_strSQL))
                return true;
            else
                return false;

        }
        catch (Exception exp)
        {
            exp.Message.ToString();
            return true;
        }
        finally
        {
            _execute = null;
        }

        return true;
    }
Ejemplo n.º 4
0
    private bool UserExist(string gID)
    {
        ExecuteSQL _execute = new ExecuteSQL();

        try
        {

            string _strSQL = "SELECT * FROM tblUser JOIN tblGroup ON" +
                             " (tblGroup.groupID = tblUser.groupID) WHERE tblGroup.groupID=" + gID +
                             " AND coalesce(tblUser.isDelete,'0' ) != '1';";
            if (_execute.IsExistData(_strSQL))
                return true;
            else
                return false;

        }
        catch (Exception exp)
        {
            exp.Message.ToString();
            return true;
        }
        finally
        {
            _execute = null;
        }

        return true;
    }
Ejemplo n.º 5
0
    private bool isValidData()
    {
        ExecuteSQL _execute=new ExecuteSQL();
        try
        {
            string _comID = Session["trkCompany"].ToString();
            string _strSQL = "SELECT * FROM tblGroup WHERE groupName='" + _txtGroupName.Text +
                             "' AND comID=" + _comID + "";

            if (_txtGroupName.Text == "")
            {
                _lblMessage.Text = "Please Enter Group Name";
                _lblMessage.ForeColor = System.Drawing.Color.Red;
                return false;
            }
            else if (_execute.IsExistData(_strSQL))
            {
                _lblMessage.Text = "Group Name Already Exists.";
                _lblMessage.ForeColor = System.Drawing.Color.Red;
                return false;
            }
        }
        catch (Exception ex)
        {
            ex.Message.ToString();
        }

        finally
        {
            _execute = null;
        }

        return true;
    }
Ejemplo n.º 6
0
    private bool UserExist(string sID)
    {
        ExecuteSQL _execute = new ExecuteSQL();

        try
        {

            string _strSQL = "SELECT * from tblUserWiseScheme WHERE schemeID = " + sID + ";";
            if (_execute.IsExistData(_strSQL))
                return true;
            else
                return false;

        }
        catch (Exception ex)
        {
            ex.Message.ToString();
            return true;
        }
        finally
        {
            _execute = null;
        }

        return true;
    }