Exemplo n.º 1
0
        private void picture_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(member_no.Text.Trim()) || string.IsNullOrEmpty(member_id.Trim()))
            {
                GF.Error("ต้องมี 'หมายเลขสมาชิก' ก่อน !!");
                return;
            }

            if (Global.Capture.List().Count > 0)
            {
                using var member_picture = new member_picture(member_no.Text.Trim());
                member_picture.Owner     = this;
                member_picture.ShowDialog();
                this.BringToFront();
                this.Activate();
            }
            else
            {
                GF.Error("ไม่พบ กล้อง WebCam !!\r\nกรุณาติดตั้ง กล้อง WebCam ก่อน !");
                return;
            }

            if (!string.IsNullOrEmpty(member_no.Text.Trim()) && !string.IsNullOrEmpty(pictureFilename.Trim()))
            {
                GF.getImage(GF.Settings("tmp_path") + pictureFilename, ref picture, "member_picture");
            }
        }
        public config_member_type_view_card(string fileName)
        {
            InitializeComponent();

            GF.getImage(fileName, ref pictureBox, "member_card");

            this.Width  = pictureBox.Image.Width;
            this.Height = pictureBox.Image.Height;

            this.CenterToScreen();
        }
Exemplo n.º 3
0
        private void member_manage_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(member_id.Trim()))
            {
                GF.showLoading(this);
                Dictionary <string, string> values = new()
                {
                    { "member_id", member_id.Trim() }
                };

                Dictionary <string, object> Obj = DB.Post("Member/getMemberData/", values);

                if (Obj != null)
                {
                    if (Obj.ContainsKey("result"))
                    {
                        Dictionary <string, object> Item = GF.ToType <Dictionary <string, object> >(Obj["result"]);
                        if (Item.Keys.Count > 0)
                        {
                            member_no.Text           = (Item["member_no"] ?? "").ToString();
                            current_member_type.Text = (Item["current_member_type"] ?? "").ToString();
                            during_date.Text         = (Item["during_date"] ?? "").ToString();
                            first_date.Text          = GF.formatDBDateTime((Item["create_date"] ?? "").ToString());
                            current_contract_no.Text = (Item["contract_no"] ?? "").ToString();

                            firstname_th.Text = (Item["firstname_th"] ?? "").ToString();
                            lastname_th.Text  = (Item["lastname_th"] ?? "").ToString();
                            nickname_th.Text  = (Item["nickname_th"] ?? "").ToString();
                            firstname_en.Text = (Item["firstname_en"] ?? "").ToString();
                            lastname_en.Text  = (Item["lastname_en"] ?? "").ToString();
                            nickname_en.Text  = (Item["nickname_en"] ?? "").ToString();

                            martial_status.Text = Item["martial_status"].ToString();
                            if (!string.IsNullOrEmpty((Item["birthday"] ?? "").ToString()))
                            {
                                birthday.Text    = Item["birthday"].ToString();
                                current_age.Text = GF.calculateAge(Item["birthday"].ToString());
                            }
                            if (!string.IsNullOrEmpty((Item["document_type"] ?? "").ToString()))
                            {
                                document_type.Text = Item["document_type"].ToString();
                            }
                            document_no.Text = (Item["document_no"] ?? "").ToString();
                            email.Text       = (Item["email"] ?? "").ToString();
                            occupation.Text  = (Item["occupation"] ?? "").ToString();
                            gender.Text      = Item["gender"].ToString();
                            address.Text     = (Item["address"] ?? "").ToString();

                            company_name.Text = (Item["company_name"] ?? "").ToString();
                            work_phone.Text   = (Item["work_phone"] ?? "").ToString();
                            home_phone.Text   = (Item["home_phone"] ?? "").ToString();
                            mobile_phone.Text = (Item["mobile_phone"] ?? "").ToString();

                            emergency_contact_name.Text         = (Item["emergency_contact_name"] ?? "").ToString();
                            emergency_contact_phone.Text        = (Item["emergency_contact_phone"] ?? "").ToString();
                            emergency_contact_relationship.Text = (Item["emergency_contact_relationship"] ?? "").ToString();

                            weight.Text             = (Item["weight"] ?? "").ToString();
                            height.Text             = (Item["height"] ?? "").ToString();
                            congenital_disease.Text = (Item["congenital_disease"] ?? "").ToString();

                            pictureFilename = (Item["image_file"] ?? "").ToString();
                            if (!string.IsNullOrEmpty(pictureFilename.Trim()))
                            {
                                GF.getImage(pictureFilename, ref picture, "member_picture");
                            }
                        }
                    }
                }

                GF.closeLoading();
            }
            else
            {
                picture.Visible = false;
            }
        }