Exemple #1
0
        public void InsertLocation(Model.Location oData)
        {
            try
            {
                scb.ConnectionString = sConnectionString;
                ddq = new DatabaseQuery.DBQuery();
                ddq.ConnectionString = scb.ConnectionString;

                ddq.CommandText = "INSERT INTO TBL_LOCATION (LOCATION,STATUS) VALUES ('" + oData.LOCATION + "','" + oData.STATUS + "')";
                ddq.ExecuteNonQuery(CommandType.Text);
            }
            catch (Exception ex)
            {
            }
        }
Exemple #2
0
        public void UpdateCategory(Model.Location oData)
        {
            try
            {
                scb.ConnectionString = sConnectionString;
                ddq = new DatabaseQuery.DBQuery();
                ddq.ConnectionString = scb.ConnectionString;

                ddq.CommandText = "UPDATE TBL_LOCATION SET LOCATION = '" + oData.LOCATION + "', STATUS = '" + oData.STATUS + "' WHERE [ID] = '" + oData.LOCATION_ID + "'";
                ddq.ExecuteNonQuery(CommandType.Text);
            }
            catch (Exception ex)
            {
            }
        }
Exemple #3
0
        public Boolean isRecordExists(Model.Location oData)
        {
            try
            {
                scb.ConnectionString = sConnectionString;
                ddq = new DatabaseQuery.DBQuery();
                ddq.ConnectionString = scb.ConnectionString;

                string sQuery = "";


                sQuery = "SELECT * FROM TBL_LOCATION WHERE LOCATION = '" + oData.LOCATION + "'";

                ddq.CommandText = sQuery;
                ds = ddq.GetDataset(CommandType.Text);

                return(ds.Tables[0].Rows.Count > 0 ? true : false);
            }
            catch (Exception ex)
            {
                return(true);
            }
        }