예제 #1
0
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            switch (editingStyle) {
            case UITableViewCellEditingStyle.Delete:
                // remove the item from the underlying data source
                this.RaiseLagerObjectDeleted(indexPath.Row);
                tableItems.RemoveAt(indexPath.Row);
                // delete the row from the table
                tableView.DeleteRows (new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);

                break;

            case UITableViewCellEditingStyle.Insert:
                //---- create a new item and add it to our underlying data

                LagerObject obj = new LagerObject();
                obj.Name = "Inserted";
                obj.imageFileName = "second.png";

                tableItems.Insert (indexPath.Row, obj);

                //---- insert a new row in the table
                tableView.InsertRows (new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
                break;

            case UITableViewCellEditingStyle.None:
                Console.WriteLine ("CommitEditingStyle:None called");
                break;
            }
        }
예제 #2
0
        public string GenerateContainerManifest(LagerObject input)
        {
            string ic = translate.getTranslatedText ("Items in this container", "Items in this container");
            string name = translate.getTranslatedText ("Name", "Name");
            string desc = translate.getTranslatedText ("Description", "Description");
            string inn = translate.getTranslatedText ("In", "In");

            StringBuilder sb = new StringBuilder ();
            if (input != null) {
                Lager laggy = dao.GetLagerByID (input.LagerID);
                sb.AppendLine (name + ":" + input.Name + "--" + desc + ":" + input.Description);
                if (laggy != null) {
                    sb.AppendLine (inn + ":" + laggy.Name);
                }

                if (input.isContainer == "true") {
                    sb.AppendLine (ic + ";");
                    IList<Item> items = dao.GetAllItemsInBox (input);
                    foreach (Item itty in items) {
                        sb.AppendLine (itty.toString ());
                    }
                }

            }
            return sb.ToString ();
        }
예제 #3
0
 public string GenerateContainerSubject(LagerObject input)
 {
     string ContainerIndex = translate.getTranslatedText ("Manifest/index for Container");
     StringBuilder sb = new StringBuilder ();
     if (input != null)
         sb.AppendLine (ContainerIndex + ":" + input.Name);
     return sb.ToString ();
 }
예제 #4
0
 public virtual void ShowBigItemDetails(LagerObject item)
 {
     //			if(UserInterfaceIdiomIsPhone){
         BigItemDetailScreen neo = new BigItemDetailScreen (item);
         this.NavigationController.PushViewController (neo, true);
         //this.NavigationController.PushViewController(neo, true);
     //			}else{
     //				RaiseLagerObjectClicked(item);
     //			}
 }
예제 #5
0
 public void AddQRPictureAttachment(MFMailComposeViewController mailContr, LagerObject input)
 {
     if (this.IncludeQr()) {
         if (input != null) {
             UIImage image = AppDelegate.key.MakeQr (input);
             NSData imagedata = image.AsPNG ();
             mailContr.AddAttachmentData (imagedata, "image/png", "QR.png");
         }
     }
 }
예제 #6
0
 public void AddPictureAttachment(MFMailComposeViewController mailContr, LagerObject input)
 {
     var documentsDirectory = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
     if (!string.IsNullOrEmpty (input.imageFileName)) {
         string jpg = input.Name + ".jpg";
         string filename = System.IO.Path.Combine (documentsDirectory, input.imageFileName);
         UIImage image = UIImage.FromFile (filename);
         NSData imagedata = image.AsJPEG ();
         mailContr.AddAttachmentData (imagedata, "image/jpeg", jpg);
     }
 }
예제 #7
0
        public void ShowBoxItemDetails(LagerObject box)
        {
            //			if(UserInterfaceIdiomIsPhone){
                Console.WriteLine ("showBoxItemDetails()");
                boxdetail = new ContainerDetails (box);
                this.NavigationController.PushViewController (boxdetail, true);
            //			}else{
            //				RaiseContainerClicked(box);
            //			}

            if (boxdetail != null) {
                boxdetail.LagerObjectSaved += (object sender, LagerObjectSavedEventArgs e) => PopulateTable ();
            }
        }
예제 #8
0
        public void ShowDetails(LagerObject myObject)
        {
            this.myObject = myObject;
            bidc = new BigItemDetailContent (myObject, this);
            innerScroll = new UIScrollView (UIScreen.MainScreen.Bounds);
            innerScroll.ContentSize = bidc.GetContentsize ();
            innerScroll.AddSubview (bidc.View);
            innerScroll.UserInteractionEnabled = true;
            bidc.ShowDetails (myObject);
            View.AddSubview (innerScroll);

            bidc.BigItemSaved += (object sender, BigItemSavedEventArgs e) => {
                var handler = this.BigItemSaved;
                if(handler != null){
                    handler(sender, e);
                }
            };
        }
예제 #9
0
        public void ShowDetails(LagerObject boks)
        {
            this.boks = boks;
            cdc = new ContainerDetailsContent (boks, this);
            innerview = new UIScrollView (UIScreen.MainScreen.Bounds);
            innerview.ContentSize = cdc.GetContentsize ();
            innerview.AddSubview (cdc.View);
            innerview.UserInteractionEnabled = true;
            cdc.ShowDetails (boks);
            this.View.AddSubview (innerview);

            cdc.LagerObjectSaved += (object sender, LagerObjectSavedEventArgs e) => {
                var handler = this.LagerObjectSaved;
                if(handler != null){
                    handler(this,e);
                }
            };

            //this.CreateEmailBarButton ();
        }
예제 #10
0
 public void StoreActiveGallery(LagerObject lo)
 {
     var store = NSUbiquitousKeyValueStore.DefaultStore;
     store.SetLong ("activeLocation", (long)lo.ID);
     store.SetString ("activeGalleryType", "LagerObject");
     store.Synchronize ();
 }
예제 #11
0
 public UIImage MakeQr(LagerObject lo)
 {
     if (lo != null) {
         var writer = new BarcodeWriter ();
         writer.Format = BarcodeFormat.QR_CODE;
         var result = writer.Write (lo.ID.ToString ());
         return result;
     } else {
         return null;
     }
 }
 public BigItemDetailClickedEventArgs(LagerObject item)
     : base()
 {
     this.lagerobject = item;
 }
예제 #13
0
        void ExtractContainer()
        {
            LagerObject lo = new LagerObject ();
            String recomb = Recombine ();
            lo.Name = recomb;
            lo.Description = recomb;
            lo.type = recomb;

            lo.ImageTagId = tag.ID;
            string[] res = ExtractTagImages (tag);
            lo.thumbFileName = res [1];
            lo.imageFileName = res [0];
            lo.isContainer = "true";
            lo.isLargeObject = "false";
            ContainerDetails cd = new ContainerDetails (lo);
            this.NavigationController.PushViewController (cd, true);
        }
예제 #14
0
 public ContainerDetails(LagerObject boks)
 {
     this.boks = boks;
 }
예제 #15
0
파일: LagerDAO.cs 프로젝트: Skalar/Indexer
        public IList<Item> GetAllItemsInBox(LagerObject boks)
        {
            IList<Item> myList = null;

                myList =   conn.Query<Item> ("select * from Item where boxID = ?", boks.ID);

            return myList;
        }
예제 #16
0
 public GalleryViewController(LagerObject Container)
 {
     ActiveContainer = Container;
     activeSet = true;
     ActiveType = "Container";
 }
예제 #17
0
 public void SetLagerButtonLabel(LagerObject itty)
 {
     StringBuilder sb = new StringBuilder ();
     sb.Append (MonoTouch.Foundation.NSBundle.MainBundle.LocalizedString ("In", "In"));
     sb.Append (":");
     if (itty != null) {
         Lager lager = AppDelegate.dao.GetLagerById (itty.LagerID);
         //				boks.LagerID = lo.ID;
         //				SaveIt ();
         if (lager != null) {
             if (!string.IsNullOrEmpty (lager.Name)) {
                 sb.Append (lager.Name);
             }
         }
     }
     this.btnIn.SetTitle (sb.ToString (), UIControlState.Normal);
 }
예제 #18
0
 void raiseDismissal(LagerObject lo)
 {
     var handler = this.DismissEvent;
     if(handler != null){
         handler(this, new ContainerClickedEventArgs(lo));
     }
 }
예제 #19
0
 public LagerObjectClickedEventArgs(LagerObject lagerobject)
     : base()
 {
     this.LagerObject = lagerobject;
 }
예제 #20
0
파일: LagerDAO.cs 프로젝트: Skalar/Indexer
 void SaveLagerObjectInner(LagerObject myObject)
 {
     LagerObject obj = this.GetLagerObjectByID (myObject.ID);
     if (obj == null) {
         conn.Insert (myObject);
     }
     else {
         conn.Update (myObject);
     }
 }
예제 #21
0
        public void ShowDetails(LagerObject myobj)
        {
            //TODO remember to deselect left table after showing details
            MyCurrentObject = myobj;

            Title = MonoTouch.Foundation.NSBundle.MainBundle.LocalizedString ("Big Items Details", "Big Items Details");
            this.fieldBigName.Placeholder = MonoTouch.Foundation.NSBundle.MainBundle.LocalizedString ("Name", "Name");
            this.fieldBigDescription.Placeholder = MonoTouch.Foundation.NSBundle.MainBundle.LocalizedString ("Description", "Description");
            var count = MonoTouch.Foundation.NSBundle.MainBundle.LocalizedString ("Count", "Count");
            count = count + ":";
            if (myobj != null) {

                this.fieldBigName.Text = myobj.Name;
                this.fieldBigName.Font = UIFont.FromName ("Cochin-BoldItalic", 22f);
                this.fieldBigDescription.Text = myobj.Description;
                this.fieldBigDescription.Font = UIFont.FromName ("AmericanTypewriter", 12f);

                antall.Text = count + MyCurrentObject.antall.ToString ();
            }
            AddTagList ();
            releaseKeyboard ();

            if (MyCurrentObject != null) {
                this.antallStepper.Value = MyCurrentObject.antall;
                this.antallStepper.ValueChanged += (object sender, EventArgs e) => {
                    double ant = this.antallStepper.Value;
                    antall.Text = count + ant;
                    MyCurrentObject.antall = ant;
                    AppDelegate.dao.SaveLagerObject (MyCurrentObject);
                };
                cashValue.Text = MyCurrentObject.cashValue.ToString ();
                cashValue.EditingDidEnd += (object sender, EventArgs e) => {
                    try {
                        double newvalue = double.Parse (cashValue.Text);
                        MyCurrentObject.cashValue = newvalue;
                        AppDelegate.dao.SaveLagerObject (MyCurrentObject);
                        Console.WriteLine("saved cashvalue:"+MyCurrentObject.cashValue);
                    } catch (Exception ex) {
                        Console.WriteLine ("coudlnt parse;" + cashValue.Text + "ex:" + ex.ToString ());
                        cashValue.Text = MyCurrentObject.cashValue.ToString ();
                    }
                };
                if (MyCurrentObject.imageFileName != null) {
                    imp.SetNewImageName (MyCurrentObject.imageFileName);
                }
            }

            currency.Text = MonoTouch.Foundation.NSBundle.MainBundle.LocalizedString ("Currency", "Currency");

            showReceipts.SetTitle (MonoTouch.Foundation.NSBundle.MainBundle.LocalizedString ("Show Receipts", "Show Receipts"), UIControlState.Normal);
            showReceipts.TouchUpInside += (object sender, EventArgs e) => {
                InsurancePhotoController ipc = new InsurancePhotoController(myobj);
                ancestor.NavigationController.PushViewController(ipc,true);
                //PresentViewController(ipc,true, null);
                //nc.PushViewController(ipc,false);
            };
        }
예제 #22
0
 public InsurancePhotoController(LagerObject lagerobject)
 {
     this.currentID = lagerobject.ID;
     this.lagerobject = lagerobject;
     isLargeObject = true;
 }
예제 #23
0
        void InitActiveField()
        {
            RectangleF activeRect = new RectangleF (0, 66, View.Bounds.Width, 40);
            ActiveText = new UILabel (activeRect);
            ActiveText.Font = UIFont.FromName ("Helvetica", 24);
            ActiveText.ShadowColor = UIColor.Gray;
            ActiveText.ShadowOffset = new SizeF (1.0f, 0.2f);
            ActiveText.TextColor = UIColor.Black;
            ActiveText.TextAlignment = UITextAlignment.Center;

            if (!activeSet) {

                activeID = AppDelegate.key.GetActiveGalleryID ();

                if (ActiveType == null) {
                    ActiveType = AppDelegate.key.GetActiveGalleryType ();
                }

                if (ActiveType == null) {
                    ActiveType = "ALL";
                }

                if (ActiveType.Equals ("Lager")) {
                    ActiveContainer = null;
                    ActiveLocation = AppDelegate.dao.GetLagerById (activeID);
                    if (ActiveLocation != null && ActiveLocation.Name != null) {
                        ActiveText.Text = ActiveLocation.Name;
                    }
                }

                if (ActiveType.Equals ("Container")) {
                    ActiveLocation = null;
                    ActiveContainer = AppDelegate.dao.GetContainerById (activeID);
                    ActiveText.Text = ActiveContainer.Name;
                }

                if (ActiveType == "ALL") {
                    ActiveLocation = null;
                    ActiveContainer = null;
                    ActiveText.Text = "ALL";
                }

                View.AddSubview(ActiveText);

            }
        }
예제 #24
0
 protected override void Dispose(bool disposing)
 {
     MyCurrentObject = null;
     sl = null;
     Ic.Dispose ();
     ancestor = null;
     tlc.Dispose ();
     base.Dispose (disposing);
 }
예제 #25
0
파일: LagerDAO.cs 프로젝트: Skalar/Indexer
 public void SaveLagerObject(LagerObject myObject)
 {
     if (limitedSave && getLagerOBjectsCount () > limitedSaves) {
         RaiseLimitExceeded ();
     } else {
         SaveLagerObjectInner (myObject);
     }
 }
예제 #26
0
 public BigItemDetailContent(LagerObject myObject,UIViewController ancestor)
 {
     this.ancestor = ancestor;
     this.MyCurrentObject = myObject;
 }
예제 #27
0
파일: LagerDAO.cs 프로젝트: Skalar/Indexer
 public void DeleteBox(int id)
 {
     LagerObject deleteme = new LagerObject ();
         deleteme.ID = id;
         conn.Delete (deleteme);
 }
예제 #28
0
 public ContainerClickedEventArgs(LagerObject container)
     : base()
 {
     this.container = container;
 }
예제 #29
0
        void ExtractLarge()
        {
            LagerObject lo = new LagerObject ();

            String recomb = Recombine ();
            lo.Name = recomb;
            lo.Description = recomb;

            lo.ImageTagId = tag.ID;
            string[] res = ExtractTagImages (tag);
            lo.thumbFileName = res [1];
            lo.imageFileName = res [0];
            lo.isContainer = "false";
            lo.isLargeObject = "true";
            BigItemDetailScreen bids = new BigItemDetailScreen (lo);
            this.NavigationController.PushViewController (bids, true);
        }
예제 #30
0
 public void WillBeginTableEditing(UITableView tableView)
 {
     tableView.BeginUpdates ();
     // insert the 'ADD NEW' row at the end of table display
     tableView.InsertRows (new NSIndexPath[] {
         NSIndexPath.FromRowSection (tableView.NumberOfRowsInSection (0), 0)
     }, UITableViewRowAnimation.Fade);
     // create a new item and add it to our underlying data (it is not intended to be permanent)
     LagerObject o = new LagerObject ();
     o.Name = "(add new)";
     //			o.imageFileNames = new List<string> ();
     o.imageFileName = "first.png";
     tableItems.Add (o);
     tableView.EndUpdates (); // applies the changes
 }