Esempio n. 1
0
        /// <summary>
        /// Author:         Josephine Gad
        /// Created Date:   09/Jan/2013
        /// Description:    Export Manifest
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void uoButtonExport_Click(object sender, EventArgs e)
        {
            DataTable dt = null;

            try
            {
                dt = CrewAdminBLL.GetCrewAdminManifestExport(uoHiddenFieldUser.Value);
                if (dt.Rows.Count > 0)
                {
                    CreateFile(dt);
                }
                else
                {
                    AlertMessage("No Record to Export!");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
        ///// <summary>
        ///// Author:         Josephine Gad
        ///// Date Created:   27/Dec/2013
        ///// Description:    Edit Vehicle
        ///// </summary>
        //private void EditVehicle()
        //{
        //    try
        //    {
        //        DateTime currentDate = CommonFunctions.GetCurrentDateTime();
        //        CrewAdminBLL.EditVehicleManifest(uoTextBoxComment.Text, uoTextBoxPickupDate.Text, uoTextBoxPickupTime.Text,
        //            GlobalCode.Field2TinyInt(uoDropDownListFrom.SelectedValue), GlobalCode.Field2TinyInt(uoDropDownListTo.SelectedValue),
        //            uoHiddenFieldOtherFrom.Value, uoHiddenFieldOtherTo.Value,
        //            uoHiddenFieldUser.Value, uoTextBoxEmailAdd.Text, uoTextBoxCopy.Text, "",
        //            "Edit Transport",
        //            "EditVehicle", Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now);
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   23/Dec/2013
        /// Description:    Add/Cancel Vehicle
        /// </summary>
        private void AddCancelEditVehicle()
        {
            try
            {
                string sAddCancelEdit = "";
                string sDescription   = "";

                if (uoHiddenFieldIsEdit.Value == "1")
                {
                    sAddCancelEdit = "Edit";
                    sDescription   = "Edit Transport";
                }
                else
                {
                    sAddCancelEdit = "AddCancel";
                    sDescription   = "Add/Cancel Transport";
                }

                DateTime currentDate = CommonFunctions.GetCurrentDateTime();
                CrewAdminBLL.AddCancelVehicleManifest(uoTextBoxComment.Text, uoTextBoxConfirmedBy.Text, uoTextBoxPickupDate.Text, uoTextBoxPickupTime.Text,
                                                      GlobalCode.Field2TinyInt(uoDropDownListFrom.SelectedValue), GlobalCode.Field2TinyInt(uoDropDownListTo.SelectedValue),
                                                      uoHiddenFieldOtherFrom.Value, uoHiddenFieldOtherTo.Value,
                                                      uoHiddenFieldUser.Value, uoTextBoxEmailAdd.Text, uoTextBoxCopy.Text, "", sDescription,
                                                      "AddCancelEditVehicle", Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, sAddCancelEdit);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   27/Dec/2013
        /// Description:    Edit Vehicle
        /// </summary>
        private void EditVehicle()
        {
            DateTime currentDate = CommonFunctions.GetCurrentDateTime();

            CrewAdminBLL.EditVehicleManifest(uoTextBoxComment.Text, uoTextBoxPickupDate.Text, uoTextBoxPickupTime.Text,
                                             GlobalCode.Field2TinyInt(uoDropDownListFrom.SelectedValue), GlobalCode.Field2TinyInt(uoDropDownListTo.SelectedValue),
                                             uoHiddenFieldOtherFrom.Value, uoHiddenFieldOtherTo.Value,
                                             uoHiddenFieldUser.Value, uoTextBoxEmailAdd.Text, uoTextBoxCopy.Text, "",
                                             "Edit Transport in Crew Admin Page",
                                             "EditVehicle", Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now);
        }
Esempio n. 4
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
            {
                CrewAdminBLL bll = new CrewAdminBLL();
                List <CrewAdminGenericClass> list = new List <CrewAdminGenericClass>();
                //if (uoHiddenFieldLoadType.Value == "0")
                //{
                list = bll.LoadCrewListPage(GlobalCode.Field2TinyInt(uoHiddenFieldLoadType.Value),
                                            GlobalCode.Field2DateTime(uoHiddenFieldDate.Value), GlobalCode.Field2DateTime(uoHiddenFieldDate.Value),
                                            uoHiddenFieldUser.Value, uoHiddenFieldUserRole.Value, uoHiddenFieldOrderBy.Value, GlobalCode.Field2Int(Session["VesselID"]),
                                            uoDropDownListFilterBy.SelectedValue, uoTextBoxFilter.Text.Trim(), uoDropDownListNationality.SelectedValue,
                                            uoDropDownListGender.SelectedValue, uoDropDownListRank.SelectedValue, uoRadioButtonListStatus.SelectedValue,
                                            GlobalCode.Field2TinyInt(uoDropDownListAirLeg.SelectedValue),
                                            GlobalCode.Field2TinyInt(uoDropDownListRouteFrom.SelectedValue),
                                            GlobalCode.Field2TinyInt(uoDropDownListRouteTo.SelectedValue),
                                            0, uoListViewManifestPager.PageSize);
                //}
                //if (uoHiddenFieldLoadType.Value == "0")
                //{
                BindControls(list);
                //}
                uoHiddenFieldLoadType.Value = "0";

                uoListViewCrewAdmin.DataSource   = null;
                uoListViewCrewAdmin.DataSourceID = "uoObjectDataSourceCrewAdmin";
                uoListViewCrewAdmin.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;
            }
        }
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   Dec/26/2013
        /// Description:    Bind List and Add/Cancel Transportation
        /// </summary>
        private void GetVehicleToEdit()
        {
            DataTable dt = null;

            try
            {
                if (GlobalCode.Field2String(Request.QueryString["Edit"]) == "")
                {
                    AlertMessage("No record to process!");
                }
                else
                {
                    string[] sAddCancelArr = Request.QueryString["Edit"].Split(",".ToCharArray());
                    string[] sIDBigintArr  = Request.QueryString["RecLoc"].Split(",".ToCharArray());
                    string[] sIDTReqArr    = Request.QueryString["TReqID"].Split(",".ToCharArray());
                    string[] sIDTrans      = Request.QueryString["TransID"].Split(",".ToCharArray());

                    int i      = 0;
                    int iTotal = sAddCancelArr.Count();
                    List <CrewAdminTransportAddCancel> list = new List <CrewAdminTransportAddCancel>();
                    CrewAdminTransportAddCancel        item = new CrewAdminTransportAddCancel();

                    for (i = 0; i < iTotal; i++)
                    {
                        item           = new CrewAdminTransportAddCancel();
                        item.AddCancel = GlobalCode.Field2String(sAddCancelArr[i]);
                        item.IDBigint  = GlobalCode.Field2Int(sIDBigintArr[i]);
                        item.TReqID    = GlobalCode.Field2Int(sIDTReqArr[i]);
                        item.TransID   = GlobalCode.Field2Int(sIDTrans[i]);
                        list.Add(item);
                    }
                    dt = getDataTable(list);

                    DateTime currentDate = CommonFunctions.GetCurrentDateTime();
                    CrewAdminBLL.GetVehicleToEdit(dt, uoHiddenFieldUser.Value, "Edit Transport in Crew Admin Page",
                                                  "GetVehicleToEdit", Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now);

                    List <VehicleVendorEmail> listEmail = new List <VehicleVendorEmail>();
                    if (Session["CrewAdminTranspo_VehicleEmailList"] != null)
                    {
                        listEmail = (List <VehicleVendorEmail>)Session["CrewAdminTranspo_VehicleEmailList"];
                    }
                    if (listEmail.Count > 0)
                    {
//                        uoTextBoxEmailAdd.Text = listEmail[0].VehicleEmailTo;
                        uoTextBoxVehicleVendor.Text = listEmail[0].VehicleName;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   Dec/26/2013
        /// Description:    Bind List and Add/Cancel Transportation
        /// </summary>
        private void GetVehicleToEdit()
        {
            bool bIsFromCrewAdminAll = false;

            if (GlobalCode.Field2String(Request.QueryString["IsFromCrewAdmiAll"]) == "")
            {
                bIsFromCrewAdminAll = false;
            }
            else
            {
                bIsFromCrewAdminAll = true;
            }

            DataTable dt = null;

            try
            {
                if (GlobalCode.Field2String(Request.QueryString["AddCancel"]) == "")
                {
                    AlertMessage("No record to process!");
                }
                else
                {
                    string[] sAddCancelArr = Request.QueryString["AddCancel"].Split(",".ToCharArray());
                    string[] sIDBigintArr  = Request.QueryString["RecLoc"].Split(",".ToCharArray());
                    string[] sIDTReqArr    = Request.QueryString["TReqID"].Split(",".ToCharArray());
                    string[] sIDTrans      = Request.QueryString["TransID"].Split(",".ToCharArray());

                    int i      = 0;
                    int iTotal = sAddCancelArr.Count();
                    List <CrewAdminTransportAddCancel> list = new List <CrewAdminTransportAddCancel>();
                    CrewAdminTransportAddCancel        item = new CrewAdminTransportAddCancel();

                    if (iTotal > 0)
                    {
                        for (i = 0; i < iTotal; i++)
                        {
                            item           = new CrewAdminTransportAddCancel();
                            item.AddCancel = GlobalCode.Field2String(sAddCancelArr[i]);
                            item.IDBigint  = GlobalCode.Field2Int(sIDBigintArr[i]);
                            item.TReqID    = GlobalCode.Field2Int(sIDTReqArr[i]);
                            item.TransID   = GlobalCode.Field2Int(sIDTrans[i]);
                            list.Add(item);
                        }
                        dt = getDataTable(list);
                        DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                        if (sAddCancelArr[0].ToString() == "Edit")
                        {
                            uoLabelTitle.Text         = "Edit Transportation";
                            uoLabelSubTitle.Text      = "Transportation Request";
                            ucDivToCancel.Visible     = false;
                            uoHiddenFieldIsEdit.Value = "1";
                            uoButtonEmail.Text        = "Save Transportation & Email";

                            CrewAdminBLL.GetVehicleToEdit(dt, uoHiddenFieldUser.Value, "Edit Transport in Crew Admin Page",
                                                          "GetVehicleToEdit", Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now);

                            List <VehicleVendorEmail> listEmail = new List <VehicleVendorEmail>();
                            if (Session["CrewAdminTranspo_VehicleEmailList"] != null)
                            {
                                listEmail = (List <VehicleVendorEmail>)Session["CrewAdminTranspo_VehicleEmailList"];
                            }
                            if (listEmail.Count > 0)
                            {
                                uoTextBoxEmailAdd.Text      = listEmail[0].VehicleEmailTo;
                                uoTextBoxVehicleVendor.Text = listEmail[0].VehicleName;
                            }
                        }
                        else // Add/Cancel
                        {
                            uoLabelTitle.Text         = "Add/Cancel Transportation";
                            uoLabelSubTitle.Text      = "  New Transportation Request";
                            ucDivToCancel.Visible     = true;
                            uoHiddenFieldIsEdit.Value = "0";
                            uoButtonEmail.Text        = "Book/Cancel Transportation & Email";

                            CrewAdminBLL.GetVehicleToAddCancel(dt, uoHiddenFieldUser.Value, "Add/Cancel Transport in Crew Admin Page",
                                                               "AddCancelTranspo", Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate),
                                                               DateTime.Now, bIsFromCrewAdminAll);

                            List <VehicleVendorEmail> listEmail = new List <VehicleVendorEmail>();
                            if (Session["CrewAdminTranspo_VehicleEmailList"] != null)
                            {
                                listEmail = (List <VehicleVendorEmail>)Session["CrewAdminTranspo_VehicleEmailList"];
                            }
                            if (listEmail.Count > 0)
                            {
                                uoTextBoxEmailAdd.Text      = listEmail[0].VehicleEmailTo;
                                uoTextBoxVehicleVendor.Text = listEmail[0].VehicleName;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                AlertMessage("Invalid Record - " + ex.Message);
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }