Ejemplo n.º 1
0
 public Admin()
 {
     appObj        = new Application1();
     cusObj        = new Customer();
     devObj        = new Developer();
     permissionObj = new Permissions();
 }
Ejemplo n.º 2
0
 public CustomerDBLayer()
 {
     cusObj = new Customer();
     appObj = new Application1();
     obj.assign();
     con = obj.con;
 }
Ejemplo n.º 3
0
        public void getApplicationData(String appName)
        {
            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                string        query  = "Select a.*,p.name as 'PName',d.capacity,d.OS from Device d, Application a left join Person p on a.developerID=p.id where a.name='" + appName + "' and a.deviceID=d.id";
                SqlCommand    cmd    = new SqlCommand(query, con);
                SqlDataReader reader = cmd.ExecuteReader();
                decimal       c;
                app = new Application1();
                while (reader.Read())
                {
                    app.setName(reader["name"].ToString());
                    app.setDescription(reader["description"].ToString());
                    app.setVersion(reader["version1"].ToString());
                    app.setCategory(reader["category"].ToString());
                    app.setRating(reader["rating"].ToString());
                    app.setdevName(reader["PName"].ToString());
                    app.setPrice(Convert.ToDecimal(reader["price"].ToString()));
                    app.dev.setOS(reader["OS"].ToString());
                    c = Convert.ToDecimal(reader["capacity"].ToString()) / 1024;
                    app.dev.setCapacity((decimal)System.Math.Round(c, 2));
                }
                reader.Close();

                con.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 4
0
 public Customer()
 {
     device = new Device();
     app    = new Application1();
 }
Ejemplo n.º 5
0
 public Developer()
 {
     app = new Application1();
 }
Ejemplo n.º 6
0
 public ApplicationDBLayer()
 {
     app = new Application1();
     obj.assign();
     con = obj.con;
 }