예제 #1
0
        public void Commit(Charp.SuccessDelegate success, Charp.ErrorDelegate error)
        {
            object[] parms = {
                personaId,
                entryPrefix.Text,
                entryName.Text,
                entryPaterno.Text,
                entryMaterno.Text,
                radioMale.Active? "MALE" : "FEMALE",
                textNotes.Buffer.Text
            };

            if (isNew ||
                !Util.StrEqNull ((string) parms[1], (string) myData["prefix"])  ||
                !Util.StrEqNull ((string) parms[2], (string) myData["name"])    ||
                !Util.StrEqNull ((string) parms[3], (string) myData["paterno"]) ||
                !Util.StrEqNull ((string) parms[4], (string) myData["materno"]) ||
                !Util.StrEqNull ((string) parms[5], (string) myData["gender"])  ||
                !Util.StrEqNull ((string) parms[6], (string) myData["remarks"])) {

                config.charp.request ("persona_update", parms, new CharpGtk.CharpGtkCtx {
                    asSingle = true,
                    parent = ParentWin,
                    success = delegate (object data, Charp.CharpCtx ctx) {
                        LoadData ((JObject) data);
                        CommitPersonaSuccess (success, error);
                    },
                    error = error
                });
            } else {
                CommitPersonaSuccess (success, error);
            }
        }
예제 #2
0
        public CharpGtkErrorDlg(Charp.CharpError err, Charp.CharpCtx ctx = null)
        {
            Build ();

            string titlestr = (((int)err.sev < 3) ? Catalog.GetString ("Error") : Catalog.GetString ("Warning")) +
                String.Format (Catalog.GetString (" {0}({1})"), err.key, err.code);
            Title = titlestr;
            labelTitle.Text = titlestr;

            if ((int) err.sev >= 3) {
                imageIcon.Pixbuf = Gdk.Pixbuf.LoadFromResource ("monoCharp.warning.png");
            }

            labelDesc.Text = err.desc;

            StringBuilder b = new StringBuilder (Catalog.GetString ("<i><tt><small>"));
            if (ctx != null) {
                b.AppendFormat (Catalog.GetString ("{0}: "),  GLib.Markup.EscapeText (ctx.reqData ["res"]));
            }
            if (err.statestr != null) {
                b.Append (GLib.Markup.EscapeText (err.statestr));
            }
            if (err.state != "") {
                b.AppendFormat (Catalog.GetString (" ({0})\n"), GLib.Markup.EscapeText (err.state));
            }
            b.AppendFormat (Catalog.GetString ("{0}</small></tt></i>"), GLib.Markup.EscapeText (err.msg));
            labelMsg.UseMarkup = true;
            labelMsg.Markup = b.ToString ();

            labelSev.Text = Charp.getErrSevMsg (err.sev);
        }
예제 #3
0
            public MSConfig(string baseUrl)
            {
                this.baseUrl = baseUrl;
                if (baseUrl != null)
                {
                    baseHash = Charp.GetMD5HexHash(baseUrl);
                }

                appName = CHARP_APP_NAME;
            }
예제 #4
0
        public void Commit(Charp.SuccessDelegate success, Charp.ErrorDelegate error)
        {
            foreach (AddressEditor editor in vboxAddress)
                editor.SetPersonaId (personaId);
            foreach (PhoneEditor editor in vboxPhone)
                editor.SetPersonaId (personaId);
            foreach (EmailEditor editor in vboxEmails)
                editor.SetPersonaId (personaId);

            System.Collections.IEnumerator e = vboxAddress.GetEnumerator ();
            e.Reset ();
            CommitAddresses (e, success, error);
        }
예제 #5
0
파일: AppConfig.cs 프로젝트: pupitetris/imr
        public AppConfig(Charp charp, Radionic radionic)
        {
            this.charp = charp;
            this.radionic = radionic;
            pcache = new PictureCache (charp);

            #if CHARP_WINDOWS
            conf = new CharpGtk.MSConfig (DEFAULT_BASEURL);
            #else
            conf = new CharpGtk.GConfConfig (DEFAULT_BASEURL);
            #endif
            conf.SetApp (APP_NAME);

            account_type = AccountType.UNKNOWN;
        }
예제 #6
0
파일: CHARP.cs 프로젝트: pupitetris/charp
        private static void requestCompleteH(object sender, AsyncCompletedEventArgs status)
        {
            CharpCtx ctx = (CharpCtx)status.UserState;

            ctx.status = status;

            Charp   charp = ctx.charp;
            JObject data  = charp.handleResult(ctx, false);

            if (data != null)
            {
                charp.requestSuccess(data, ctx);
            }

            if (ctx.req_complete != null)
            {
                ctx.req_complete(ctx);
            }
        }
예제 #7
0
        public void Commit(Charp.SuccessDelegate success, Charp.ErrorDelegate error)
        {
            string[] types = { "PERSONAL", "WORK" };
            string[] systems = { "STANDARD", "SKYPE" };

            object[] parms = {
                personaId,
                entryEmail.Text,
                types[comboType.Active],
                systems[comboSystem.Active],
                textRemarks.Buffer.Text
            };

            if (isNew ||
                (string) parms[1] != (string) myData["email"] ||
                (string) parms[2] != (string) myData["type"] ||
                (string) parms[3] != (string) myData["system"] ||
                !Util.StrEqNull ((string) parms[4], (string) myData["remarks"])) {

                string resource;
                if (isNew) {
                    resource = "email_create";
                } else {
                    resource = "email_update";
                    parms = Util.ArrayUnshift (parms, emailId);
                }

                config.charp.request (resource, parms, new CharpGtk.CharpGtkCtx {
                    asSingle = true,
                    parent = ParentWin,
                    success = delegate (object data, Charp.CharpCtx ctx) {
                        LoadData ((JObject) data);
                        success (null, null);
                    },
                    error = error
                });
            } else
                success (null, null);
        }
예제 #8
0
        public void Commit(Charp.SuccessDelegate success, Charp.ErrorDelegate error)
        {
            string[] types = { "HOME", "WORK", "FISCAL" };

            JObject asenta = (JObject) myComboAsenta.ActiveData ();
            int asenta_id = asenta != null? (int) asenta["asenta_id"]: 0;

            object[] parms = {
                personaId,
                asenta_id,
                entryStreet.Text,
                types[comboType.Active]
            };

            if (isNew ||
                (int) parms[1] != (int) myData["asenta_id"] ||
                (string) parms[2] != (string) myData["street"] ||
                (string) parms[3] != (string) myData["ad_type"]) {

                string resource;
                if (isNew) {
                    resource = "address_create";
                } else {
                    resource = "address_update";
                    parms = Util.ArrayUnshift (parms, addressId);
                }

                config.charp.request (resource, parms, new CharpGtk.CharpGtkCtx {
                    asSingle = true,
                    parent = ParentWin,
                    success = delegate (object data, Charp.CharpCtx ctx) {
                        LoadData ((JObject) data);
                        success (null, null);
                    },
                    error = error
                });
            } else
                success (null, null);
        }
예제 #9
0
        public CharpGtkErrorDlg(Charp.CharpError err, Charp.CharpCtx ctx = null)
        {
            Build();

            string titlestr = (((int)err.sev < 3) ? Catalog.GetString("Error") : Catalog.GetString("Warning")) +
                              String.Format(Catalog.GetString(" {0}({1})"), err.key, err.code);

            Title           = titlestr;
            labelTitle.Text = titlestr;

            if ((int)err.sev >= 3)
            {
                imageIcon.Pixbuf = Gdk.Pixbuf.LoadFromResource("monoCharp.warning.png");
                Icon             = Gdk.Pixbuf.LoadFromResource("monoCharp.warning.png");
            }

            labelDesc.Text = err.desc;

            StringBuilder b = new StringBuilder(Catalog.GetString("<i><tt><small>"));

            if (ctx != null)
            {
                b.AppendFormat(Catalog.GetString("{0}: "), GLib.Markup.EscapeText(ctx.reqData ["res"]));
            }
            if (err.statestr != null)
            {
                b.Append(GLib.Markup.EscapeText(err.statestr));
            }
            if (err.state != "")
            {
                b.AppendFormat(Catalog.GetString(" ({0})"), GLib.Markup.EscapeText(err.state));
            }
            b.Append("\n");
            b.AppendFormat(Catalog.GetString("{0}</small></tt></i>"), GLib.Markup.EscapeText(err.msg));
            labelMsg.UseMarkup = true;
            labelMsg.Markup    = b.ToString();

            labelSev.Text = Charp.getErrSevMsg(err.sev);
        }
예제 #10
0
        public void Commit(Charp.SuccessDelegate success, Charp.ErrorDelegate error)
        {
            string[] types = { "MOBILE", "HOME", "WORK", "NEXTEL" };

            object[] parms = {
                personaId,
                entryNumber.Text,
                types[comboType.Active],
                textRemarks.Buffer.Text
            };

            if (isNew ||
                (string) parms[1] != (string) myData["numbr"] ||
                (string) parms[2] != (string) myData["type"] ||
                !Util.StrEqNull ((string) parms[3], (string) myData["remarks"])) {

                string resource;
                if (isNew) {
                    resource = "phone_create";
                } else {
                    resource = "phone_update";
                    parms = Util.ArrayUnshift (parms, phoneId);
                }

                config.charp.request (resource, parms, new CharpGtk.CharpGtkCtx {
                    asSingle = true,
                    parent = ParentWin,
                    success = delegate (object data, Charp.CharpCtx ctx) {
                        LoadData ((JObject) data);
                        success (null, null);
                    },
                    error = error
                });
            } else
                success (null, null);
        }
예제 #11
0
 private void CommitSuccess(object data, Charp.CharpCtx ctx)
 {
     SendAction (menubar, delegate {
         if (config.mainwin.patientListWin != null)
             config.mainwin.patientListWin.Refresh ();
         Destroy ();
     });
 }
예제 #12
0
 private void CommitPersonaSuccess(object data, Charp.CharpCtx ctx)
 {
     personaAddEditor.Commit (CommitSuccess, CommitError);
 }
예제 #13
0
 private void CommitPatientSuccess(object data, Charp.CharpCtx ctx)
 {
     LoadDetails ((JObject) data);
     if (OpType == TYPE.NEW) {
         personaEditor.SetPersonaId (personaId);
         personaAddEditor.SetPersonaId (personaId);
     }
     personaEditor.Commit (CommitPersonaSuccess, CommitError);
 }
예제 #14
0
 private bool CommitError(Charp.CharpError err, Charp.CharpCtx ctx)
 {
     Gtk.Application.Invoke (delegate { FinishAction (menubar); });
     return true;
 }
예제 #15
0
 private void CommitPhones(System.Collections.IEnumerator e, Charp.SuccessDelegate success, Charp.ErrorDelegate error)
 {
     if (e.MoveNext ()) {
         PhoneEditor editor = (PhoneEditor) e.Current;
         editor.Commit (delegate (object data, Charp.CharpCtx ctx) {
             CommitPhones (e, success, error);
         }, error);
     } else {
         System.Collections.IEnumerator e2 = vboxEmails.GetEnumerator ();
         e2.Reset ();
         CommitEmails (e2, success, error);
     }
 }
예제 #16
0
 protected void testySuccess(object data, UploadValuesCompletedEventArgs status, Charp.CharpCtx ctx)
 {
     Console.WriteLine ("success " + entryResource.Text);
 }
예제 #17
0
 public MainWindow(Charp charp)
     : base(Gtk.WindowType.Toplevel)
 {
     Build ();
     this.charp = charp;
 }
예제 #18
0
 public PictureCache(Charp charp)
 {
     this.charp = charp;
 }
예제 #19
0
 private void CommitPersonaSuccess(Charp.SuccessDelegate success, Charp.ErrorDelegate error)
 {
     if (photoChanged) {
         config.charp.request ("persona_add_photo", new object[] { personaId }, new CharpGtk.CharpGtkCtx {
             parent = ParentWin,
             success = success,
             error = error,
             fileName = filename
         });
     } else
         success (null, null);
 }
예제 #20
0
 private void CommitEmails(System.Collections.IEnumerator e, Charp.SuccessDelegate success, Charp.ErrorDelegate error)
 {
     if (e.MoveNext ()) {
         EmailEditor editor = (EmailEditor) e.Current;
         editor.Commit (delegate (object data, Charp.CharpCtx ctx) {
             CommitEmails (e, success, error);
         }, error);
     } else {
         success (null, null);
     }
 }