Esempio n. 1
0
        private void btn_setupDevice_Click(object sender, EventArgs e)
        {
            // ic.setupDevices_new();
            // winforms.testForm1 fm = new testForm1();
            //fm.ShowDialog();

            try
            {
                //_streaming = false;
                //_capture = new Capture();
                OpenSelectFGDialog(true);
                //testForm1 tf = new testForm1();
                //tf.Show();
            }
            catch (Exception ex)
            {
                //AlertForm1 al = new AlertForm1("Kindly connect your fingerprint Device and Retry"
                //      , AlertForm1.AlertType.success, "No device selected", "RETRY");
                AlertForm1 al = new AlertForm1(ex.ToString(), AlertForm1.AlertOptions.OK);
                al.ShowDialog();

                //if (!al.rDialogResult)


                //MessageBox.Show(ex.ToString(), "Error");
            }
        }
        private void btn_checkExistLocal_Click(object sender, EventArgs e)
        {
            pix_busy.Visible = true;
            //if (!Utils.check_usernames_exist(_username))
            String enteredUsername = xamlTextBoxUsername.Text.Trim();

            //dynamic found = Utils.check_InternetID_exist(enteredUsername);

            //found.status = true;
            //found.idstring = ds2.idString;
            //found.username = ds2.username;
            //found.remark = "Enrolled Already";

            if (string.IsNullOrEmpty(enteredUsername))
            {
                AlertForm1 al = new AlertForm1("Username must not be empty.", AlertForm1.AlertOptions.OK, AlertForm1.AlertType.error);
                al.ShowDialog();
                //MessageBox.Show("Username must not be empty.");
            }
            else
            {
                Utils.show_ClientExist(enteredUsername);
                Utils.gen_barcode(pixBarcode, enteredUsername);

                pix_busy.Visible = false;
            }
        }
Esempio n. 3
0
        private async void btn_checkConnection_Click(object sender, EventArgs e)
        {
            //string addr = @"http://192.168.8.109/sam/ptmfb/testubasvccc/";

            //Properties.Settings.Default.webAPIAddress = txt_address.Text;
            //Properties.Settings.Default.Save();


            JToken str = await Task <JToken> .Run(() => Utils.call_WEBAPI_GETService("Establish_Serverconnection"));

            dynamic dd = new ExpandoObject();

            //dd = Newtonsoft.Json.JsonConvert.DeserializeObject(tmp.ToString());

            dd = Newtonsoft.Json.JsonConvert.DeserializeObject <dynamic>(str.ToString());


            bool ConnectionOK = (bool)dd.ConnectionOK;

            if (ConnectionOK)
            {
                AlertForm1 al = new AlertForm1("Connection established, WebAPI Address Saved Successfully...",
                                               AlertForm1.AlertOptions.OK);
                al.ShowDialog();

                //MessageBox.Show("Connection established, WebAPI Address Saved Successfully...");
            }
            else
            {
                AlertForm1 al = new AlertForm1("Failed to establish connection...", AlertForm1.AlertOptions.OK);
                al.ShowDialog();

                //MessageBox.Show("Failed to establish connection...");
            }
        }
Esempio n. 4
0
        private void btn_resetData_Click(object sender, EventArgs e)
        {
            //DialogResult msg = MessageBox.Show("Are you sure you want to Delete All Records....",
            //                  "Reset Database Records...",
            //                  MessageBoxButtons.OKCancel,
            //                  MessageBoxIcon.Warning);

            AlertForm1 al = new AlertForm1("Are you sure you want to Delete All Records....",
                                           AlertForm1.AlertOptions.YESNO,
                                           AlertForm1.AlertType.success,
                                           "Reset Database Records...");
            var aa = al.ShowDialog();

            if (al.rDialogResult)

            //if (msg == DialogResult.OK)
            {
                try
                {
                    //StopCapturing();
                    _afis = new LocalAFIS();
                    System.IO.Directory.Delete(_afis.StoragePath, true);

                    //Added to mimick same behavior in database table
                    Utils.truncate_tables();
                    //UpdateUserList();
                    //ResetGUI();
                    DisplayError("Reset Completed............");
                }
                catch (Exception ex)
                {
                    DisplayError(ex.Message);
                }
            }
        }
        private void NewMethodcaptureDevice_()
        {
            Task.Run(() =>
            {
                if (xamlListBoxDevices.SelectedIndex >= 0)
                {
                    DeviceInfos selectedDInfos = xamlListBoxDevices.SelectedItem as DeviceInfos;     //Get selected Fingerprint Scanner
                                                                                                     // DeviceInfos selectedDInfos = xamlListBoxDevices.SelectedValue as DeviceInfos; //Get selected Fingerprint Scanner
                    if (selectedDInfos != null)
                    {
                        var _preCursor = this.Cursor;
                        try
                        {
                            this.Cursor        = Cursors.WaitCursor; //.Wait;
                            FingerPrintScanner = FPScanner.GetFPScanner(_selectedDeviceIdentity, selectedDInfos.Index);
                            rDialogResult      = true;
                        }
                        catch (Exception ex)
                        {
                            AlertForm1 al = new AlertForm1(ex.Message, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.error);
                            al.ShowDialog();

                            //MessageBox.Show(ex.Message, "ERROR");
                        }
                        finally
                        {
                            this.Cursor = _preCursor;
                            this.Close();
                        }
                    }
                }
            });
        }
Esempio n. 6
0
        //private void btn_configFile_Click(object sender, EventArgs e)
        //{
        //    if (folderBrowserDialog2.ShowDialog() == DialogResult.OK)
        //    {

        //        Properties.Settings.Default.ConfigFolder =
        //        txt_configFile.Text = folderBrowserDialog2.SelectedPath;
        //        Properties.Settings.Default.Save();
        //    }
        //}

        private async void btn_Getsettings_Click(object sender, EventArgs e)
        {
            dynamic ddParam = new ExpandoObject();

            ddParam.paramName = "APPSETTINGS_" + Environment.MachineName;
            //ddParam.paramValue = paramValue;

            object ob             = ddParam;
            string SaveParamValue = Newtonsoft.Json.JsonConvert.SerializeObject(ob);

            Properties.Settings.Default.webAPIAddress = txt_address.Text;


            JToken strResp = await Task <JToken> .Run(() => Utils.call_WEBAPI_Service("Get_AppSettings_Value", SaveParamValue));

            dynamic ddvalue1 = new ExpandoObject();

            //dd = Newtonsoft.Json.JsonConvert.DeserializeObject(tmp.ToString());

            ddvalue1 = Newtonsoft.Json.JsonConvert.DeserializeObject <dynamic>(strResp.ToString());
            dynamic ddvalue = new ExpandoObject();

            ddvalue = JObject.Parse(ddvalue1.paramValue.ToString());

            bool ConnectionOK = (bool)ddvalue1.found;

            if (ConnectionOK)
            {
                // Generate app value for the appcontrol table
                //dynamic ddvalue = new ExpandoObject();
                Properties.Settings.Default.informetriQConnectionString = (string)ddvalue.connectionString;
                //txt_address.Text= Properties.Settings.Default.webAPIAddress = (string)ddvalue.webAPIAddress;
                Properties.Settings.Default.ExternalAPIAddress = (string)ddvalue.ExternalAPIAddress;
                Properties.Settings.Default.TemplateFORMAT     = (string)ddvalue.TemplateFORMAT;
                Properties.Settings.Default.ImageFolder        = (string)ddvalue.ImageFolder;

                txt_externalAPI.Text   = Properties.Settings.Default.ExternalAPIAddress;
                lb_templateFormat.Text = Properties.Settings.Default.TemplateFORMAT;
                txt_imagefolder.Text   = Properties.Settings.Default.ImageFolder;

                //Properties.Settings.Default.ConfigFolder = (string)ddvalue.ConfigFolder;
                Properties.Settings.Default.VersionPlatform = (string)ddvalue.platform;
                Properties.Settings.Default.Save();
                string msg = "Connection established, Configuration Retrieved Successfully...";
                //MessageBox.Show(msg);
                AlertForm1 al = new AlertForm1(msg);
                al.ShowDialog();
            }
            else
            {
                string     msg = "Connection failed......";
                AlertForm1 al  = new AlertForm1(msg, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.error);
                al.ShowDialog();
                //MessageBox.Show((string)dd.message);
            }

            pix_webSetting.Visible = false;
        }
Esempio n. 7
0
        private async void btn_downloadSettings_Click(object sender, EventArgs e)
        {
            pix_webSetting.Visible = true;
            dynamic ddParam = new ExpandoObject();

            ddParam.paramName = "APPSETTINGS";
            // ddParam.paramValue = paramValue;

            object ob             = ddParam;
            string SaveParamValue = Newtonsoft.Json.JsonConvert.SerializeObject(ob);



            JToken strResp = await Task <JToken> .Run(() => Utils.call_WEBAPI_Service("Get_AppSettings_Value", SaveParamValue));

            dynamic ddResp = new ExpandoObject();

            //dd = Newtonsoft.Json.JsonConvert.DeserializeObject(tmp.ToString());

            ddResp = Newtonsoft.Json.JsonConvert.DeserializeObject <dynamic>(strResp.ToString());

            if ((bool)ddResp.found)
            {
                dynamic ddvalue = new ExpandoObject();
                ddvalue = Newtonsoft.Json.JsonConvert.DeserializeObject <dynamic>((string)ddResp.paramValue);


                //string informetriQConnectionString = ddvalue.connectionString;
                //string webAPIAddress = ddvalue.webAPIAddress;
                //string ExternalAPIAddress = ddvalue.ExternalAPIAddress;
                //string TemplateFORMAT = ddvalue.TemplateFORMAT;


                Properties.Settings.Default.informetriQConnectionString = ddvalue.connectionString;
                Properties.Settings.Default.webAPIAddress      = ddvalue.webAPIAddress;
                Properties.Settings.Default.ExternalAPIAddress = ddvalue.ExternalAPIAddress;
                Properties.Settings.Default.TemplateFORMAT     = ddvalue.TemplateFORMAT;

                txt_address.Text       = Properties.Settings.Default.webAPIAddress;
                lb_templateFormat.Text = Properties.Settings.Default.TemplateFORMAT;
                txt_externalAPI.Text   = Properties.Settings.Default.ExternalAPIAddress;

                Properties.Settings.Default.Save();
                string msg = "App Setting retrieved from server Successfully...";
                //MessageBox.Show(msg);
                AlertForm1 al = new AlertForm1(msg);
                al.ShowDialog();
            }
            else
            {
                string     msg = "App Setting not found, Configure application ...";
                AlertForm1 al  = new AlertForm1(msg, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.error);
                al.ShowDialog();
            }

            pix_webSetting.Visible = false;
        }
Esempio n. 8
0
 private void displayMessage(String message, System.Windows.Media.Brush brush)
 {
     // Application.Current.Dispatcher.BeginInvoke((Action)(() =>
     {
         //xamlLabelMessage.BackColor = brush;
         //xamlLabelMessage.Text = message.ToUpper();
         //lst_msg.Items.Insert(0, message.ToUpper());
         AlertForm1 al = new AlertForm1(message, AlertForm1.AlertOptions.OK);
         al.ShowDialog();
         // MessageBox.Show(message);
     }
     //));
 }
Esempio n. 9
0
        private void OpenSelectFGDialog(bool setupPARAM = false)
        {
            //CloseScanner();

            //ResetGUI();
            //DisplayMessage("Device configuration");

            try
            {
                SelectFGWindow_new selectFG = new SelectFGWindow_new(this);

                selectFG.ShowDialog();

                if (selectFG.rDialogResult)
                // if (selectFG.ShowDialog()==DialogResult.OK)
                //if (selectFG.rDialogResult.HasValue && selectFG.rDialogResult.Value)
                {
                    var selectedDeviceIdentity = selectFG.SelectedDeviceIdentity;

                    if (_fpScanner != null)
                    {
                        _fpScanner.Dispose();
                        _fpScanner = null;
                    }


                    if (setupPARAM)
                    {
                        OpenSelectDeviceDialog_setup(selectedDeviceIdentity);
                    }
                    else
                    {
                        OpenSelectDeviceDialog(selectedDeviceIdentity);
                    }
                }
                else
                {
                    if (_fpScanner == null)
                    {
                        DisplayError("No Frame-Grabber selected.");
                    }
                    //EnableGUI(false);
                }
            }
            catch (Exception ex)
            {
                AlertForm1 al = new AlertForm1(ex.Message, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.error);
                al.ShowDialog();
                // DisplayError(ex.Message);
            }
        }
        private void btn_exist_Click(object sender, EventArgs e)
        {
            pix_busy.Visible = true;
            //if (!Utils.check_usernames_exist(_username))
            String  enteredUsername = xamlTextBoxUsername.Text.Trim();
            dynamic found           = Utils.check_InternetID_exist(enteredUsername);

            //found.status = true;
            //found.idstring = ds2.idString;
            //found.username = ds2.username;
            //found.remark = "Enrolled Already";

            if (enteredUsername.Length == 0)
            {
                AlertForm1 al = new AlertForm1(found.remark, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.error);
                al.ShowDialog();
                //MessageBox.Show("Username must not be empty.");
            }
            else
            {
                if ((bool)found.status)
                {
                    string values    = found.username;
                    string keyvalues = found.idstring;

                    AlertForm1 al = new AlertForm1(found.remark + Environment.NewLine + "Username => " + values +
                                                   Environment.NewLine + "Internat ID Number => " + keyvalues, AlertForm1.AlertOptions.OK,
                                                   AlertForm1.AlertType.info, "Duplicate Check");
                    al.ShowDialog();

                    //Utils.show_ClientExist(enteredUsername);
                    Utils.show_ClientExist_Online(enteredUsername);
                    //MessageBox.Show("Client already Enrolled......" + Environment.NewLine + "Username => " + values +
                    //    Environment.NewLine + "Internat ID Number => " + keyvalues,
                    //    "Duplicate Check", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    Utils.gen_barcode(pixBarcode, enteredUsername);
                    pix_busy.Visible = false;
                }
                else
                {
                    AlertForm1 al = new AlertForm1(found.remark, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.info);
                    al.ShowDialog();
                    Utils.show_ClientExist_Online(enteredUsername);

                    ///Utils.show_ClientExist(enteredUsername);
                    // MessageBox.Show("Username does not exist....");
                }
            }
        }
Esempio n. 11
0
 private void btn_save_Click(object sender, EventArgs e)
 {
     try
     {
         if (check_if_Empty(txt_loginID.Text, "LoginID") && check_if_Empty(txt_staffname.Text, "Staff Name"))
         {
             Save_AppUserData();
         }
     }
     catch (Exception ex)
     {
         AlertForm1 al = new AlertForm1(ex.Message, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.info);
         al.ShowDialog();
     }
 }
Esempio n. 12
0
        private void btn_DBConnection_Click(object sender, EventArgs e)
        {
            pix_webSetting.Visible = true;
            Properties.Settings.Default.CONNECTIONMODE = ch_useDirect.Checked ? "1" : "0";
            if (ch_useDirect.Checked && string.IsNullOrEmpty(cb_datasource.Text))
            {
                NewServerConnetionMethod();
                //return;
            }
            else
            {
                string informetriQConnectionString = Properties.Settings.Default.informetriQConnectionString;
                //if (string.IsNullOrEmpty(informetriQConnectionString))
                {
                    SqlConnectionStringBuilder cs  = new SqlConnectionStringBuilder();
                    SqlConnectionStringBuilder cs2 = new SqlConnectionStringBuilder();

                    ////Properties.MDBSettings.Default.sys_password = txt_pwd.Text;
                    cs.InitialCatalog = cb_initialcatalog.Text;
                    ////cs.IntegratedSecurity = true;
                    //cs.InitialCatalog =  comboBox2.Text;

                    cs.UserID   = "sa";
                    cs.Password = txt_pwd.Text;
                    ////cs.Password = "******";
                    cs.DataSource = cb_datasource.Text;
                    //txt_connection.Text = cs.ConnectionString;
                    Properties.Settings.Default.informetriQConnectionString = cs.ConnectionString;
                    ////Properties.MDBSettings.Default.Save();
                    cs2                 = cs;
                    cs2.Password        = "******";
                    txt_connection.Text = cs2.ConnectionString;
                    ////cs.InitialCatalog = "iCONNECT3";
                    ////Properties.Settings.Default.NIBSSAddress = txt_address.Text;
                    ////Properties.Settings.Default.BranchName = cb_branch.Text;

                    Properties.Settings.Default.Save();

                    //getBranches();
                    ////Properties.MDBSettings.Default.iCONNECT3 = txt_connection2.Text = cs.ConnectionString;
                    //MessageBox.Show();
                    AlertForm1 al = new AlertForm1("Saved Successfully...", AlertForm1.AlertOptions.OK, AlertForm1.AlertType.success);
                    al.ShowDialog();
                }
            }
        }
Esempio n. 13
0
        private void btn_verifyZF10_Click(object sender, EventArgs e)
        {
            bool runNextPhase = true;

            Task.Run(() =>
            {
                try
                {
                    //_streaming = false;
                    //_capture = new Capture();
                    if (_fpScanner == null)
                    {
                        OpenSelectFGDialog();
                    }
                    else
                    {
                        //CloseScanner();
                        connect_Device();
                        _fpScanner = FingerPrintScanner;
                    }
                    //testForm1 tf = new testForm1();
                    //tf.Show();
                }
                catch (Exception ex)
                {
                    runNextPhase  = false;
                    AlertForm1 al = new AlertForm1(ex.ToString(), AlertForm1.AlertOptions.OK);
                    al.ShowDialog();



                    //MessageBox.Show(ex.ToString(), "Error");
                }
            }).Wait();


            if (runNextPhase)
            {
                VerifyZF10 fm = new VerifyZF10(_fpScanner);

                fm.Show();
            }
        }
Esempio n. 14
0
        private void changePasswordMethod()
        {
            dynamic dd = new ExpandoObject();

            dd.loginid  = cbo_userName.Text;
            dd.passwprd = txt_PWD.Text;
            dd.pwd1     = txt_pwd1.Text;
            dd.pwd2     = txt_Pwd2.Text;


            AlertForm1 al = new AlertForm1("Do you want to continue with change of password ?",
                                           AlertForm1.AlertOptions.OKCANCEL,
                                           AlertForm1.AlertType.success, "Confirm Password change");
            var aa = al.ShowDialog();

            if (al.rDialogResult)
            //if (msg == DialogResult.OK)
            {
                object newPWD = dd;

                string strREQ      = Newtonsoft.Json.JsonConvert.SerializeObject(newPWD);
                string strResponse = "";
                Task.Run(() =>
                {
                    {
                        //displayMessage("Identifying Template File.....", Utils.COLOR_DERMALOG_RED);
                        strResponse = Utils.call_WEBAPI_Service("Change_Password", strREQ);
                    }
                }
                         ).Wait();

                //bool clientFound = false;
                dynamic dm = new ExpandoObject();
                dm = Newtonsoft.Json.JsonConvert.DeserializeObject <dynamic>(strResponse);

                string resp = dm.resp;

                AlertForm1 a2 = new AlertForm1(resp, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.info);
                a2.ShowDialog();
            }
        }
Esempio n. 15
0
        public static void show_ClientExist(String enteredUsername)
        {
            //pix_login.Visible = true;
            //String enteredUsername = xamlTextBoxUsername.Text.Trim();
            //individual_data strResponse = null;
            dynamic strResponse = new ExpandoObject();
            //Task.Run(() =>
            {
                {
                    using (tranxDataContext tx = new tranxDataContext())
                    {
                        tx.Connection.ConnectionString = Utils.getConnection();
                        var ds = tx.individual_datas
                                 .FirstOrDefault(s => s.username == enteredUsername);

                        if (ds != null)
                        {
                            strResponse = ds;
                            winforms.Form_data fm = new winforms.Form_data(strResponse, true);
                            fm.ShowDialog();
                        }
                        else
                        {
                            AlertForm1 al = new AlertForm1("Individual Data noavailable Locally",
                                                           AlertForm1.AlertOptions.OK, AlertForm1.AlertType.error);
                            al.ShowDialog();
                        }
                        //strResponse = Newtonsoft.Json.JsonConvert.SerializeObject(ds);
                    }
                    //strResponse = Utils.call_WEBAPI_GETService("infometriq-partner-api/individuals");
                }
            }
            //).Wait();


            //AlertForm1 fmm = new AlertForm1("Client Data Received Successfully.....");
            //fmm.ShowDialog();

            //pix_login.Visible = false;
        }
Esempio n. 16
0
        private void saveData(dynamic dm, string Profession_desc, string strResponse)
        {
            //dynamic dm = new ExpandoObject();
            // individual_data ind = Newtonsoft.Json.JsonConvert.DeserializeObject<individual_data>(dd);
            //individual_data ind = dd;
            try
            {
                using (tranxDataContext tx = new tranxDataContext())
                {
                    tx.Connection.ConnectionString = Utils.getConnection();
                    string strUsername = dm.username;
                    var    ds          = tx.individual_datas.FirstOrDefault(s => s.username == strUsername);

                    if (ds == null)
                    {
                        individual_data ind = new individual_data();
                        ind.id                = dm.id;
                        ind.first_name        = dm.first_name;
                        ind.last_name         = dm.last_name;
                        ind.username          = dm.username;
                        ind.email             = dm.email;
                        ind.dob               = dm.dob;
                        ind.state             = dm.state;
                        ind.country           = dm.country;
                        ind.profession        = dm.profession;
                        ind.about             = dm.about;
                        ind.phone             = dm.phone;
                        ind.website           = dm.website;
                        ind.gender            = dm.gender;
                        ind.confirmation_code = dm.confirmation_code;
                        ind.social_facebook   = dm.social_facebook;
                        ind.social_twitter    = dm.social_twitter;
                        ind.social_instagram  = dm.social_instagram;
                        ind.social_linkedin   = dm.social_linkedin;
                        ind.social_youtube    = dm.social_youtube;
                        ind.politics          = dm.politics;
                        ind.recognition       = dm.recognition;
                        ind.hide_dob          = dm.hide_dob;
                        ind.rating            = dm.rating;
                        ind.status            = dm.status;
                        ind.verified_status   = dm.verified_status;
                        ind.created_on        = dm.created_on;
                        ind.last_updated_on   = dm.last_updated_on;
                        ind.state_name        = dm.state_name;

                        ind.profession_name = Profession_desc;
                        ind.strResponse     = strResponse;
                        ind.account_type    = dm.account_type;
                        tx.individual_datas.InsertOnSubmit(ind);
                        tx.SubmitChanges();

                        AlertForm1 fm  = new AlertForm1("Saved Successfully...", AlertForm1.AlertOptions.OK, AlertForm1.AlertType.success);
                        var        rst = fm.ShowDialog();
                    }
                    else
                    {
                        AlertForm1 fm  = new AlertForm1("User Details already saved...", AlertForm1.AlertOptions.OK, AlertForm1.AlertType.info);
                        var        rst = fm.ShowDialog();
                        btn_save.Enabled = false;
                    }
                }
            }
            catch (Exception ex)
            {
                AlertForm1 fm  = new AlertForm1(ex.Message, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.error);
                var        rst = fm.ShowDialog();
            }
        }
Esempio n. 17
0
        private void Save_AppUserData()
        {
            dynamic NU = new ExpandoObject();

            NU.loginid      = txt_loginID.Text;
            NU.staffname    = txt_staffname.Text;
            NU.emailaddress = txt_emailaddress.Text;
            NU.state        = cbo_state.Text;
            NU.location     = cbo_location.Text;
            NU.role         = cbo_role.Text;
            NU.status       = chk_status.Checked ? "Activated" : "Pending";
            NU.createdBy    = sf.loggedin_staff;

            object newUser = NU;

            string strREQ      = Newtonsoft.Json.JsonConvert.SerializeObject(newUser);
            string strResponse = "";

            Task.Run(() =>
            {
                {
                    //displayMessage("Identifying Template File.....", Utils.COLOR_DERMALOG_RED);
                    strResponse = Utils.call_WEBAPI_Service("save_ApplicationUser", strREQ);
                }
            }
                     ).Wait();

            //bool clientFound = false;
            dynamic dm = new ExpandoObject();

            dm = Newtonsoft.Json.JsonConvert.DeserializeObject <dynamic>(strResponse);

            string resp = dm.resp;

            AlertForm1 al = new AlertForm1(resp, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.info);

            al.ShowDialog();

            // RefreshData();


            try
            {
                JObject ss = new JObject();
                ss = dm.dataset;
                DataSet dataSet = Newtonsoft.Json.JsonConvert.DeserializeObject <DataSet>(ss.ToString());

                //DataTable dataTable =
                //object dd = dm.dataset;
                // dynamic cc = new ExpandoObject();
                // cc= JsonConvert.DeserializeObject<DataSet>((string)dm.dataset);

                // DataSet dss =  Newtonsoft.Json.JsonConvert.DeserializeObject<DataSet>(cc);
                // DataSet dss = (DataSet)((string)dm.dataset);
                //DGV_AppUsers.DataSource = ((DataSet)dm.dataset).Tables["Items"]; ;// dss.Tables["Items"]; ;
                DGV_AppUsers.DataSource = dataSet.Tables["Items"]; //dataTable;
            }
            catch (Exception ex)
            {
                string str = ex.Message;
            }

            ClearForm();
        }
Esempio n. 18
0
        private void btn_verifyTemplate_Click(object sender, EventArgs e)
        {
            bool runNextPhase = true;

            //Task.Run(() =>
            Thread.Sleep(1000);
            {
                //try
                {
                    //_streaming = false;
                    //_capture = new Capture();
                    if (_fpScanner == null)
                    {
                        //OpenSelectFGDialog();
                        AlertForm1 al = new AlertForm1("Device is not connected", AlertForm1.AlertOptions.OK);
                        al.ShowDialog();
                        return;
                    }
                    try
                    {
                        //_afis = new LocalAFIS();

                        if (!VerifyForm_hidden)
                        {
                            //EnrollmentWindow_new enrollmentWindow = new EnrollmentWindow_new(_fpScanner, _afis);
                            //EnrollmentWindow_new enrollmentWindow = new EnrollmentWindow_new(_fpScanner, _afis,
                            // _VerifyWindow = new VerifyWindow(_fpScanner,this);
                            _VerifyWindow = new VerifyWindow(_fpScanner, this);
                            _VerifyWindow.Activate();
                            var ddg = _VerifyWindow.ShowDialog();
                        }
                        else
                        {
                            // VerifyWindow.reloadForm("Identification Request");
                            //var ddg =
                            // _VerifyWindow.Show();
                            _VerifyWindow.Activate();
                            var ddg = _VerifyWindow.ShowDialog();
                        }
                    }
                    catch (Exception ex) {
                        AlertForm1 al = new AlertForm1(ex.ToString(), AlertForm1.AlertOptions.OK);
                        al.ShowDialog();
                    }
                }
                //catch (Exception ex)
                //{

                //    runNextPhase = false;
                //    AlertForm1 al = new AlertForm1(ex.ToString(), AlertForm1.AlertOptions.OK);
                //    al.ShowDialog();


                //    // MessageBox.Show(ex.ToString(), "Error");
                //}
            }
            //).Wait();

            //if (runNextPhase)
            //{
            //    VerifyZF10_template fm = new VerifyZF10_template(_fpScanner);

            //    fm.ShowDialog();
            //}
        }
Esempio n. 19
0
        private void NewServerConnetionMethod(bool suppressMsg = false)
        {
            try
            {
                string  serverName;      // = comboBox1.SelectedValue.ToString() ;
                Server  server;
                Boolean cmanualflag = ch_useDirect.Checked;

                serverName = ((cb_datasource.Items.Count == 0) ? "" : cb_datasource.SelectedValue.ToString());

                if ((serverName.Trim() == "") || (cmanualflag))
                {
                    serverName = txt_serverAddress.Text.Trim();    //      ToString();
                    SqlConnection    sqlj = getNewSqlConnection(serverName, txt_userID.Text, txt_pwd.Text);
                    ServerConnection scip = new ServerConnection(sqlj);


                    String dbname   = txt_serverSource.Text.Trim();
                    String con_str  = ConfigurationManager.ConnectionStrings["APPDIRECT"].ConnectionString;
                    String con_str1 = con_str.Replace("SERVERNAME", serverName);
                    con_str1 = con_str1.Replace("DBNAME", dbname);
                    con_str1 = con_str1.Replace("USERNAME", txt_userID.Text.Trim());
                    con_str1 = con_str1.Replace("PASSWORD", txt_pwd.Text.Trim());

                    Properties.Settings.Default.informetriQConnectionString = con_str1;
                    // MessageBox.Show(con_str1);
                    txt_connection.Text = con_str1;
                    Properties.Settings.Default.CONNECTIONMODE = "1";

                    Properties.Settings.Default.Save();

                    using (tranxDataContext tx = new tranxDataContext())
                    {
                        try
                        {
                            tx.Connection.ConnectionString = con_str1;
                            int ii = tx.ExecuteCommand(string.Format("Exec testtesttesttest '{0}'", txt_userID.Text));
                            tx.SubmitChanges();
                            if (!suppressMsg)
                            {
                                AlertForm1 al = new AlertForm1("Connection Successful...", AlertForm1.AlertOptions.OK, AlertForm1.AlertType.success);
                                al.ShowDialog();
                                //MessageBox.Show("Connection Successful");
                            }
                        }
                        catch (Exception ex)
                        {
                            if (!suppressMsg)
                            {
                                AlertForm1 al = new AlertForm1(ex.Message, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.error);
                                al.ShowDialog();
                                //MessageBox.Show(ex.Message);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 20
0
        private async void save_WebAPI_Address()
        {
            //string addr = @"http://192.168.8.109/sam/ptmfb/testubasvccc/";

            Properties.Settings.Default.useExternalCamera = 0;
            if (camToggle1.Checked)
            {
                Properties.Settings.Default.useExternalCamera = 1;
            }
            //Properties.Settings.Default.Save();

            Properties.Settings.Default.webAPIAddress      = txt_address.Text;
            Properties.Settings.Default.ExternalAPIAddress = txt_externalAPI.Text;
            //Properties.Settings.Default.ConfigFolder = txt_configFile.Text;
            Properties.Settings.Default.ImageFolder = txt_imagefolder.Text;

            Properties.Settings.Default.Save();


            // Generate app value for the appcontrol table
            dynamic ddvalue = new ExpandoObject();

            ddvalue.connectionString   = Properties.Settings.Default.informetriQConnectionString;
            ddvalue.webAPIAddress      = Properties.Settings.Default.webAPIAddress;
            ddvalue.ExternalAPIAddress = Properties.Settings.Default.ExternalAPIAddress;
            ddvalue.TemplateFORMAT     = Properties.Settings.Default.TemplateFORMAT;
            ddvalue.ImageFolder        = Properties.Settings.Default.ImageFolder;
            //ddvalue.ConfigFolder = Properties.Settings.Default.ConfigFolder;

            object ob         = ddvalue;
            string paramValue = Newtonsoft.Json.JsonConvert.SerializeObject(ob);

            dynamic ddParam = new ExpandoObject();

            ddParam.paramName  = "APPSETTINGS_" + Environment.MachineName;
            ddParam.paramValue = paramValue;

            ob = ddParam;
            string SaveParamValue = Newtonsoft.Json.JsonConvert.SerializeObject(ob);



            JToken strResp = await Task <JToken> .Run(() => Utils.call_WEBAPI_Service("Post_AppSettings_Value", SaveParamValue));

            dynamic ddResp = new ExpandoObject();

            //dd = Newtonsoft.Json.JsonConvert.DeserializeObject(tmp.ToString());

            ddResp = Newtonsoft.Json.JsonConvert.DeserializeObject <dynamic>(strResp.ToString());



            //JToken str = await Task<JToken>.Run(() => Utils.call_WEBAPI_GETService("Establish_Serverconnection"));
            //dynamic dd = new ExpandoObject();
            ////dd = Newtonsoft.Json.JsonConvert.DeserializeObject(tmp.ToString());

            //dd = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(str.ToString());


            //bool ConnectionOK = (bool) dd.ConnectionOK;
            //if (ConnectionOK)
            //{
            //    MessageBox.Show("Connection established, WebAPI Address Saved Successfully...");
            //}
            //else
            //{
            //    MessageBox.Show("Failed to establish connection...");
            //}


            //dynamic ddata = new ExpandoObject();
            //ddata.paramName = "connectionstring";
            //ddata.paramValue = Properties.Settings.Default.informetriQConnectionString;
            //object jt = ddata;
            //string strr = Newtonsoft.Json.JsonConvert.SerializeObject(jt);

            //JToken str = await Task<JToken>.Run(() => Utils.call_WEBAPI_Service("Save_ServerConfig", strr));
            //dynamic dd = new ExpandoObject();
            ////dd = Newtonsoft.Json.JsonConvert.DeserializeObject(tmp.ToString());

            //dd = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(str.ToString());


            bool ConnectionOK = (bool)ddResp.saved;

            if (ConnectionOK)
            {
                Properties.Settings.Default.VersionPlatform = (string)ddResp.platform;
                Properties.Settings.Default.Save();
                string msg = "Connection established, Configuration Saved Successfully...";
                //MessageBox.Show(msg);
                AlertForm1 al = new AlertForm1(msg);
                al.ShowDialog();
            }
            else
            {
                AlertForm1 al = new AlertForm1((string)ddResp.resp, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.error);
                al.ShowDialog();
                //MessageBox.Show((string)dd.message);
            }

            pix_webSetting.Visible = false;
        }
Esempio n. 21
0
        private void btn_enroll_Click(object sender, EventArgs e)
        {
            bool runNextPhase = false;

            // Task.Factory.StartNew(() =>
            Thread.Sleep(1000);
            try
            {
                //_streaming = false;
                //_capture = new Capture();

                {
                    //Task.Run(() =>
                    //{
                    if (_fpScanner == null)
                    {
                        // OpenSelectFGDialog();
                        // runNextPhase = true;

                        throw new Exception("Device not connected..");
                    }
                    //}).Wait();
                    else
                    {
                        //CloseScanner();
                        //connect_Device();
                        //_fpScanner = FingerPrintScanner;
                        //Task.Run(() =>
                        //{
                        if (!EnterUsernameForm_hidden)
                        {
                            //EnrollmentWindow_new enrollmentWindow = new EnrollmentWindow_new(_fpScanner, _afis);
                            //EnrollmentWindow_new enrollmentWindow = new EnrollmentWindow_new(_fpScanner, _afis,
                            enterUsernameWindow = new EnterUsernameWindow_new(true, this);
                            //enterUsernameWindow.Owner = this;
                            enterUsernameWindow.Activate();
                            var dg = enterUsernameWindow.ShowDialog();
                        }
                        else
                        {
                            enterUsernameWindow.Activate();
                            enterUsernameWindow.reloadForm();
                            var ddg = enrollmentWindow.ShowDialog();
                        }
                        // var dg = enterUsernameWindow.ShowDialog();
                        //}).Wait();
                        //EnterUsernameWindow_new enterUsernameWindow = new EnterUsernameWindow_new(true);
                        ////enterUsernameWindow.Owner = this;
                        //var dg = enterUsernameWindow.ShowDialog();

                        if ((bool)enterUsernameWindow.DialogResponse.result) //this.Close();

                        {
                            try
                            {
                                _afis = new LocalAFIS();

                                if (!enrollForm_hidden)
                                {
                                    //EnrollmentWindow_new enrollmentWindow = new EnrollmentWindow_new(_fpScanner, _afis);
                                    //EnrollmentWindow_new enrollmentWindow = new EnrollmentWindow_new(_fpScanner, _afis,
                                    enrollmentWindow = new EnrollmentWindow_new(_fpScanner, _afis,
                                                                                loggedin_staff, enterUsernameWindow.DialogResponse.enteredUsername, this);

                                    var ddg = enrollmentWindow.ShowDialog();
                                }
                                else
                                {
                                    enrollmentWindow.reloadForm(enterUsernameWindow.DialogResponse.enteredUsername);
                                    //var ddg =
                                    enrollmentWindow.Show();
                                }
                            }
                            catch (Exception ex) {
                                AlertForm1 al = new AlertForm1(ex.Message, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.error);
                                al.ShowDialog();
                            }
                        }
                    }
                    //testForm1 tf = new testForm1();
                    //tf.Show();
                }

                //).Wait();
            }
            catch (Exception ex)
            {
                //MetroMessageBox.Show(this,ex.ToString(), "Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
                AlertForm1 al = new AlertForm1(ex.Message, AlertForm1.AlertOptions.OK);
                al.ShowDialog();

                //MessageBox.Show(ex.ToString(), "Error");
                runNextPhase = false;
            }
            //return 1;

            // .ContinueWith((_)=>

            //if (runNextPhase)
            {
                // Task.Run(() =>
                //await Task.Run(() =>
                //StopCapturing();
                //ResetGUI();

                //DisplayMessage("User enrollment");
                //xamlListBoxUsers.SelectedIndex = -1; //Deselect User
                //Task.Factory.StartNew(() =>
                {
                    //try
                    //{
                    //    _afis = new LocalAFIS();
                    //    //EnrollmentWindow_new enrollmentWindow = new EnrollmentWindow_new(_fpScanner, _afis);
                    //    EnrollmentWindow_new enrollmentWindow = new EnrollmentWindow_new(_fpScanner, _afis, loggedin_staff);
                    //    //enrollmentWindow.MdiParent = this;
                    //    enrollmentWindow.StartPosition = FormStartPosition.CenterScreen;
                    //    // EnrollmentWindow enrollmentWindow = new EnrollmentWindow(_fpScanner, _afis);
                    //    //enrollmentWindow.Owner = this;
                    //    //enrollmentWindow.Show();
                    //    enrollmentWindow.Show();
                    //}
                    //catch { }
                }
                //return 2;
                //).Wait();
            }

            //if (enrollmentWindow.DialogResult)
            ////if (enrollmentWindow.DialogResult.HasValue && enrollmentWindow.DialogResult.Value)
            //{
            //    UpdateUserList();
            //}

            //DisplayMessage("Select User to verify");
        }
Esempio n. 22
0
        private async void NewServerConnetionMethod_NEW(bool suppressMsg = false)
        {
            try
            {
                string serverName;       // = comboBox1.SelectedValue.ToString() ;
                //Server server;
                Boolean cmanualflag = ch_useDirect.Checked;

                serverName = ((cb_datasource.Items.Count == 0) ? "" : cb_datasource.SelectedValue.ToString());

                if ((serverName.Trim() == "") || (cmanualflag))
                {
                    serverName = txt_serverAddress.Text.Trim();    //      ToString();
                    SqlConnection    sqlj = getNewSqlConnection(serverName, txt_userID.Text, txt_pwd.Text);
                    ServerConnection scip = new ServerConnection(sqlj);


                    String dbname   = txt_serverSource.Text.Trim();
                    String con_str  = ConfigurationManager.ConnectionStrings["APPDIRECT"].ConnectionString;
                    String con_str1 = con_str.Replace("SERVERNAME", serverName);
                    con_str1 = con_str1.Replace("DBNAME", dbname);
                    con_str1 = con_str1.Replace("USERNAME", txt_userID.Text.Trim());
                    con_str1 = con_str1.Replace("PASSWORD", txt_pwd.Text.Trim());

                    Properties.Settings.Default.informetriQConnectionString = con_str1;
                    // MessageBox.Show(con_str1);
                    txt_connection.Text = con_str1;
                    Properties.Settings.Default.CONNECTIONMODE = "1";

                    Properties.Settings.Default.Save();


                    dynamic dd = new ExpandoObject();
                    dd.ConnectionString = con_str1;
                    dd.DB_userID        = txt_userID.Text;

                    Object ob         = dd;
                    string paramValue = Newtonsoft.Json.JsonConvert.SerializeObject(dd);


                    //txt_response.Text = Post(str);
                    //string txt_response = VERIFY_List_templateFormat(str);
                    //string txt_response = Utils.call_WEBAPI_Service("VERIFY_templateFormat", str);
                    string txt_response = await Task.Run(() => Utils.call_WEBAPI_Service("TEST_ServerConnectionSP", paramValue));

                    string  sstr = txt_response;
                    dynamic dm   = new ExpandoObject();
                    dm = Newtonsoft.Json.JsonConvert.DeserializeObject <dynamic>(sstr);

                    // MessageBox.Show((string)dm.msg);
                    if ((bool)dm.success)
                    {
                        AlertForm1 al = new AlertForm1((string)dm.msg, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.success);
                        al.ShowDialog();
                    }
                    else
                    {
                        throw new Exception((string)dm.msg);
                    }
                }
            }
            catch (Exception ex)
            {
                AlertForm1 al = new AlertForm1(ex.Message, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.error);
                al.ShowDialog();
            }
        }
Esempio n. 23
0
        private void BWWorker_Login_DoWork(object sender, DoWorkEventArgs e)
        {
            //switch (checkfor_USER())
            {
                if (checkfor_USER() == "Login Successful")
                {
                    //MessageBox.Show("Login Successful", "Access Granted...");

                    AlertForm1 al = new AlertForm1("Access Granted...", AlertForm1.AlertOptions.OK,
                                                   AlertForm1.AlertType.success, "Login Successful");
                    al.ShowDialog();


                    //MetroMessageBox.Show(this,"Login Successful", "Access Granted...",MessageBoxButtons.OK,MessageBoxIcon.Information);
                    //current_user = ic.currentUSER = cbo_userName.Text;
                    current_user = cbo_userName.Text;
                    Properties.Settings.Default.currentUSER_pwd = txt_PWD.Text;
                    Properties.Settings.Default.Save();
                    // ic.SELECT_MAINDEVICE();
                    //
                    //string str = "";
                    //Task.Factory.StartNew(() => timer1_start())
                    //    .ContinueWith(t=>str=t.Result,TaskScheduler.FromCurrentSynchronizationContext());
                    //dynamic dm = new ExpandoObject();

                    icc.userProfile    = qq; // qq.role = "Enrol";
                    icc.loggedin_staff = current_user;
                    icc.ActivateButtonRoles();
                    Close();

                    //var task = new Task(() => timer1_start());
                    //task.Start();
                    //t.Start();
                    // MainForm mm = new MainForm(this);
                    //mm.Show();

                    //this.WindowState = FormWindowState.Minimized;
                    // break;
                }
                else if (checkfor_USER() == "reset")
                {
                    changePasswordMethod();
                    //break;

                    //default: MessageBox.Show("Invalid User credential", "Access Denied...");
                    //            break;
                }
                else
                {
                    AlertForm1 al = new AlertForm1("Access Denied...", AlertForm1.AlertOptions.OK,
                                                   AlertForm1.AlertType.error, "Login failed");
                    al.ShowDialog();
                }
            }


            //if (!checkfor_USER())
            //{

            //    //checkbackDOOR()
            //    //if (!checkfor_USER())
            //    {
            //        MessageBox.Show("Invalid User credential", "Access Denied...");
            //        //Application.Exit();
            //    }
            //}
            //else
            //{

            //    //role = "admin";
            //    current_user = ic.currentUSER = cbo_userName.Text;
            //    Properties.Settings.Default.currentUSER_pwd = txt_PWD.Text; ;

            //    Close();
            //}
        }
Esempio n. 24
0
        private void OpenSelectDeviceDialog_setup(DeviceIdentity selectedDeviceIdentity)
        {
            bool runNextPhase = true;

            //ResetGUI();
            //DisplayMessage("Device configuration");
            //EnableGUI(false);

            try
            {
                //IWin32Window win32Window = new WindowWrapper(this);
                SelectDeviceWindow_new selectDevice = new SelectDeviceWindow_new(selectedDeviceIdentity, this);
                if (_fpScanner != null)
                {
                    selectDevice.FingerPrintScanner = _fpScanner;
                }

                selectDevice.ShowDialog();

                if (selectDevice.rDialogResult)
                //if (selectDevice.rDialogResult.HasValue && selectDevice.DialogResult.Value)
                {
                    // DisplayMessage("Opening device");

                    _fpScanner = selectDevice.FingerPrintScanner;
                    //ic._fpScanner = _fpScanner;
                    if (_fpScanner != null)
                    {
                        //ResetGUI();
                        //EnableGUI(true);
                    }
                    // runNextPhase = true;

                    // NewUserRegistraion_popup();
                    ////EnterUsernameWindow_new
                    //EnterUsernameWindow_new enterUsernameWindow = new EnterUsernameWindow_new(true);
                    ////enterUsernameWindow.Owner = this;
                    //enterUsernameWindow.ShowDialog();

                    //if ((bool)enterUsernameWindow.DialogResponse.result) //this.Close();

                    //{
                    //    try
                    //    {
                    //        _afis = new LocalAFIS();
                    //        if (!enrollForm_hidden)
                    //        {
                    //            //EnrollmentWindow_new enrollmentWindow = new EnrollmentWindow_new(_fpScanner, _afis);
                    //            //EnrollmentWindow_new enrollmentWindow = new EnrollmentWindow_new(_fpScanner, _afis,
                    //            enrollmentWindow = new EnrollmentWindow_new(_fpScanner, _afis,
                    //               loggedin_staff, enterUsernameWindow.DialogResponse.enteredUsername, this);
                    //            //enrollmentWindow.MdiParent = this;
                    //            //enrollmentWindow.StartPosition = FormStartPosition.CenterScreen;
                    //            // EnrollmentWindow enrollmentWindow = new EnrollmentWindow(_fpScanner, _afis);
                    //            //enrollmentWindow.Owner = this;
                    //            //enrollmentWindow.Show();
                    //            var ddg = enrollmentWindow.ShowDialog();
                    //        }
                    //        else
                    //        {
                    //            enrollmentWindow.reloadForm(enterUsernameWindow.DialogResponse.enteredUsername);
                    //            var ddg = enrollmentWindow.ShowDialog();
                    //        }
                    //    }
                    //    catch { }

                    //}
                }
                else
                {
                    //DisplayError("No device selected");


                    //DialogResult msg = MessageBox.Show("Kindly connect your fingerprint Device and Retry", "No device selected"
                    //    , MessageBoxButtons.RetryCancel, MessageBoxIcon.Information);


                    AlertForm1 al = new AlertForm1("Kindly connect your fingerprint Device and Retry",
                                                   AlertForm1.AlertOptions.RETRYCANCEL
                                                   , AlertForm1.AlertType.error, "No device selected");
                    var aa = al.ShowDialog();

                    if (!al.rDialogResult)
                    //if (msg == DialogResult.Cancel)
                    {
                        if (selectDevice.FingerPrintScanner != null)
                        {
                            selectDevice.FingerPrintScanner.Dispose();
                        }
                        runNextPhase = false;
                    }
                    else
                    {
                        OpenSelectDeviceDialog_setup(selectedDeviceIdentity);

                        //connect_Device();
                    }
                }
            }
            catch (Exception ex)
            {
                DisplayError(ex.Message);
            }
        }
Esempio n. 25
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            dynamic dm = new ExpandoObject();

            dm = Newtonsoft.Json.JsonConvert.DeserializeObject(strResponse);

            try
            {
                //individual_data ind =  Newtonsoft.Json.JsonConvert.DeserializeObject<individual_data>((string)dm.data.individual);
                //saveData(Newtonsoft.Json.JsonConvert.DeserializeObject(dm.data.individual));

                AlertForm1 fm  = new AlertForm1("Do you want to save Client Data?", AlertForm1.AlertOptions.YESNO, AlertForm1.AlertType.info);
                var        rst = fm.ShowDialog();

                if (fm.rDialogResult)
                {
                    dynamic ind = dm.data.individual;
                    //string profession_desc = dm.dataprofession_name;
                    //saveData(ind, profession_desc, strResponse);
                    if (ind != null)
                    {
                        dynamic newDM = new ExpandoObject();
                        JToken  token = JToken.Parse(dm.data.individual.ToString());
                        newDM.Data = JObject.Parse(token.ToString());

                        newDM.ProfessionDesc = dm.dataprofession_name;
                        token             = JToken.Parse(strResponse);
                        newDM.strResponse = JObject.Parse(token.ToString());
                        //newDM.strResponse.data.individual.about =  newDM.Data.about = "Available Online";;
                        newDM.strResponse.data.individual.about = newDM.Data.about =
                            newDM.Data.about != null?Utils.TrimNonAscii((string)newDM.Data.about) : "Not Provided";



                        dynamic ind2 = new ExpandoObject();
                        ind2.mydata = newDM;
                        object rr = ind2;

                        string strBody      = Newtonsoft.Json.JsonConvert.SerializeObject(rr);
                        string strResponse1 = "";
                        Task.Run(() =>
                        {
                            strResponse1 = Utils.call_WEBAPI_Service("submit_individualOnlineData", strBody);
                        }).Wait();

                        dynamic dmd = new ExpandoObject();
                        dmd = Newtonsoft.Json.JsonConvert.DeserializeObject <dynamic>(strResponse1);

                        if ((bool)dmd.ok)
                        {
                            AlertForm1 fm2  = new AlertForm1((string)dmd.Message, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.success);
                            var        rst2 = fm2.ShowDialog();
                        }
                        else
                        {
                            throw new Exception((string)dmd.Message);
                        }
                    }
                    else
                    {
                        throw new Exception("Client Data cannot be empty");
                    }
                }
            }
            catch (Exception ex)
            {
                AlertForm1 fm  = new AlertForm1(ex.Message, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.error);
                var        rst = fm.ShowDialog();
            }
        }
        private void NewMethod_selectDevice()
        {
            InitializeComponent();

            this.Closing += SelectDeviceWindow_Closing;

            displayMessage("Loading Devices");
            xamlButtonOK.Enabled = true;

            //_thread = new Thread(() =>
            Task.Run(() =>
            {
                try
                {
                    DeviceInformations[] dinfos = FPScanner.GetAttachedDevices(_selectedDeviceIdentity); //Get all Fingerprint Scanners

                    //Display all Fingerprint-Scanners in GUI
                    // Application.Current.Dispatcher.BeginInvoke((Action)(() =>
                    {
                        xamlProgressBar.Visible = false;
                        displayMessage("Select Fingerprint-Scanner");
                        foreach (DeviceInformations dinfo in dinfos)
                        {
                            DeviceInfos di = new DeviceInfos(dinfo.index, dinfo.name);
                            xamlListBoxDevices.Items.Add(di);
                        }
                        if (xamlListBoxDevices.Items.Count > 1)
                        {
                            xamlListBoxDevices.SelectedIndex = 0;
                            //NewMethodcaptureDevice_();
                            //xamlButtonOK.Enabled = true;
                        }
                        else if (xamlListBoxDevices.Items.Count == 1)
                        {
                            this.Hide();
                            xamlListBoxDevices.SelectedIndex = 0;
                            //xamlButtonOK.Enabled = false;
                            NewMethodcaptureDevice_();
                        }
                        else if (xamlListBoxDevices.Items.Count == 0)
                        {
                            this.Hide();
                            //xamlListBoxDevices.SelectedIndex = 0;
                            //xamlButtonOK.Enabled = false;
                            //NewMethodcaptureDevice_();
                            throw new Exception("No device Detected, make sure Scanner is attached and retry");
                            //rDialogResult = false;
                        }


                        //Close();
                    }

                    //));
                    //NewMethodcaptureDevice_();
                }
                catch (Exception ex)
                {
                    //Application.Current.Dispatcher.BeginInvoke((Action)(() =>
                    {
                        rDialogResult = false;

                        AlertForm1 al = new AlertForm1(ex.Message,
                                                       AlertForm1.AlertOptions.OK
                                                       , AlertForm1.AlertType.error, "ERROR Encountered");
                        al.ShowDialog();

                        //MessageBox.Show(ex.Message, "ERROR Encountered",MessageBoxButtons.OK,MessageBoxIcon.Error);
                        Close();
                    }

                    //));
                }
            }).Wait(500);
            //_thread.Start();
            //Close();
        }
Esempio n. 27
0
        private void btn_Identification_Click(object sender, EventArgs e)
        {
            bool runNextPhase = false;

            // Task.Factory.StartNew(() =>
            Thread.Sleep(1000);
            try
            {
                //_streaming = false;
                //_capture = new Capture();

                {
                    //Task.Run(() =>
                    //{
                    if (_fpScanner == null)
                    {
                        //MetroMessageBox.Show(this,ex.ToString(), "Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
                        //AlertForm1 al = new AlertForm1("Device is not connected", AlertForm1.AlertOptions.OK);
                        //al.ShowDialog();
                        throw new Exception("Device is not connected");
                        //OpenSelectFGDialog();
                        //runNextPhase = true;

                        //return;
                    }
                    //}).Wait();
                    else
                    {
                        //if ((bool)enterUsernameWindow.DialogResponse.result) //this.Close();

                        {
                            try
                            {
                                _afis = new LocalAFIS();

                                if (!identifyForm_hidden)
                                {
                                    //EnrollmentWindow_new enrollmentWindow = new EnrollmentWindow_new(_fpScanner, _afis);
                                    //EnrollmentWindow_new enrollmentWindow = new EnrollmentWindow_new(_fpScanner, _afis,
                                    IdentifyWindow = new IdentificationWindow(_fpScanner, _afis,
                                                                              loggedin_staff, "Identification Request", this);

                                    //IdentifyWindow.Show();
                                    IdentifyWindow.Activate();
                                    var ddg = IdentifyWindow.ShowDialog();
                                }
                                else
                                {
                                    //IdentifyWindow.reloadForm("Identification Request");
                                    //var ddg =

                                    //IdentifyWindow.Show();
                                    IdentifyWindow.Activate();
                                    var ddg = IdentifyWindow.ShowDialog();
                                }
                            }
                            catch (Exception ex)
                            {
                                AlertForm1 al = new AlertForm1(ex.ToString(), AlertForm1.AlertOptions.OK);
                                al.ShowDialog();
                            }
                        }
                    }
                    //testForm1 tf = new testForm1();
                    //tf.Show();
                }

                //).Wait();
            }
            catch (Exception ex)
            {
                //MetroMessageBox.Show(this,ex.ToString(), "Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
                AlertForm1 al = new AlertForm1(ex.Message, AlertForm1.AlertOptions.OK);
                al.ShowDialog();

                //MessageBox.Show(ex.ToString(), "Error");
                runNextPhase = false;
            }
        }
Esempio n. 28
0
        private void xamlButtonOK_Click(object sender, EventArgs e)
        {
            nDialogResult = false;
            //if (!Utils.check_usernames_exist(_username))
            String  enteredUsername = xamlTextBoxUsername.Text.Trim();
            dynamic found           = Utils.check_InternetID_exist(enteredUsername);

            //found.status = true;
            //found.idstring = ds2.idString;
            //found.username = ds2.username;
            //found.remark = "Enrolled Already";


            if (enteredUsername.Length == 0)
            {
                AlertForm1 al = new AlertForm1(found.remark, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.error);
                al.ShowDialog();

                DialogResponse.result = false;
                //MessageBox.Show("Username must not be empty.");
            }
            else
            {
                if ((bool)found.status)
                {
                    if ((bool)found.enrolled)
                    {
                        string values    = found.username;
                        string keyvalues = found.idstring;

                        //DialogResult rsp =  MessageBox.Show("Client already Enrolled......"+Environment.NewLine+"Username => "+values +
                        //     Environment.NewLine + "Internat ID Number => " + keyvalues,
                        //     "Duplicate Check",MessageBoxButtons.RetryCancel,MessageBoxIcon.Information);

                        nDialogResult = false;

                        AlertForm1 al = new AlertForm1(found.remark + Environment.NewLine + "Username => " + values +
                                                       Environment.NewLine + "Internat ID Number => " + keyvalues,
                                                       AlertForm1.AlertOptions.RETRYCANCEL, AlertForm1.AlertType.error, "Duplicate Check");
                        var aa = al.ShowDialog();

                        //Utils.show_ClientExist(enteredUsername);
                        DialogResponse.result = false;
                        if (!al.rDialogResult)
                        //if (rsp == DialogResult.Cancel)
                        {
                            this.Close();
                            // Hide();
                            // this.WindowState = FormWindowState.Minimized;
                            // sidebar_form.EnterUsernameForm_hidden = true;
                        }
                    }
                    else
                    {
                        //Clien data downloaded but yet to enroll
                        DialogResponse.result          = true;
                        DialogResponse.enteredUsername = enteredUsername;
                        _username = enteredUsername;
                        //ic._username = enteredUsername;
                        //ic.enterUsernameWindow_return(enteredUsername);
                        //ic.loggedin_staff = lo;
                        nDialogResult = true;

                        AlertForm1 al = new AlertForm1(found.remark, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.info);
                        al.ShowDialog();

                        // Utils.show_ClientExist(enteredUsername);

                        this.Close();
                        // Hide();
                        // this.WindowState = FormWindowState.Minimized;
                        // sidebar_form.EnterUsernameForm_hidden = true;
                        //Utils.gen_barcode(pixBarcode, enteredUsername);
                    }
                }

                else
                {
                    DialogResponse.result          = false;
                    DialogResponse.enteredUsername = enteredUsername;
                    _username = enteredUsername;
                    //ic._username = enteredUsername;
                    //ic.enterUsernameWindow_return(enteredUsername);
                    //ic.loggedin_staff = lo;
                    nDialogResult = true;


                    string msg = found.remark + Environment.NewLine + "Make sure you Download Online Data before you start Finger Capture..";



                    AlertForm1 al = new AlertForm1(msg, AlertForm1.AlertOptions.OK, AlertForm1.AlertType.info);
                    al.ShowDialog();

                    // Utils.show_ClientExist(enteredUsername);

                    this.Close();
                    // Hide();
                    // this.WindowState = FormWindowState.Minimized;
                    // sidebar_form.EnterUsernameForm_hidden = true;
                    //Utils.gen_barcode(pixBarcode, enteredUsername);
                }
            }
        }
Esempio n. 29
0
        private void NewMethod_callService2()
        {
            Task.Run(() =>
            {
                {
                    // displayMessage("Verifying Template File.....", Utils.COLOR_DERMALOG_RED);
                    strResponse = Utils.call_WEBAPI_GETService("infometriq-partner-api/individuals");
                    /// strResponse = Utils.call_WEBAPI_GETService("infometriq-partner-api/individuals");
                }
            }
                     ).Wait();


            AlertForm1 fm = new AlertForm1("Client Data Received Successfully.....");

            fm.ShowDialog();

            pix_login.Visible = false;

            try
            {
                dynamic dm = new ExpandoObject();
                dm = JObject.Parse((string)Newtonsoft.Json.JsonConvert.DeserializeObject(strResponse));

                string id = dm.data.individual.id;
                lb_firstname.Text = dm.data.individual.first_name;
                lb_lastname.Text  = dm.data.individual.last_name;
                //txt_username.Text =
                lb_username.Text = dm.data.individual.username;
                lb_email.Text    = dm.data.individual.email;
                lb_DOB.Text      = DateTime.Parse((string)dm.data.individual.dob).ToString("MMMM dd yyyy");
                //txt_state.Text = dm.data.individual.state;
                lb_country.Text = dm.data.individual.country;
                //txt_profession.Text = dm.data.individual.profession;
                lb_profession.Text = dm.data.profession_name;
                //string about = dm.data.individual.about;
                lb_phone.Text = dm.data.individual.phone;
                //string website = dm.data.individual.website;
                lb_gender.Text = dm.data.individual.gender;
                string confirmation_code = dm.data.individual.confirmation_code;
                lb_confirmationCode.Text = dm.data.individual.confirmation_code;
                //string social_facebook = dm.data.individual.social_facebook;
                //string social_twitter = dm.data.individual.social_twitter;
                //string social_instagram = dm.data.individual.social_instagram;
                //string social_linkedin = dm.data.individual.social_linkedin;
                //string social_youtube = dm.data.individual.social_youtube;
                //string politics = dm.data.individual.politics;
                // string recognition = dm.data.individual.recognition;
                //string hide_dob = dm.data.individual.hide_dob;
                lb_accountType.Text    = dm.data.individual.account_type;
                lb_status.Text         = dm.data.individual.status;
                lb_verifiedStatus.Text = dm.data.individual.verified_status;
                lb_createDT.Text       = DateTime.Parse((string)dm.data.individual.created_on).ToString("MMMM dd yyyy");
                //string last_updated_on = dm.data.individual.last_updated_on;
                //string state_name = dm.data.individual.state_name;
                lb_state.Text    = dm.data.individual.state_name;
                Pix_client.Image = Utils.Base64TOImage((string)dm.data.picture);
                Pix_client.Refresh();
                genBarcode(confirmation_code);

                Utils.showAnimation(Pix_client, bunifuTransition1);
            }
            catch (Exception ex) { }
        }