Exemple #1
0
        public ClsDestinationData getSingleDestinationData(int destId)
        {
            ClsDestinationData destination = new ClsDestinationData();
            DataTable          dt          = new DataTable();

            try
            {
                string querry = "SELECT * FROM tbl_destinations WHERE destinationId = '" + destId + "';";
                dt = CONN.getDataTable(querry);

                if (dt.Rows.Count > 0)
                {
                    destination._destId    = Convert.ToInt32(dt.Rows[0]["destinationId"]);
                    destination._destName  = dt.Rows[0]["destinationName"].ToString();
                    destination._ownerName = dt.Rows[0]["ownerName"].ToString();
                    destination._address   = dt.Rows[0]["address"].ToString();
                    destination._phoneNo   = dt.Rows[0]["phoneNo"].ToString();
                    destination._mobile    = dt.Rows[0]["mobile"].ToString();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(destination);
        }
Exemple #2
0
        public bool insertData_destination(ClsDestinationData destination)
        {
            bool   isOK   = false;
            string querry = string.Empty;

            try
            {
                querry += @"INSERT INTO tbl_destinations 
                             (destinationId, destinationName, ownerName, address, phoneNo, mobile) VALUES (";
                querry += "'" + destination._destId + "',";
                querry += "'" + destination._destName + "',";
                querry += "'" + destination._ownerName + "',";
                querry += "'" + destination._address + "',";
                querry += "'" + destination._phoneNo + "',";
                querry += "'" + destination._mobile + "'";
                querry += ");";

                isOK = CONN.update(querry);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(isOK);
        }
Exemple #3
0
        public bool updateData_destination(ClsDestinationData destination)
        {
            bool   isOK   = false;
            string querry = string.Empty;

            try
            {
                querry += "UPDATE tbl_destinations SET ";
                querry += "destinationName = '" + destination._destName + "', ";
                querry += "ownerName = '" + destination._ownerName + "', ";
                querry += "address = '" + destination._address + "',";
                querry += "phoneNo ='" + destination._phoneNo + "', ";
                querry += "mobile ='" + destination._mobile + "' ";
                querry += "WHERE destinationId = '" + destination._destId + "'";

                isOK = CONN.update(querry);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(isOK);
        }