Ejemplo n.º 1
0
        public void AddTest()
        {
            Fabricante item = new Fabricante()
            {
                Nome = "Fabricante01"
            };
            IProducerRepository target = new ProducerRepository();

            target.Add(item);

            try
            {
                // use session to try to load the product
                using (ISession session = NHibernateHelper.OpenSession())
                {
                    var fromDb = session.Get <Fabricante>(item.Id);

                    Assert.IsNotNull(fromDb);
                    Assert.AreNotSame(item, fromDb);
                    Assert.AreEqual(item.Nome, fromDb.Nome);
                }
            }
            finally
            {
                target.Remove(item);
            }
        }
Ejemplo n.º 2
0
        public async Task GetNotificationProducerByIdChecksAuthorization()
        {
            var notification = NotificationApplicationFactory.Create(userId, NotificationType.Recovery,
                                                                     UKCompetentAuthority.England, 20181);

            context.NotificationApplications.Add(notification);
            context.SaveChanges();

            var notificationId = notification.Id;

            var producerCollection = new ProducerCollection(notificationId);

            producerCollection.AddProducer(ObjectFactory.CreateEmptyProducerBusiness(),
                                           ObjectFactory.CreateDefaultAddress(), ObjectFactory.CreateEmptyContact());

            context.Producers.Add(producerCollection);
            context.SaveChanges();

            var repository = new ProducerRepository(context,
                                                    notificationApplicationAuthorization);

            await repository.GetByNotificationId(notificationId);

            A.CallTo(() => notificationApplicationAuthorization.EnsureAccessAsync(notificationId)).MustHaveHappened();

            context.DeleteOnCommit(producerCollection);
            await context.SaveChangesAsync();

            context.DeleteOnCommit(notification);
            await context.SaveChangesAsync();
        }
        public void GetAllTest()
        {
            //Arrange
            var producers = new List <Producer>
            {
                new Producer {
                    Id = 1,
                },
                new Producer {
                    Id = 2
                },
                new Producer {
                    Id = 3
                },
            };

            using (var context = new AppDbContext(options))
            {
                var repo = new ProducerRepository(context);

                //Act
                foreach (var producer in producers)
                {
                    context.Producers.Add(producer);
                }
                var result = repo.GetAll();

                //Assert
                Assert.AreEqual(context.Orders, result);
            }
        }
Ejemplo n.º 4
0
 private void InitializeRepositories()
 {
     ProducerRepository      = new ProducerRepository(_context);
     KnifeRepository         = new KnifeRepository(_context);
     CheckRepository         = new CheckRepository(_context);
     KnifeCategoryRepository = new KnifeCategoryRepository(_context);
     UserRepository          = new UserRepository(_context);
     SellRepository          = new SellRepository(_context);
 }
Ejemplo n.º 5
0
        public void GetByIdTest()
        {
            IProducerRepository target = new ProducerRepository();
            var fromDb = target.GetById(item.Id);

            Assert.IsNotNull(fromDb);
            Assert.AreNotSame(item, fromDb);
            Assert.AreEqual(item.Nome, fromDb.Nome);
        }
Ejemplo n.º 6
0
        public static void MyClassInitialize(TestContext testContext)
        {
            item = new Fabricante()
            {
                Nome = "Fabricante01"
            };
            IProducerRepository target = new ProducerRepository();

            target.Add(item);
        }
Ejemplo n.º 7
0
        public UnitOfWork(CinemaContext context)
        {
            _context = context;

            Actors          = new ActorRepository(_context);
            CinemaOwners    = new CinemaOwnerRepository(_context);
            Cinemas         = new CinemaRepository(_context);
            CinemaScreens   = new CinemaScreenRepository(_context);
            MovieCategories = new MovieCategoryRepository(_context);
            Movies          = new MovieRepository(_context);
            Producers       = new ProducerRepository(_context);
            ShowTimes       = new ShowTimeRepository(_context);
        }
Ejemplo n.º 8
0
 protected virtual void Dispose(bool disposing)
 {
     if (!_isDisposed)
     {
         if (disposing)
         {
             ProducerRepository.Dispose();
             KnifeRepository.Dispose();
             CheckRepository.Dispose();
             SellRepository.Dispose();
             KnifeCategoryRepository.Dispose();
         }
         _isDisposed = true;
     }
 }
Ejemplo n.º 9
0
        public void UpdateTest()
        {
            IProducerRepository target = new ProducerRepository();

            item.Nome = "Fabricante02";
            target.Update(item);

            // use session to try to load the product
            using (ISession session = NHibernateHelper.OpenSession())
            {
                var fromDb = session.Get <Fabricante>(item.Id);

                Assert.IsNotNull(fromDb);
                Assert.AreNotSame(item, fromDb);
                Assert.AreEqual(item.Nome, fromDb.Nome);
            }
        }
Ejemplo n.º 10
0
    protected void btncheck_Click(object sender, EventArgs e)
    {
        if (rbtnunpaid.Checked)
        {
            GridDataBind();
            Response.Redirect("~/TotalAmount.aspx?DataRecord=" + datarecord + "&TotalSongCount=" + totalsongcount + "&TotalAmount=" + totalamount + "&CustomerID=" + customerid + "&rolename=" + rolename + "&FullName=" + Request.QueryString["FullName"].ToString());
        }
        else
        {
            userid   = Guid.Parse(Session["userid"].ToString());
            rolename = userprofilerep.SelectRolesByUser(userid);
            if (rolename == "Producer")
            {
                ProducerRepository producerrep = new ProducerRepository();
                Producer           tblproducer = producerrep.GetProducerByUserID(userid);
                customerid = tblproducer.ProducerID;
            }
            else if (rolename == "Composer")
            {
                ComposerRepository composerrep = new ComposerRepository();
                Composer           tblcomposer = composerrep.GetComposerByUserID(userid);
                customerid = tblcomposer.ComposerID;
            }
            else if (rolename == "Artist")
            {
                ArtistRepository artistrep = new ArtistRepository();
                Artist           tblartist = artistrep.GetArtistByUserID(userid);
                customerid = tblartist.ArtistID;
            }

            else if (rolename == "Band")
            {
                BandRepository bandrep = new BandRepository();
                Band           tblband = bandrep.GetBandByUserID(userid);
                customerid = tblband.BandID;
            }
            else if (rolename == "Studio")
            {
                StudioRepository studiorep = new StudioRepository();
                Studio           tblstudio = studiorep.GetStudioByUserID(userid);
                customerid = tblstudio.StudioID;
            }
            Response.Redirect("~/PaidTotal.aspx?CustomerID=" + customerid + "&FullName=" + Request.QueryString["FullName"].ToString());
        }
    }
        public async Task CreateTest()
        {
            //Arrange
            var producer = new Producer {
                Id = 1
            };

            using (var context = new AppDbContext(options))
            {
                var repo = new ProducerRepository(context);

                //Act
                await repo.Create(producer);

                var expectedResult = 1;
                //Assert
                Assert.AreEqual(expectedResult, context.Producers.Local.Count());
            }
        }
        public void UpdateTest()
        {
            //Arrange
            using (var context = new AppDbContext(options))
            {
                var producer = new Producer {
                    Id = 1
                };
                var repo = new ProducerRepository(context);

                //Act
                repo.Update(producer);
                var expectedResult = EntityState.Modified;
                var actualResult   = context.Entry(producer).State;

                //Assert
                Assert.AreEqual(expectedResult, actualResult);
            }
        }
        public async Task GetTest()
        {
            //Arrange
            using (var context = new AppDbContext(options))
            {
                var producer = new Producer {
                    Id = 1
                };
                var repo = new ProducerRepository(context);

                //Act
                var expectedResult = producer;
                context.Producers.Add(producer);
                var result = await repo.Get(producer.Id);

                //Assert
                Assert.AreEqual(expectedResult, result);
            }
        }
 public UnitOfWork(ApplicationDbContext context)
 {
     this._context         = context;
     Categories            = new CategoryRepository(_context);
     Producers             = new ProducerRepository(_context);
     Roles                 = new RoleRepository(_context);
     Accounts              = new AccountRepository(_context);
     AvatarOfProducts      = new AvatarOfProductRepository(_context);
     Carts                 = new CartRepository(_context);
     Comments              = new CommentRepository(_context);
     Customers             = new CustomerRepository(_context);
     Invoices              = new InvoiceRepository(_context);
     Orders                = new OrderRepository(_context);
     Products              = new ProductRepository(_context);
     ProductsOfOrders      = new ProductsOfOrderRepository(_context);
     ProductSpecifications = new ProductSpecificationRepository(_context);
     SpecificationValues   = new SpecificationValueRepository(_context);
     StarRatings           = new StarRatingRepository(_context);
     Sellers               = new SellerRepository(_context);
 }
        public async Task DeleteTest()
        {
            //Arrange
            var producer = new Producer {
                Id = 1
            };

            using (var context = new AppDbContext(options))
            {
                var repo = new ProducerRepository(context);

                //Act
                var expectedResult = 0;
                context.Producers.Add(producer);
                var countAfterAdding = context.Producers.Local.Count();
                await repo.Delete(producer.Id);

                //Assert
                Assert.AreEqual(expectedResult, context.Producers.Local.Count());
                Assert.AreEqual(1, countAfterAdding);
            }
        }
Ejemplo n.º 16
0
 public ProducerBusiness()
 {
     _producerRepository = new ProducerRepository();
 }
Ejemplo n.º 17
0
 public ProducerBusiness(ProducerRepository producerRepository)
 {
     _producerRepository = producerRepository;
 }
Ejemplo n.º 18
0
 public ProducersController()
 {
     _producerRepository = new ProducerRepository();
 }
Ejemplo n.º 19
0
    private void GridDataBind()
    {
        try
        {
            userid   = Guid.Parse(Session["userid"].ToString());
            rolename = userprofilerep.SelectRolesByUser(userid);


            if (rolename == "Producer")
            {
                ProducerRepository producerrep = new ProducerRepository();
                Producer           tblproducer = producerrep.GetProducerByUserID(userid);
                customerid = tblproducer.ProducerID;
            }
            else if (rolename == "Composer")
            {
                ComposerRepository composerrep = new ComposerRepository();
                Composer           tblcomposer = composerrep.GetComposerByUserID(userid);
                customerid = tblcomposer.ComposerID;
            }
            else if (rolename == "Artist")
            {
                ArtistRepository artistrep = new ArtistRepository();
                Artist           tblartist = artistrep.GetArtistByUserID(userid);
                customerid = tblartist.ArtistID;
            }

            else if (rolename == "Band")
            {
                BandRepository bandrep = new BandRepository();
                Band           tblband = bandrep.GetBandByUserID(userid);
                customerid = tblband.BandID;
            }
            else if (rolename == "Studio")
            {
                StudioRepository studiorep = new StudioRepository();
                Studio           tblstudio = studiorep.GetStudioByUserID(userid);
                customerid = tblstudio.StudioID;
            }
            List <CheckAmt> lstcheck = fvoucherrep.listChkamt(customerid);//UnPaid
            if (lstcheck.Count > 0)
            {
                foreach (CheckAmt chkamt in lstcheck)
                {
                    amt       = amt + chkamt.Amount;
                    kyat      = amt.ToString();
                    record    = record + Convert.ToInt32(chkamt.Datarecord);
                    songcount = songcount + Convert.ToInt32(chkamt.Totalsongcount);
                }
                datarecord     = record.ToString();
                totalsongcount = songcount.ToString();
                totalamount   += decimal.Round(Convert.ToDecimal(kyat), 2) + "&nbsp;Kyats";
            }
            else
            {
                datarecord     = "-";
                totalsongcount = "-";
                totalamount    = "-";
            }
        }
        catch (Exception ex)
        {
            ex.Message.ToString();
        }
    }
Ejemplo n.º 20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string userid = Request.QueryString["userid"].ToString();
            string role   = Request.QueryString["RoleName"].ToString();
            lblUserName.Text = "Welcome! " + Request.QueryString["FullName"].ToString();
            lblRole.Text     = "Summary Report ";

            if (userid != null)
            {
                if (role == "Artist")
                {
                    Artist art = new ArtistRepository().selectbyUserID(Guid.Parse(userid));
                    if (art != null)
                    {
                        List <TotalResult> lstvoucherUn = vourep.GetSummaryAmountListsByCustomeridUnPaid(art.ArtistID).ToList();

                        if (lstvoucherUn.Count == 0)
                        {
                            amountUn         = 0;
                            lblAmountUn.Text = "0" + " Ks";
                        }
                        foreach (TotalResult t in lstvoucherUn)
                        {
                            amountUn         = Convert.ToInt64(t.Amount);
                            lblAmountUn.Text = amountUn.ToString("#,##") + " Ks";
                        }
                        List <TotalResult> lstvoucherP = vourep.GetSummaryAmountListsByCustomeridPaid(art.ArtistID).ToList();
                        if (lstvoucherP.Count == 0)
                        {
                            amountP         = 0;
                            lblAmountP.Text = "0" + " Ks";
                        }
                        foreach (TotalResult t in lstvoucherP)
                        {
                            amountP         = Convert.ToInt64(t.Amount);
                            lblAmountP.Text = amountP.ToString("#,##") + " Ks";
                        }
                        Total = amountUn + amountP;
                        if (Total == 0)
                        {
                            lblTotalAmount.Text = "0" + " Ks";
                        }
                        else
                        {
                            lblTotalAmount.Text = Total.ToString("#,##") + " Ks";
                        }
                    }


                    else
                    {
                        PanelError.Visible  = true;
                        PanelAmount.Visible = false;
                        lblMessage.Text     = "Please Check  UserID ! " + " လူႀကီးမင္​း၏  account ကိုျပန္​လည္​စစ္​​ေဆး​ေပးရန္​ Legacy Music Network သို႔ ျပန္​လည္​ဆက္​သြယ္​​ေပးပါ ";
                    }
                }
                if (role == "Composer")
                {
                    Composer comp = new ComposerRepository().selectbyUserID(Guid.Parse(userid));
                    if (comp != null)
                    {
                        List <TotalResult> lstvoucherUn = vourep.GetSummaryAmountListsByCustomeridUnPaid(comp.ComposerID).ToList();
                        if (lstvoucherUn.Count == 0)
                        {
                            amountUn         = 0;
                            lblAmountUn.Text = "0" + " Ks";
                        }
                        foreach (TotalResult t in lstvoucherUn)
                        {
                            amountUn         = Convert.ToInt64(t.Amount);
                            lblAmountUn.Text = amountUn.ToString("#,##") + " Ks";
                        }
                        List <TotalResult> lstvoucherP = vourep.GetSummaryAmountListsByCustomeridPaid(comp.ComposerID).ToList();
                        if (lstvoucherP.Count == 0)
                        {
                            amountP         = 0;
                            lblAmountP.Text = "0" + " Ks";
                        }
                        foreach (TotalResult t in lstvoucherP)
                        {
                            amountP         = Convert.ToInt64(t.Amount);
                            lblAmountP.Text = amountP.ToString("#,##") + " Ks";
                        }
                        Total = amountUn + amountP;
                        if (Total == 0)
                        {
                            lblTotalAmount.Text = "0" + " Ks";
                        }
                        else
                        {
                            lblTotalAmount.Text = Total.ToString("#,##") + " Ks";
                        }
                    }
                    else
                    {
                        PanelError.Visible  = true;
                        PanelAmount.Visible = false;
                        lblMessage.Text     = "Please Check  UserID ! " + " လူႀကီးမင္​း၏  account ကိုျပန္​လည္​စစ္​​ေဆး​ေပးရန္​ Legacy Music Network သို႔ ျပန္​လည္​ဆက္​သြယ္​​ေပးပါ ";
                    }
                }
                if (role == "Producer")
                {
                    Producer pro = new ProducerRepository().selectbyUserID(Guid.Parse(userid));
                    if (pro != null)
                    {
                        List <TotalResult> lstvoucherUn = vourep.GetSummaryAmountListsByCustomeridUnPaid(pro.ProducerID).ToList();
                        if (lstvoucherUn.Count == 0)
                        {
                            amountUn         = 0;
                            lblAmountUn.Text = "0" + " Ks";
                        }
                        foreach (TotalResult t in lstvoucherUn)
                        {
                            amountUn         = Convert.ToInt64(t.Amount);
                            lblAmountUn.Text = amountUn.ToString("#,##") + " Ks";
                        }
                        List <TotalResult> lstvoucherP = vourep.GetSummaryAmountListsByCustomeridPaid(pro.ProducerID).ToList();
                        if (lstvoucherP.Count == 0)
                        {
                            amountP         = 0;
                            lblAmountP.Text = "0" + " Ks";
                        }
                        foreach (TotalResult t in lstvoucherP)
                        {
                            amountP         = Convert.ToInt64(t.Amount);
                            lblAmountP.Text = amountP.ToString("#,##") + " Ks";
                        }
                        Total = amountUn + amountP;
                        if (Total == 0)
                        {
                            lblTotalAmount.Text = "0" + " Ks";
                        }
                        else
                        {
                            lblTotalAmount.Text = Total.ToString("#,##") + " Ks";
                        }
                    }
                    else
                    {
                        PanelError.Visible  = true;
                        PanelAmount.Visible = false;
                        lblMessage.Text     = "Please Check  UserID ! " + " လူႀကီးမင္​း၏  account ကိုျပန္​လည္​စစ္​​ေဆး​ေပးရန္​ Legacy Music Network သို႔ ျပန္​လည္​ဆက္​သြယ္​​ေပးပါ ";
                    }
                }
                if (role == "Studio")
                {
                    Studio stu = new StudioRepository().selectbyUserID(Guid.Parse(userid));
                    if (stu != null)
                    {
                        List <TotalResult> lstvoucherUn = vourep.GetSummaryAmountListsByCustomeridUnPaid(stu.StudioID).ToList();
                        if (lstvoucherUn.Count == 0)
                        {
                            amountUn         = 0;
                            lblAmountUn.Text = "0" + " Ks";
                        }
                        foreach (TotalResult t in lstvoucherUn)
                        {
                            amountUn         = Convert.ToInt64(t.Amount);
                            lblAmountUn.Text = amountUn.ToString("#,##") + " Ks";
                        }
                        List <TotalResult> lstvoucherP = vourep.GetSummaryAmountListsByCustomeridPaid(stu.StudioID).ToList();
                        if (lstvoucherP.Count == 0)
                        {
                            amountP         = 0;
                            lblAmountP.Text = "0" + " Ks";
                        }
                        foreach (TotalResult t in lstvoucherP)
                        {
                            amountP         = Convert.ToInt64(t.Amount);
                            lblAmountP.Text = amountP.ToString("#,##") + " Ks";
                        }
                        Total = amountUn + amountP;
                        if (Total == 0)
                        {
                            lblTotalAmount.Text = "0" + " Ks";
                        }
                        else
                        {
                            lblTotalAmount.Text = Total.ToString("#,##") + " Ks";
                        }
                    }
                    else
                    {
                        PanelError.Visible  = true;
                        PanelAmount.Visible = false;
                        lblMessage.Text     = "Please Check  UserID ! " + " လူႀကီးမင္​း၏  account ကိုျပန္​လည္​စစ္​​ေဆး​ေပးရန္​ Legacy Music Network သို႔ ျပန္​လည္​ဆက္​သြယ္​​ေပးပါ ";
                    }
                }
                if (role == "Band")
                {
                    Band band = new BandRepository().selectbyUserID(Guid.Parse(userid));
                    if (band != null)
                    {
                        List <TotalResult> lstvoucherUn = vourep.GetSummaryAmountListsByCustomeridUnPaid(band.BandID).ToList();
                        if (lstvoucherUn.Count == 0)
                        {
                            amountUn         = 0;
                            lblAmountUn.Text = "0" + " Ks";
                        }
                        foreach (TotalResult t in lstvoucherUn)
                        {
                            amountUn         = Convert.ToInt64(t.Amount);
                            lblAmountUn.Text = amountUn.ToString("#,##") + " Ks";
                        }
                        List <TotalResult> lstvoucherP = vourep.GetSummaryAmountListsByCustomeridPaid(band.BandID).ToList();
                        if (lstvoucherP.Count == 0)
                        {
                            amountP         = 0;
                            lblAmountP.Text = "0" + " Ks";
                        }
                        foreach (TotalResult t in lstvoucherP)
                        {
                            amountP         = Convert.ToInt64(t.Amount);
                            lblAmountP.Text = amountP.ToString("#,##") + " Ks";
                        }

                        Total = amountUn + amountP;
                        if (Total == 0)
                        {
                            lblTotalAmount.Text = "0" + " Ks";
                        }
                        else
                        {
                            lblTotalAmount.Text = Total.ToString("#,##") + " Ks";
                        }
                    }
                    else
                    {
                        PanelError.Visible  = true;
                        PanelAmount.Visible = false;
                        lblMessage.Text     = "Please Check  UserID ! " + " လူႀကီးမင္​း၏  account ကိုျပန္​လည္​စစ္​​ေဆး​ေပးရန္​ Legacy Music Network သို႔ ျပန္​လည္​ဆက္​သြယ္​​ေပးပါ ";
                    }
                }
            }
            else
            {
                PanelError.Visible  = true;
                PanelAmount.Visible = false;
                lblMessage.Text     = "Please Check  UserID ! " + " လူႀကီးမင္​း၏  account ကိုျပန္​လည္​စစ္​​ေဆး​ေပးရန္​ Legacy Music Network သို႔ ျပန္​လည္​ဆက္​သြယ္​​ေပးပါ ";
            }
        }
    }
Ejemplo n.º 21
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        username = Request.QueryString["FullName"].ToString();
        aspnet_User user1 = userrepo.selectByUserName(username);

        if (rbtnArtist.Checked)
        {
            aspnet_User user      = userrepo.selectByUserName(username + "a");
            Artist      tblartist = new ArtistRepository().selectbyUserID(user1.UserId);

            if (user != null)
            {
                username            = user.UserName;
                userID              = user.UserId;
                Session["userid"]   = userID;
                Session["UserName"] = username;
                Session["RoleName"] = "Artist";
                Response.Redirect("~/SummaryReport.aspx?FullName=" + Request.QueryString["FullName"].ToString() + "&userid=" + userID + "&RoleName=" + "Artist");
                Session.Clear();
            }
            else if (tblartist != null)
            {
                Session["userid"]   = user1.UserId;
                Session["UserName"] = user1.UserName;
                Session["RoleName"] = "Artist";
                Response.Redirect("~/SummaryReport.aspx?FullName=" + Request.QueryString["FullName"].ToString() + "&userid=" + user1.UserId + "&RoleName=" + "Artist");
                Session.Clear();
            }
            else
            {
                lblMessage.Text = username + " doesn't have artist layer ";
            }
        }

        if (rbtnComposer.Checked)
        {
            aspnet_User user        = userrepo.selectByUserName(username + "c");
            Composer    tblcomposer = new ComposerRepository().selectbyUserID(user1.UserId);

            if (user != null)
            {
                username            = user.UserName;
                userID              = user.UserId;
                Session["userid"]   = userID;
                Session["UserName"] = username;
                Session["RoleName"] = "Composer";
                Response.Redirect("~/SummaryReport.aspx?FullName=" + Request.QueryString["FullName"].ToString() + "&userid=" + userID + "&RoleName=" + "Composer");
                Session.Clear();
            }
            else if (tblcomposer != null)
            {
                Session["userid"]   = user1.UserId;
                Session["UserName"] = user1.UserName;
                Session["RoleName"] = "Composer";
                Response.Redirect("~/SummaryReport.aspx?FullName=" + Request.QueryString["FullName"].ToString() + "&userid=" + user1.UserId + "&RoleName=" + "Composer");
                Session.Clear();
            }
            else
            {
                lblMessage.Text = username + " doesn't have  composer layer ";
            }
        }

        if (rbtnProducer.Checked)
        {
            aspnet_User user        = userrepo.selectByUserName(username + "p");
            Producer    tblproducer = new ProducerRepository().selectbyUserID(user1.UserId);

            if (user != null)
            {
                username            = user.UserName;
                userID              = user.UserId;
                Session["userid"]   = userID;
                Session["UserName"] = username;
                Session["RoleName"] = "Producer";
                Response.Redirect("~/SummaryReport.aspx?FullName=" + Request.QueryString["FullName"].ToString() + "&userid=" + userID + "&RoleName=" + "Producer");
                Session.Clear();
            }
            else if (tblproducer != null)
            {
                Session["userid"]   = user1.UserId;
                Session["UserName"] = user1.UserName;
                Session["RoleName"] = "Producer";
                Response.Redirect("~/SummaryReport.aspx?FullName=" + Request.QueryString["FullName"].ToString() + "&userid=" + user1.UserId + "&RoleName=" + "Producer");
                Session.Clear();
            }

            else
            {
                lblMessage.Text = username + " doesn't have producer layer ";
            }
        }
        if (rbtnBand.Checked)
        {
            aspnet_User user    = userrepo.selectByUserName(username + "b");
            Band        tblband = new BandRepository().selectbyUserID(user1.UserId);

            if (user != null)
            {
                username            = user.UserName;
                userID              = user.UserId;
                Session["userid"]   = userID;
                Session["UserName"] = username;
                Session["RoleName"] = "Band";
                Response.Redirect("~/SummaryReport.aspx?FullName=" + Request.QueryString["FullName"].ToString() + "&userid=" + userID + "&RoleName=" + "Band");
                Session.Clear();
            }
            else if (tblband != null)
            {
                Session["userid"]   = user1.UserId;
                Session["UserName"] = user1.UserName;
                Session["RoleName"] = "Band";
                Response.Redirect("~/SummaryReport.aspx?FullName=" + Request.QueryString["FullName"].ToString() + "&userid=" + user1.UserId + "&RoleName=" + "Band");
                Session.Clear();
            }
            else
            {
                lblMessage.Text = username + " doesn't have band layer ";
            }
        }
        if (rbtnStudio.Checked)
        {
            aspnet_User user      = userrepo.selectByUserName(username + "d");
            Studio      tblstudio = new StudioRepository().selectbyUserID(user1.UserId);

            if (user != null)
            {
                username            = user.UserName;
                userID              = user.UserId;
                Session["userid"]   = userID;
                Session["UserName"] = username;
                Session["RoleName"] = "Studio";
                Response.Redirect("~/SummaryReport.aspx?FullName=" + Request.QueryString["FullName"].ToString() + "&userid=" + userID + "&RoleName=" + "Studio");
                Session.Clear();
            }
            else if (tblstudio != null)
            {
                Session["userid"]   = user1.UserId;
                Session["UserName"] = user1.UserName;
                Session["RoleName"] = "Studio";
                Response.Redirect("~/SummaryReport.aspx?FullName=" + Request.QueryString["FullName"].ToString() + "&userid=" + user1.UserId + "&RoleName=" + "Studio");
                Session.Clear();
            }

            else
            {
                lblMessage.Text = username + " doesn't have studio layer ";
            }
        }
        else
        {
            // ImgChoose.Visible = true;
        }
    }
Ejemplo n.º 22
0
 public IMDBservices()
 {
     _movieRepository    = new MovieRepository();
     _actorRepository    = new ActorRepository();
     _producerRepository = new ProducerRepository();
 }
 public DeleteProducer(ProducerRepository producerRepository)
 {
     _producerRepository = producerRepository;
 }
Ejemplo n.º 24
0
 public ListProducers(ProducerRepository producerRepository)
 {
     _producerRepository = producerRepository;
 }
Ejemplo n.º 25
0
        public static void MyClassCleanup()
        {
            IProducerRepository target = new ProducerRepository();

            target.Remove(item);
        }
 // Constructor
 private ProducerUseCase()
 {
     repository = ProducerRepository.OpenRepository();
 }
Ejemplo n.º 27
0
 public CreateProducer(ProducerRepository producerRepository)
 {
     _producerRepository = producerRepository;
 }
 public UpdateProducer(ProducerRepository producerRepository)
 {
     _producerRepository = producerRepository;
 }
Ejemplo n.º 29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string userid = Request.QueryString["userid"].ToString();
            string role   = Request.QueryString["RoleName"].ToString();
            lblUserName.Text = "Welcome! " + Request.QueryString["FullName"].ToString();
            IsPaid           = Convert.ToBoolean(Request.QueryString["IsPaid"].ToString());
            Channel          = Request.QueryString["Channel"].ToString();
            if (Channel.StartsWith("MRTV"))
            {
                lblChannelName.Text = "MRTV Entertainment";
            }
            else
            {
                lblChannelName.Text = Channel;
            }

            if (role == "Artist")
            {
                Artist art = new ArtistRepository().selectbyUserID(Guid.Parse(userid));
                List <VoucherDetail> lstvoucher = vourep.GetVoucherByCustomerid(art.ArtistID, Channel, IsPaid);
                lblCustomerID.Text = art.ArtistID;
                gvlist.DataSource  = lstvoucher;
                gvlist.DataBind();
                for (int i = 0; i < gvlist.Rows.Count; i++)
                {
                    Label   lblAmount  = (Label)gvlist.Rows[i].FindControl("lblAmount");
                    decimal amounttest = Convert.ToDecimal(lblAmount.Text);
                    Int64   amount     = Convert.ToInt64(amounttest);
                    lblAmount.Text = amount.ToString("#,##") + " Ks";
                    Label lblChannel = (Label)gvlist.Rows[i].FindControl("lblChannel");
                    if (lblChannel.Text.Contains("CRBT"))
                    {
                        lblChannel.Text = "CRBT";
                    }
                    else
                    {
                        lblChannel.Text = "Full Song";
                    }
                }
            }
            if (role == "Composer")
            {
                Composer             comp       = new ComposerRepository().selectbyUserID(Guid.Parse(userid));
                List <VoucherDetail> lstvoucher = vourep.GetVoucherByCustomerid(comp.ComposerID, Channel, IsPaid);
                lblCustomerID.Text = comp.ComposerID;
                gvlist.DataSource  = lstvoucher;
                gvlist.DataBind();
                for (int i = 0; i < gvlist.Rows.Count; i++)
                {
                    Label   lblAmount  = (Label)gvlist.Rows[i].FindControl("lblAmount");
                    decimal amounttest = Convert.ToDecimal(lblAmount.Text);
                    Int64   amount     = Convert.ToInt64(amounttest);
                    lblAmount.Text = amount.ToString("#,##") + " Ks";
                    Label lblChannel = (Label)gvlist.Rows[i].FindControl("lblChannel");
                    if (lblChannel.Text.Contains("CRBT"))
                    {
                        lblChannel.Text = "CRBT";
                    }
                    else
                    {
                        lblChannel.Text = "Full Song";
                    }
                }
            }
            if (role == "Producer")
            {
                Producer             pro        = new ProducerRepository().selectbyUserID(Guid.Parse(userid));
                List <VoucherDetail> lstvoucher = vourep.GetVoucherByCustomerid(pro.ProducerID, Channel, IsPaid);
                lblCustomerID.Text = pro.ProducerID;
                gvlist.DataSource  = lstvoucher;
                gvlist.DataBind();
                for (int i = 0; i < gvlist.Rows.Count; i++)
                {
                    Label   lblAmount  = (Label)gvlist.Rows[i].FindControl("lblAmount");
                    decimal amounttest = Convert.ToDecimal(lblAmount.Text);
                    Int64   amount     = Convert.ToInt64(amounttest);
                    lblAmount.Text = amount.ToString("#,##") + " Ks";
                    Label lblChannel = (Label)gvlist.Rows[i].FindControl("lblChannel");
                    if (lblChannel.Text.Contains("CRBT"))
                    {
                        lblChannel.Text = "CRBT";
                    }
                    else
                    {
                        lblChannel.Text = "Full Song";
                    }
                }
            }

            if (role == "Studio")
            {
                Studio stu = new StudioRepository().selectbyUserID(Guid.Parse(userid));
                List <VoucherDetail> lstvoucher = vourep.GetVoucherByCustomerid(stu.StudioID, Channel, IsPaid);
                lblCustomerID.Text = stu.StudioID;
                gvlist.DataSource  = lstvoucher;
                gvlist.DataBind();
                for (int i = 0; i < gvlist.Rows.Count; i++)
                {
                    Label   lblAmount  = (Label)gvlist.Rows[i].FindControl("lblAmount");
                    decimal amounttest = Convert.ToDecimal(lblAmount.Text);
                    Int64   amount     = Convert.ToInt64(amounttest);
                    lblAmount.Text = amount.ToString("#,##") + " Ks";
                    Label lblChannel = (Label)gvlist.Rows[i].FindControl("lblChannel");
                    if (lblChannel.Text.Contains("CRBT"))
                    {
                        lblChannel.Text = "CRBT";
                    }
                    else
                    {
                        lblChannel.Text = "Full Song";
                    }
                }
            }

            if (role == "Band")
            {
                Band band = new BandRepository().selectbyUserID(Guid.Parse(userid));
                List <VoucherDetail> lstvoucher = vourep.GetVoucherByCustomerid(band.BandID, Channel, IsPaid);
                lblCustomerID.Text = band.BandID;
                gvlist.DataSource  = lstvoucher;
                gvlist.DataBind();
                for (int i = 0; i < gvlist.Rows.Count; i++)
                {
                    Label   lblAmount  = (Label)gvlist.Rows[i].FindControl("lblAmount");
                    decimal amounttest = Convert.ToDecimal(lblAmount.Text);
                    Int64   amount     = Convert.ToInt64(amounttest);
                    lblAmount.Text = amount.ToString("#,##") + " Ks";
                    Label lblChannel = (Label)gvlist.Rows[i].FindControl("lblChannel");
                    if (lblChannel.Text.Contains("CRBT"))
                    {
                        lblChannel.Text = "CRBT";
                    }
                    else
                    {
                        lblChannel.Text = "Full Song";
                    }
                }
            }
        }
    }
Ejemplo n.º 30
0
 public GetProducer(ProducerRepository producerRepository)
 {
     _producerRepository = producerRepository;
 }