Ejemplo n.º 1
0
        private void ucFeedMillUser_Loaded(object sender, RoutedEventArgs e)
        {
            if(CONTROLLER==null)
            {
                CONTROLLER = new HCSController();

            }

            FeedMillUser = new feedmilluser() { date=DateTime.Now, isenglishvisible = CONTROLLER.ISENGLISHVISIBLE, isurduvisible = CONTROLLER.ISURDUVISIBLE }; 
            this.grdFeedMillDetail.DataContext = FeedMillUser;
            this.grdUploadImage.DataContext = FeedMillUser;
            this.grdModel.DataContext = FeedMillUser;

            if (CONTROLLER.ISENGLISHVISIBLE)
            {
                dgExistingFeedMill.Columns[1].Visibility = Visibility.Collapsed;
                dgExistingFeedMill.Columns[3].Visibility = Visibility.Collapsed;
                dgExistingFeedMill.Columns[5].Visibility = Visibility.Collapsed;
                dgExistingFeedMill.Columns[7].Visibility = Visibility.Collapsed;
                dgExistingFeedMill.Columns[9].Visibility = Visibility.Collapsed;
                dgExistingFeedMill.Columns[11].Visibility = Visibility.Collapsed;
                dgExistingFeedMill.Columns[13].Visibility = Visibility.Collapsed;
                dgExistingFeedMill.Columns[15].Visibility = Visibility.Collapsed;
            }
            if (CONTROLLER.ISURDUVISIBLE)
            {
                dgExistingFeedMill.Columns[0].Visibility = Visibility.Collapsed;
                dgExistingFeedMill.Columns[2].Visibility = Visibility.Collapsed;
                dgExistingFeedMill.Columns[4].Visibility = Visibility.Collapsed;
                dgExistingFeedMill.Columns[6].Visibility = Visibility.Collapsed;
                dgExistingFeedMill.Columns[8].Visibility = Visibility.Collapsed;
                dgExistingFeedMill.Columns[10].Visibility = Visibility.Collapsed;
                dgExistingFeedMill.Columns[12].Visibility = Visibility.Collapsed;
                dgExistingFeedMill.Columns[14].Visibility = Visibility.Collapsed;
            }






            RefreshUsers();
        }
Ejemplo n.º 2
0
 public void updateFeedMillUser(feedmilluser FeedMillUser)
 {
     var entry = dbContext.Entry<feedmilluser>(FeedMillUser);
     if (entry.State.Equals(EntityState.Detached))
     {
         dbContext.feedmillusers.Attach(FeedMillUser);
     }
     entry.State = EntityState.Modified;
 }
Ejemplo n.º 3
0
        //updateCompanyUser


        public void saveFeedMillUser(feedmilluser FeedMillUser)
        {
            dbContext.feedmillusers.Add(FeedMillUser);
            dbContext.SaveChanges();
            FEEDMILLUSERS.Add(FeedMillUser);

        }
Ejemplo n.º 4
0
        private void resetAfterSave()
        {

            FeedMillUser = new feedmilluser() { date = DateTime.Now, isenglishvisible = CONTROLLER.ISENGLISHVISIBLE, isurduvisible = CONTROLLER.ISURDUVISIBLE };
            feedmillImageUpload.Source = new BitmapImage();
            this.grdFeedMillDetail.DataContext = FeedMillUser;

        }
Ejemplo n.º 5
0
 private void EditRecord_Click(object sender, RoutedEventArgs e)
 {
     feedmilluser obj = ((FrameworkElement)sender).DataContext as feedmilluser;
     obj.isenglishvisible = CONTROLLER.ISENGLISHVISIBLE;
     obj.isurduvisible = CONTROLLER.ISURDUVISIBLE;
     FeedMillUser = obj;
     loadImage();
     this.grdFeedMillDetail.DataContext = FeedMillUser;
 }