Ejemplo n.º 1
0
        protected void btnSearch_click(object sender, EventArgs e)
        {
            try
            {
                string LoeNo    = "";
                string IDNumber = "";

                ImmigrationBLL BLL = new ImmigrationBLL();
                LoeNo    = txtLOEControlNo.Text;
                IDNumber = txtUniqeID.Text;

                if (IDNumber == "" && LoeNo == "")
                {
                    AlertMessage("Please enter Unique ID or LOE Control No to search crew verification.");
                    return;
                }
                ClearGridCrewVerification();

                List <CrewImmigration> Immigration = new List <CrewImmigration>();
                Immigration = BLL.CrewImmigration(0, GlobalCode.Field2Long(IDNumber), 0, LoeNo, "");

                Session["immigration"] = Immigration;

                if (Immigration.Count == 0)
                {
                    if (GlobalCode.Field2Long(IDNumber) > 0 && LoeNo == "")

                    {
                        txtUniqeID.Text = IDNumber.ToString();
                        AlertMessage("Unique ID does not exist in the system.");
                        txtUniqeID.Text = "";
                    }

                    else if (IDNumber == "" && LoeNo != "")
                    {
                        txtLOEControlNo.Text = LoeNo;
                        AlertMessage("This LOE is either invalid or does not exists in the system, please try search by Unique ID..");
                        txtLOEControlNo.Text = "";
                    }
                    else if (GlobalCode.Field2Long(IDNumber) > 0 && LoeNo != "")
                    {
                        txtLOEControlNo.Text = LoeNo;
                        txtUniqeID.Text      = IDNumber.ToString();
                        AlertMessage("This Unique ID and LOE combination does not exist in our system, please try seaching by Unique ID only");
                        txtLOEControlNo.Text = "";
                        txtUniqeID.Text      = "";
                    }
                    return;
                }

                crewverification(Immigration, 0);

                PageAsyncTask TaskPort1 = new PageAsyncTask(OnBeginExceptions, OnEndExceptions, null, "Async1", true);
                Page.RegisterAsyncTask(TaskPort1);
            }
            catch (Exception ex)
            { throw ex; }
        }
Ejemplo n.º 2
0
        public void OnEndExceptions(IAsyncResult ar)
        {
            List <SeafarerImage> SeafarerImage = new List <SeafarerImage>();
            QRCodeEncoder        rq            = new QRCodeEncoder();

            Bitmap myImage;
            List <CrewImmigration> Immigration = new List <CrewImmigration>();

            Immigration = (List <CrewImmigration>)Session["immigration"];
            for (var i = 0; Immigration.Count > i; i++)
            {
                myImage = rq.Encode(txtUniqeID.Text + "+" + Immigration[i].LOEControlNumber + "+" + Immigration[i].Joindate.Value.ToString("MMMM") + " " + Immigration[i].Joindate.Value.Day.ToString() + " " + Immigration[i].Joindate.Value.Year.ToString() + "+" + Immigration[i].Vessel + "+" + Immigration[i].Seaport);


                SeafarerImage.Add(new SeafarerImage
                {
                    Image      = GlobalCode.Field2BitmapByte(myImage),
                    ImageType  = "jpg",
                    LOENumber  = Immigration[i].LOEControlNumber,
                    SeaparerID = GlobalCode.Field2Long(txtUniqeID.Text),
                    LogInUser  = GlobalCode.Field2String(Session["UserName"])
                });
            }



            ImmigrationBLL BLL = new ImmigrationBLL();

            BLL.InsertQRCode(SeafarerImage);


            //foreach (ListViewItem item in Immigration.Items)
            //{
            //    txtJoindate = (TextBox)item.FindControl("txtJoindate");
            //    txtJoinShip = (TextBox)item.FindControl("txtJoinShip");
            //    txtJoinPort = (TextBox)item.FindControl("txtJoinPort");
            //    HPLOENumber = (HiddenField)item.FindControl("uoHiddenFieldControlNo");

            //    myImage = rq.Encode(txtUniqeID.Text + "+" + HPLOENumber.Value + "+" + txtJoindate.Text + "+" + txtJoinShip.Text + "+" + txtJoinPort.Text);


            //    SeafarerImage.Add(new SeafarerImage
            //    {
            //        Image = GlobalCode.Field2BitmapByte(myImage),
            //        ImageType = "jpg",
            //        LOENumber = HPLOENumber.Value,
            //        SeaparerID = GlobalCode.Field2Long(txtUniqeID.Text)
            //    });

            //}



            //if (immigration[0].SeafarerImage.Count > 0)
            //{
            //    uoImageCM.ImageUrl = GlobalCode.Field2PictureImage(GlobalCode.Field2BitmapByte(myImage), "jpg");
            //}
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Modified By:    Josephine Gad
        /// Modified Date:  27/08/2012
        /// Description:    Call function to get the page's default values if Load Type = 0
        /// ------------------------------------------------------------------------
        /// Modified By:    Josephine Gad
        /// Modified Date:  20/Dec/2013
        /// Description:    Add uoCheckBoxNeedTransportALL
        /// </summary>
        private void GetTravelCrewTravelWithCount()
        {
            try
            {
                ImmigrationBLL bll = new ImmigrationBLL();
                List <ImmigrationManifestList> listImmigration = new List <ImmigrationManifestList>();

                //List<CrewAdminGenericClass> list = new List<CrewAdminGenericClass>();
                bll.LoadImmigrationPage(GlobalCode.Field2TinyInt(uoHiddenFieldLoadType.Value),
                                        GlobalCode.Field2DateTime(uoHiddenFieldDate.Value), GlobalCode.Field2DateTime(uoHiddenFieldDate.Value),
                                        uoHiddenFieldUser.Value, uoHiddenFieldUserRole.Value, uoHiddenFieldOrderBy.Value, GlobalCode.Field2Int(Session["SeaportID"]),
                                        uoDropDownListFilterBy.SelectedValue, uoTextBoxFilter.Text.Trim(), uoDropDownListNationality.SelectedValue,
                                        uoDropDownListGender.SelectedValue, uoDropDownListRank.SelectedValue, uoRadioButtonListStatus.SelectedValue,
                                        GlobalCode.Field2TinyInt(uoDropDownListAirLeg.SelectedValue),
                                        0,
                                        0,
                                        0, uoListViewManifestPager.PageSize);

                uoLabelOnCount.Text  = GlobalCode.Field2Int(Session["Immigration_OnCount"]).ToString();
                uoLabelOffCount.Text = GlobalCode.Field2Int(Session["Immigration_OffCount"]).ToString();


                //uoListViewCrewAdmin.DataSource = null;
                uoListViewDetails.DataSourceID = "uoObjectDataSourceImmigration";
                uoListViewDetails.DataBind();

                //CheckBox chk = (CheckBox)uoListViewCrewAdminHeader.Controls[0].FindControl("uoCheckBoxNeedTransportALL");
                //if (uoRadioButtonListStatus.SelectedValue == "0" || uoRadioButtonListStatus.SelectedValue == "ON")
                //{
                //    chk.Visible = false;
                //}
                //else
                //{
                //    chk.Visible = true;
                //}
                //ListView1.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 4
0
        protected void btnApproved_click(object sender, EventArgs e)
        {
            try
            {
                ImmigrationBLL BLL = new ImmigrationBLL();

                if (uoListViewCrewverification.Items.Count == 0)
                {
                    AlertMessage("Crew member has no upcomming assigment, Please try other crew member! ");
                    return;
                }

                bool   IsApproved    = true;
                Button ApproveButton = (Button)sender;

                DateTime curDate = new DateTime();

                //curDate = GlobalCode.Field2DateTime("2015-05-05 16:11:28.680");
                //DateTime T = GlobalCode.Field2TimeZoneTime(GlobalCode.Field2DateTime("2015-05-05 16:11:28.680") , );


                if (ApproveButton.ID == "btnApproved")
                {
                    IsApproved = true;
                    rdbFraudulentDoc.Checked = false;
                    rdbPriorIIssue.Checked   = false;
                    rdbPriorConDep.Checked   = false;
                    rdbOther.Checked         = false;
                    txtOtherComment.Text     = "";
                }
                else
                {
                    IsApproved = false;
                }


                HiddenField uoCrewVericationID = null;
                HiddenField uoLOEControlNumber = null;

                HiddenField uoHDFVesselID = null;
                HiddenField uoHDFRankID   = null;

                TextBox txtJoindate = null;
                TextBox txtJoinPort = null;
                TextBox txtJoinCity = null;

                foreach (ListViewItem item in uoListViewCrewverification.Items)
                {
                    uoLOEControlNumber = (HiddenField)item.FindControl("uoHiddenFieldControlNo");
                    uoCrewVericationID = (HiddenField)item.FindControl("uoHiddenFieldCrewVericationID");

                    txtJoindate = (TextBox)item.FindControl("txtJoindate");
                    txtJoinPort = (TextBox)item.FindControl("txtJoinPort");
                    txtJoinCity = (TextBox)item.FindControl("txtJoinCity");


                    uoHDFRankID   = (HiddenField)item.FindControl("uoHDFRankID");
                    uoHDFVesselID = (HiddenField)item.FindControl("uoHDFVesselID");
                }



                List <CrewImmigration> Immigration = new List <CrewImmigration>();
                if (rdbOther.Checked == false)
                {
                    txtOtherComment.Text = "";
                }

                Immigration.Add(new CrewImmigration
                {
                    CrewVericationID = GlobalCode.Field2Long(uoCrewVericationID.Value),
                    SeaparerID       = GlobalCode.Field2Long(txtUniqeID.Text),

                    TravelReqID      = GlobalCode.Field2Long(uoHDFCrewVericationID.Value),
                    RecordLocator    = GlobalCode.Field2String(uoHDFRecordLocator.Value),
                    ItinerarySeqNo   = GlobalCode.Field2Int(uoHDFItinerarySeqID.Value),
                    LOEControlNumber = GlobalCode.Field2String(txtLOEControlNo.Text),

                    VesselID = GlobalCode.Field2Int(uoHDFVesselID.Value),
                    RankID   = GlobalCode.Field2Int(uoHDFRankID.Value),

                    Joindate = GlobalCode.Field2DateTime(txtJoindate.Text),
                    JoinPort = GlobalCode.Field2String(txtJoinPort.Text),
                    JoinCity = GlobalCode.Field2String(txtJoinCity.Text),

                    Reason             = 0,
                    IsFraudulentDoc    = GlobalCode.Field2Bool(rdbFraudulentDoc.Checked),
                    IsPriorImmigIssues = GlobalCode.Field2Bool(rdbPriorIIssue.Checked),
                    IsPriorConDep      = GlobalCode.Field2Bool(rdbPriorConDep.Checked),
                    IsOther            = GlobalCode.Field2Bool(rdbOther.Checked),
                    IsApproved         = GlobalCode.Field2Bool(IsApproved),
                    OtherDetail        = GlobalCode.Field2String(txtOtherComment.Text),
                    UserID             = GlobalCode.Field2String(uoHDFuserID.Value),
                });
                Immigration = BLL.InsertCrewImmigration(Immigration);

                Session["immigration"] = Immigration;

                int row = 0;

                if (Immigration.Count > 1)
                {
                    foreach (CrewImmigration item in Immigration)
                    {
                        if (item.CrewVericationID == GlobalCode.Field2Long(uoCrewVericationID.Value))
                        {
                            row = row + 1;
                        }
                    }
                }

                crewverification(Immigration, row);
            }
            catch (Exception ex)
            { throw ex; }
        }