Ejemplo n.º 1
0
        void crewverification(List <CrewImmigration> immigration, int RowIndex)
        {
            tblUCDate.Text = DateTime.Now.ToString("MM/dd/yyyy") + " [" + DateTime.Now.ToString("hh:mm tt") + "]";

            if (immigration.Count > 0)
            {
                txtUniqeID.Text   = immigration[RowIndex].SeaparerID.ToString();
                txtTelephone.Text = immigration[RowIndex].ContactNo;

                txtPassportNo.Text   = immigration[RowIndex].PassportNo;
                txtNationality.Text  = immigration[RowIndex].Nationality;
                txtLastName.Text     = immigration[RowIndex].LastName;
                txtFirstName.Text    = immigration[RowIndex].FirstName;
                txtLOEControlNo.Text = immigration[RowIndex].LOEControlNumber;
                txtExpiration.Text   = immigration[RowIndex].PassportExpiredate;
                txtDateOffBirth.Text = immigration[0].DateOfBirth == null ? "" : GlobalCode.Field2DateTime(immigration[0].DateOfBirth).ToString("MM/dd/yyyy");

                txtOtherComment.Text        = immigration[RowIndex].OtherDetail;
                uoHiddenFieldOldOther.Value = txtOtherComment.Text;
                txtEmailAdd.Text            = immigration[RowIndex].EmailAdd;

                //txtBrand.Text = immigration[0].Brand;
                //txtJoindate.Text = immigration[0].SignOnDate.ToString();
                //txtJoinShip.Text = immigration[0].Vessel;
                //txtJoinPort.Text = immigration[0].Seaport;
                //txtJoinCity.Text = immigration[0].Seaport;
                //txtPosition.Text = immigration[0].Rank;
                //txtPosition.Text = immigration[0].Rank;

                if (txtLOEControlNo.Text == "")
                {
                    txtLOEControlNo.BackColor = System.Drawing.Color.Red;
                    txtLOEControlNo.ToolTip   = "No LOE Available";

                    immigration[0].SignOnDate = null;
                    immigration[0].DateHired  = null;
                }
                else
                {
                    txtLOEControlNo.BackColor = System.Drawing.Color.White;
                    txtLOEControlNo.ToolTip   = immigration[RowIndex].LOEControlNumber;

                    //btnApproved.Enabled = true;
                    //btnDecline.Enabled = true;
                }

                uoListViewCrewverification.DataSource = immigration;
                uoListViewCrewverification.DataBind();

                rdbFraudulentDoc.Checked    = GlobalCode.Field2Bool(immigration[RowIndex].IsFraudulentDoc);
                rdbOther.Checked            = GlobalCode.Field2Bool(immigration[RowIndex].IsOther);
                rdbPriorConDep.Checked      = GlobalCode.Field2Bool(immigration[RowIndex].IsPriorConDep);
                rdbPriorIIssue.Checked      = GlobalCode.Field2Bool(immigration[RowIndex].IsPriorImmigIssues);
                chkNew.Checked              = GlobalCode.Field2Bool(immigration[RowIndex].NewHire);
                chkReHire.Checked           = GlobalCode.Field2Bool(immigration[RowIndex].NewHire) == true ? false : true;
                uoHDFCrewVericationID.Value = immigration[RowIndex].CrewVericationID.ToString();

                //uoHiddenFieldServerdate.Value = immigration[RowIndex].ProcessDate.ToString();

                if (immigration[RowIndex].CrewVericationID > 0)
                {
                    if (immigration[RowIndex].IsApproved == true)
                    {
                        uoHiddenFieldAppDecMessage.Value = "This immigration entry was approved by " + immigration[RowIndex].UserName + " on " + GlobalCode.Field2TimeZoneTime(GlobalCode.Field2DateTime(immigration[RowIndex].ProcessDate), uoHiddenFieldTimeZoneID.Value).ToString() + " are you sure you would like to ";

                        tblUCDate.Text = DateTime.Now.ToString("MM/dd/yyyy") + " [" + DateTime.Now.ToString("hh:mm tt") + "]" + "       Assignment Status : Approved   ";
                    }
                    else
                    {
                        uoHiddenFieldAppDecMessage.Value = "This immigration entry was declined by " + immigration[RowIndex].UserName + " on " + GlobalCode.Field2TimeZoneTime(GlobalCode.Field2DateTime(immigration[RowIndex].ProcessDate), uoHiddenFieldTimeZoneID.Value).ToString() + " are you sure you would like to ";
                        tblUCDate.Text = DateTime.Now.ToString("MM/dd/yyyy") + " [" + DateTime.Now.ToString("hh:mm tt") + "]" + "       Assignment Status : Declined   ";
                    }
                }
                else
                {
                    tblUCDate.Text = DateTime.Now.ToString("MM/dd/yyyy") + " [" + DateTime.Now.ToString("hh:mm tt") + "]";
                }

                //if (HiddenFieldIsImage.Value == "0")
                //{
                //    if (immigration[0].SeafarerImage.Count > 0)
                //    {
                //        uoImageCM.ImageUrl = GlobalCode.Field2PictureImage(immigration[0].SeafarerImage[0].Image, immigration[0].SeafarerImage[0].ImageType);
                //    }
                //    else {
                //        uoImageCM.ImageUrl = "~/Images/no-profile-image.jpg";
                //    }
                //}
                //else
                //{
                //    uoImageCM.ImageUrl = HiddenFieldCMImage.Value;
                //}

                string URL   = ConfigurationManager.AppSettings["MediaURL"];
                string Token = ConfigurationManager.AppSettings["MediaToken"];

                VehicleImageFile img = new VehicleImageFile();
                GlobalCode       k   = new GlobalCode();
                img = k.GetPhoto(URL + "/avatars/jde/" + txtUniqeID.Text.ToString() + "?at=" + Token);


                if (img.Image == null)
                {
                    if (GlobalCode.Field2Long(immigration[0].CtracDetail.user_id) > 0)
                    {
                        VehicleImageFile cimg = new VehicleImageFile();
                        cimg = k.GetPhoto(URL + "/avatars/ctrac/" + GlobalCode.Field2String(immigration[0].CtracDetail.user_id) + "?at=" + Token);
                        if (cimg.Image != null)
                        {
                            uoImageCM.ImageUrl = "data:image/*;base64," + cimg.Image;
                        }
                        else
                        {
                            if (immigration[0].SeafarerImage.Count > 0)
                            {
                                uoImageCM.ImageUrl = GlobalCode.Field2PictureImage(immigration[0].SeafarerImage[0].Image, immigration[0].SeafarerImage[0].ImageType);
                            }
                            else
                            {
                                uoImageCM.ImageUrl = "~/Images/no-profile-image.jpg";
                            }
                        }
                    }
                    else
                    {
                        if (immigration[0].SeafarerImage.Count > 0)
                        {
                            uoImageCM.ImageUrl = GlobalCode.Field2PictureImage(immigration[0].SeafarerImage[0].Image, immigration[0].SeafarerImage[0].ImageType);
                        }
                        else
                        {
                            uoImageCM.ImageUrl = "~/Images/no-profile-image.jpg";
                        }
                    }
                }
                else
                {
                    uoImageCM.ImageUrl = "data:image/*;base64," + img.Image;
                }

                if (immigration[0].ImmigrationAirTransaction.Count > 0)
                {
                    uoListviewAir.DataSource = immigration[0].ImmigrationAirTransaction;
                    uoListviewAir.DataBind();
                }
                else
                {
                    uoListviewAir.DataSource = null;
                    uoListviewAir.DataBind();
                }

                if (immigration[0].ImmigrationHotelBooking.Count > 0)
                {
                    uoListViewHotelBook.DataSource = immigration[0].ImmigrationHotelBooking;
                    uoListViewHotelBook.DataBind();
                }
                else
                {
                    uoListViewHotelBook.DataSource = null;
                    uoListViewHotelBook.DataBind();
                }

                if (immigration[0].ImmigrationTransportion.Count > 0)
                {
                    uoListViewTransportation.DataSource = immigration[0].ImmigrationTransportion;
                    uoListViewTransportation.DataBind();
                }
                else
                {
                    uoListViewTransportation.DataSource = null;
                    uoListViewTransportation.DataBind();
                }

                if (immigration[0].ImmigrationTransportion.Count > 0)
                {
                    uoListViewTransportation.DataSource = immigration[0].ImmigrationTransportion;
                    uoListViewTransportation.DataBind();
                }
                else
                {
                    uoListViewTransportation.DataSource = null;
                    uoListViewTransportation.DataBind();
                }


                if (immigration[0].ImmigrationEmploymentHistory.Count > 0)
                {
                    uoListViewRecentEmployment.DataSource = immigration[0].ImmigrationEmploymentHistory;
                    uoListViewRecentEmployment.DataBind();
                }
                else
                {
                    uoListViewRecentEmployment.DataSource = null;
                    uoListViewRecentEmployment.DataBind();
                }

                if (immigration[0].Parent.Count > 0)
                {
                    uoListViewParent.DataSource = immigration[0].Parent;
                    uoListViewParent.DataBind();
                }
                else
                {
                    uoListViewParent.DataSource = null;
                    uoListViewParent.DataBind();
                }
            }
            else
            {
                uoImageCM.ImageUrl = "~/Images/no-profile-image.jpg";
            }
        }