public RequestForm()
 {
     InitializeComponent();
     _projectBLL     = new ProjectBLL();
     _requestTypeBLL = new RequestTypeBLL();
     _requestBLL     = new RequestBLL();
 }
        public void GetAndBindRequests(string divisionId)
        {
            var requests = new RequestBLL().GetRequestsForDivision(divisionId);

            strRequests.DataSource = requests;
            strRequests.DataBind();
        }
Esempio n. 3
0
        /// <summary>
        /// Date Created:   28/09/2011
        /// Created By:     Josephine Gad
        /// (description)   Get Manifest List
        /// ---------------------------------------------------------------------------
        /// </summary>
        private void GetRequest()
        {
            DataTable dt = null;
            DataView  dv = null;

            try
            {
                string sDateTo = GlobalCode.Field2String(Session["DateTo"]);
                //if (sDateTo == "")
                //{
                //    sDateTo = GlobalCode.Field2DateTime(uoHiddenFieldDate.Value).AddDays(double.Parse(uoHiddenFieldDateRange.Value)).ToString("MM/dd/yyyy");
                //}
                dt = RequestBLL.GetRequest(uoHiddenFieldDate.Value, sDateTo,
                                           uoHiddenFieldUser.Value, GlobalCode.Field2String(Session["Region"]), GlobalCode.Field2String(Session["Country"]),
                                           GlobalCode.Field2String(Session["City"]), uoDropDownListStatus.SelectedValue,
                                           uoDropDownListFilterBy.SelectedValue, uoTextBoxFilter.Text.Trim(),
                                           GlobalCode.Field2String(Session["Port"]), GlobalCode.Field2String(Session["Hotel"]), GlobalCode.Field2String(Session["Vehicle"]),
                                           uoDropDownListVessel.SelectedValue, uoDropDownListNationality.SelectedValue,
                                           uoDropDownListGender.SelectedValue, uoDropDownListRank.SelectedValue, "", uoHiddenFieldRole.Value);

                dv = dt.DefaultView;

                dv.Sort = uoDropDownListGroupBy.SelectedValue + ", Name ";

                uoListViewRequest.DataSource = dv;
                uoListViewRequest.DataBind();

                //HtmlControl VesselHeader = (HtmlControl)ListView1.FindControl("ucTHVessel");
                //HtmlControl HotelHeader = (HtmlControl)ListView1.FindControl("ucTHHotel");
                //if (VesselHeader != null)
                //{
                //    if (uoDropDownListGroupBy.SelectedValue == "VesselName")
                //    {
                //        VesselHeader.Visible = false;
                //        HotelHeader.Visible = true;
                //    }
                //    else if (uoDropDownListGroupBy.SelectedValue == "HotelName")
                //    {
                //        VesselHeader.Visible = true;
                //        HotelHeader.Visible = false;
                //    }
                //}
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
                if (dv != null)
                {
                    dv.Dispose();
                }
            }
        }
 protected void OnDivisionSelected(object sender, DirectEventArgs e)
 {
     if (DivisionId.HasValue)
     {
         var requests = new RequestBLL().GetRequests(DivisionId.Value);
         strRequests.DataSource = requests;
         strRequests.DataBind();
     }
 }
Esempio n. 5
0
        public void OnDeleteRequest(object request)
        {
            var requestBLL = new RequestBLL();

            var req = JsonConvert.DeserializeObject <RequestDTO>(request.ToString());

            requestBLL.DeleteRequests(req);

            LoadMasterData();
        }
        /// <summary>
        /// Date Created:   28/09/2011
        /// Created By:     Josephine Gad
        /// (description)   Approve/disapprove selected request
        /// ---------------------------------------------------------------------------
        /// </summary>
        private void ApproveRequest()
        {
            try
            {
                string strLogDescription;
                string strFunction;

                string ApproveByString = uoHiddenFieldUser.Value;
                foreach (ListViewItem item in uoListViewRequest.Items)
                {
                    CheckBox CheckSelect    = (CheckBox)item.FindControl("uoCheckBoxSelect");
                    bool     IsApprovedBool = CheckSelect.Checked;

                    if (IsApprovedBool)
                    {
                        HiddenField HiddenID        = (HiddenField)item.FindControl("uoHiddenFieldIdBigInt");
                        string      RequestIDString = HiddenID.Value;

                        Label       E1ID      = (Label)item.FindControl("uoLabelE1ID");
                        Label       OnOffdate = (Label)item.FindControl("uoLabelOnOffDate");
                        Label       Name      = (Label)item.FindControl("uoLabelName");
                        HiddenField CountryID = (HiddenField)item.FindControl("uoHiddenFieldCountry");
                        HiddenField BranchID  = (HiddenField)item.FindControl("uoHiddenFieldBranch");


                        RequestBLL.ApprovedRequest(RequestIDString, IsApprovedBool, ApproveByString);

                        //Insert log audit trail (Gabriel Oquialda - 15/11/2011)
                        strLogDescription = "Hotel/Vehicle manual request approved.";
                        strFunction       = "ApproveRequest";

                        DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                        BLL.AuditTrailBLL.InsertLogAuditTrail(Convert.ToInt32(RequestIDString), "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                              CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, uoHiddenFieldUser.Value);

                        string sMsg = "Manual Hotel/Vehicle Request of seafarer <b>" + Name.Text + "</b> with E1 ID <b>" + E1ID.Text + "</b> has been approved. <br/><br/>";
                        sMsg += "Date (On/Off): " + OnOffdate.Text + "";
                        sMsg += "<br/><br/>Thank you.";
                        sMsg += "<br/><br/><i>Auto generated email.</i>";

                        SendEmail("Travelmart: Manual Hotel/Vehicle Request Approval", sMsg, CountryID.Value, BranchID.Value);
                    }
                }
                AlertMessage("Approved!");

                GetRequest();
            }
            catch (Exception ex)
            {
                AlertMessage(ex.Message);
                throw ex;
            }
        }
        /// <summary>
        /// Date Created:   28/09/2011
        /// Created By:     Josephine Gad
        /// (description)   Get Manifest All List
        /// ---------------------------------------------------------------------------
        /// </summary>
        private void GetRequestALL()
        {
            DataTable dt = null;
            DataView  dv = null;

            try
            {
                dt = RequestBLL.GetRequest("", "",
                                           uoHiddenFieldUser.Value, "0", "0",
                                           "0", "",
                                           "1", "",
                                           "0", "0", "0",
                                           "0", "0",
                                           "0", "0", "2", uoHiddenFieldRole.Value);
                dv = dt.DefaultView;

                dv.Sort = uoDropDownListGroupBy.SelectedValue + ", Name ";

                uoListViewRequest.DataSource = dv;
                uoListViewRequest.DataBind();

                HtmlControl VesselHeader = (HtmlControl)uoListViewRequest.FindControl("ucTHVessel");
                HtmlControl HotelHeader  = (HtmlControl)uoListViewRequest.FindControl("ucTHHotel");
                if (VesselHeader != null)
                {
                    if (uoDropDownListGroupBy.SelectedValue == "VesselName")
                    {
                        VesselHeader.Visible = false;
                        HotelHeader.Visible  = true;
                    }
                    else if (uoDropDownListGroupBy.SelectedValue == "HotelName")
                    {
                        VesselHeader.Visible = true;
                        HotelHeader.Visible  = false;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
                if (dv != null)
                {
                    dv.Dispose();
                }
            }
        }
Esempio n. 8
0
        public void LoadMasterData()
        {
            var division = new DivisionBLL().GetDivisions();

            this.ReqDivisionStore.DataSource = division;
            this.ReqDivisionStore.DataBind();

            var requests = new RequestBLL().GetRequests();

            this.RequestStore.DataSource = requests;
            this.RequestStore.DataBind();
            //this.RequestStore.Reload();
        }
Esempio n. 9
0
        public void EditRequest(string field, string oldValue, string newValue, object request)
        {
            var req = JsonConvert.DeserializeObject <RequestDTO>(request.ToString());

            try
            {
                //string message = "<b>Property:</b> {0}<br /><b>Field:</b> {1}<br /><b>Old Value:</b> {2}<br /><b>New Value:</b> {3}";

                //// Send Message...
                //X.Msg.Notify(new NotificationConfig()
                //{
                //    Title = "Edit Record #" + req.Id.ToString(),
                //    Html = string.Format(message, req.Id, field, oldValue, newValue),
                //    HideDelay = 1500,
                //    Width = 250,
                //    Height = 150
                //}).Show();



                //this.RequestPanel.GetStore().GetById(req.Id).Commit();

                var requestBLL = new RequestBLL();


                var duplicateRequest = requestBLL.GetRequest(req);
                if (duplicateRequest == null || duplicateRequest.Id == req.Id)
                {
                    requestBLL.UpdateRequests(req);
                }
                else
                {
                    Ext.Net.Notification.Show(new Ext.Net.NotificationConfig
                    {
                        Title     = "Notification",
                        Icon      = Ext.Net.Icon.Information,
                        AutoHide  = true,
                        HideDelay = 2000,
                        Html      = "Request already exists!"
                    });
                }

                LoadMasterData();
            }
            catch (Exception ex)
            {
            }
        }
Esempio n. 10
0
        private void BindMenuLink()
        {
            string MenuString = "";

            if (Cache["UserMenuLeft"] == null)
            {
                MenuString  = "<div id=\"vertmenu\"> ";
                MenuString += " <ul> ";

                string userName = GlobalCode.Field2String(Session["UserName"]);
                string userRole = UserAccountBLL.GetUserPrimaryRole(userName);

                bool IsPendingExists = false;
                IsPendingExists = RequestBLL.IsPendingRequestExists(userName, userRole);
                if (IsPendingExists)
                {
                    MenuString += " <li><a href=\"../RequestView.aspx?ufn=" + Request.QueryString["ufn"].ToString() + "\">Pending Request</a></li> ";
                }
                if (userRole == TravelMartVariable.RoleAdministrator || Page.User.IsInRole(TravelMartVariable.RoleHotelSpecialist))
                {
                    MenuString += " <li><a href=\"../Hotel/HotelViewPending.aspx?ufn=" + Request.QueryString["ufn"].ToString() + "\">Pending Hotel Booking</a></li> ";
                }
                if (userRole == TravelMartVariable.RoleAdministrator || Page.User.IsInRole(TravelMartVariable.RoleHotelSpecialist) ||
                    Page.User.IsInRole(TravelMartVariable.RoleVehicleSpecialist))
                {
                    MenuString += " <li><a href=\"../Vehicle/VehicleViewPending.aspx?ufn=" + Request.QueryString["ufn"].ToString() + "\">Pending Vehicle Booking</a></li> ";
                }

                if (userRole == TravelMartVariable.RoleAdministrator || userRole == TravelMartVariable.RoleContractManager)
                {
                    MenuString += " <li><a href=\"../Maintenance/HotelContractApproval.aspx?ufn=" + Request.QueryString["ufn"].ToString() + "\">Pending Hotel Contract</a></li> ";
                    MenuString += " <li><a href=\"../ContractManagement/HotelNoActiveContractList.aspx?ufn=" + Request.QueryString["ufn"].ToString() + "\">Hotel No Active Contract</a></li> ";

                    MenuString += " <li><a href=\"../Maintenance/VehicleContractApproval.aspx?ufn=" + Request.QueryString["ufn"].ToString() + "\">Pending Vehicle Contract</a></li> ";
                    MenuString += " <li><a href=\"../ContractManagement/VehicleNoActiveContractList.aspx?ufn=" + Request.QueryString["ufn"].ToString() + "\">Vehicle No Active Contract</a></li> ";

                    MenuString += " <li><a href=\"../ContractManagement/PortAgentContractApproval.aspx?ufn=" + Request.QueryString["ufn"].ToString() + "\">Pending Service Provider Contract</a></li> ";
                    MenuString += " <li><a href=\"../ContractManagement/PortAgentNoActiveContract.aspx?ufn=" + Request.QueryString["ufn"].ToString() + "\">Service Provider No Active Contract</a></li> ";
                    MenuString += " </ul> ";
                    MenuString += " </div> ";
                }
                //Store menu string in Cache for 2 minutes
                Cache.Insert("UserMenuLeft", MenuString, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(120));
            }
            MenuString         = Cache["UserMenuLeft"].ToString();
            ucLiteralMenu.Text = MenuString;
        }
Esempio n. 11
0
        /// <summary>
        /// Date Created:   06/10/2011
        /// Created By:     Josephine Gad
        /// (description)   Saving manual request for hotel/vehicle
        /// ----------------------------------------------------
        /// </summary>
        private void SaveRequest()
        {
            string strLogDescription;
            string strFunction;

            if (uoHiddenFieldRequestID.Value == "0")
            {
                Int32 pRequestID = RequestBLL.RequestInsert("0", uoDropDownListSeafarer.SelectedValue, uoHiddenFieldVesselID.Value,
                                                            uoTextBoxDate.Text, uoRadioButtonListOnOff.SelectedValue, uoCheckBoxHotel.Checked,
                                                            uoHiddenFieldHotelID.Value, uoTextBoxCheckinDate.Text, uoTextBoxCheckoutDate.Text,
                                                            uoCheckBoxTransportation.Checked, uoDropDownListOrigin.SelectedValue, uoTextBoxOrigin.Text,
                                                            uoDropDownListDestination.SelectedValue, uoTextBoxDestination.Text, uoTextBoxPickupdate.Text,
                                                            uoHiddenFieldPortID.Value, "", uoDropDownListPortAgent.SelectedValue,
                                                            uoHiddenFieldCostCenterID.Value, uoHiddenFieldRankID.Value, GlobalCode.Field2String(Session["UserName"]));

                //Insert log audit trail (Gabriel Oquialda - 18/11/2011)
                strLogDescription = "Hotel/Vehicle manual request added.";
                strFunction       = "SaveRequest";

                DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                BLL.AuditTrailBLL.InsertLogAuditTrail(Convert.ToInt32(pRequestID), "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                      CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
            }
            else
            {
                RequestBLL.RequestUpdate(uoHiddenFieldRequestID.Value, uoDropDownListSeafarer.SelectedValue, uoDropDownListVessel.SelectedValue,
                                         uoTextBoxDate.Text, uoRadioButtonListOnOff.SelectedValue, uoCheckBoxHotel.Checked,
                                         uoDropDownListHotel.SelectedValue, uoTextBoxCheckinDate.Text, uoTextBoxCheckoutDate.Text,
                                         uoCheckBoxTransportation.Checked, uoDropDownListOrigin.SelectedValue, uoTextBoxOrigin.Text,
                                         uoDropDownListDestination.SelectedValue, uoTextBoxDestination.Text, uoTextBoxPickupdate.Text,
                                         uoHiddenFieldPortID.Value, "", uoDropDownListPortAgent.SelectedValue,
                                         uoHiddenFieldCostCenterID.Value, uoHiddenFieldRankID.Value, GlobalCode.Field2String(Session["UserName"]));

                //Insert log audit trail (Gabriel Oquialda - 18/11/2011)
                strLogDescription = "Hotel/Vehicle manual request updated.";
                strFunction       = "SaveRequest";

                DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                BLL.AuditTrailBLL.InsertLogAuditTrail(Convert.ToInt32(uoHiddenFieldRequestID.Value), "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                      CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
            }
        }
Esempio n. 12
0
        private void btnCreatWork_Click(object sender, EventArgs e)
        {
            _work.WorkDetail = txtWorkDetail.Text;
            _work.ProjectID  = (cmbProject.SelectedValue != null)?(int)cmbProject.SelectedValue:0;
            if (cmbEmployee.SelectedValue != null)
            {
                _work.EmployeeID = (int)cmbEmployee.SelectedValue;
            }
            _work.ManagerID = MainForm._employee.ID;
            DateTime date = new DateTime(DateTime.Now.Date.Year, DateTime.Now.Date.Month, DateTime.Now.Date.Day);

            _work.CreationDate = date;
            _work.WorkStatusID = 1;
            if (_workBLL.Add(_work))
            {
                mail mail = new mail();
                if (_work.EmployeeID != null)
                {
                    _work.Employee = _employeeBLL.Get((int)cmbEmployee.SelectedValue);
                    if (mail.SentMail(_work.Employee.EMail, "Yeni Atanan iş", MainForm._employee.FullName + " tarafından size iş tanımlanmıştır. \n\n\nİyi çalışmalar dileriz. \n\nBlack Group :)"))
                    {
                        MessageBox.Show("İş oluşturuldu sistem çalışana mail gönderdi");
                        if (_newRequestToWork != null)
                        {
                            _newRequestToWork.State = false;
                            RequestBLL requestBLL = new RequestBLL();
                            if (requestBLL.Update(_newRequestToWork))
                            {
                                this.Close();
                            }
                        }
                    }
                }
                else
                {
                    MessageBox.Show("İş oluşturuldu işe çalışan atanmadı");
                }
            }
            else
            {
                MessageBox.Show("Hata meydana geldi");
            }
        }
Esempio n. 13
0
        /// <summary>
        /// Date Created:   28/09/2011
        /// Created By:     Josephine Gad
        /// (description)   Get Manifest All List
        /// ---------------------------------------------------------------------------
        /// </summary>
        private void GetRequestALL()
        {
            DataTable dt = null;
            DataView  dv = null;

            try
            {
                dt = RequestBLL.GetRequest("", "",
                                           uoHiddenFieldUser.Value, "0", "0",
                                           "0", "",
                                           "1", "",
                                           "0", "0", "0",
                                           "0", "0",
                                           "0", "0", "2", uoHiddenFieldRole.Value);
                dv = dt.DefaultView;

                dv.Sort = uoDropDownListGroupBy.SelectedValue + ", Name ";

                uoListViewRequest.DataSource = dv;
                uoListViewRequest.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
                if (dv != null)
                {
                    dv.Dispose();
                }
            }
        }
 internal void RequestList()
 {
     _requestBLL           = new RequestBLL();
     dgvRequest.DataSource = _requestBLL.RequstGetAll();
 }
Esempio n. 15
0
    public void Save()
    {
        RequestBLL bll = new RequestBLL();

        bll.Save(this);
    }
Esempio n. 16
0
    public static Client GetBy_Id(int id)
    {
        RequestBLL bll = new RequestBLL();

        return(bll.Get <Client>(id));
    }
Esempio n. 17
0
    public static Order GetBy_Id(int id)
    {
        RequestBLL bll = new RequestBLL();

        return(bll.Get <Order>(id));
    }
Esempio n. 18
0
        /// <summary>
        /// Date Created:   06/10/2011
        /// Created By:     Josephine Gad
        /// (description)  Get Request details by ID
        /// ---------------------------------------------
        /// </summary>
        private void GetRequestDetails()
        {
            IDataReader r = null;

            try
            {
                r = RequestBLL.GetRequestDetailsByID(uoHiddenFieldRequestID.Value);
                if (r.Read())
                {
                    uoDropDownListSeafarer.SelectedValue = r["SfID"].ToString();
                    GetSeafarerDetails(r["SfID"].ToString());

                    uoTextBoxDate.Text = DateTime.Parse(r["OnOffDate"].ToString()).ToString("MM/dd/yyyy");
                    uoRadioButtonListOnOff.SelectedValue = r["Status"].ToString().ToUpper();
                    GetVessel(r["VesselID"].ToString());
                    GetVesselDetails();
                    GetPortAgent();
                    uoDropDownListPortAgent.SelectedValue = r["PortAgentID"].ToString();

                    uoCheckBoxHotel.Checked = (bool)r["IsNeedHotel"];

                    //                    GetHotelDetails(r["BranchID"].ToString());
                    //                  uoTextBoxFilterCity.Text = uoTextBoxCity.Text;
                    //                    GetCity();
                    //uoDropDownListCity.SelectedValue = uoHiddenFieldHotelCity.Value;
                    GetHotelBranch();
                    if (uoCheckBoxHotel.Checked)
                    {
                        uoHiddenFieldHotelID.Value        = r["BranchID"].ToString();
                        uoDropDownListHotel.SelectedValue = r["BranchID"].ToString();
                        uoTextBoxCheckinDate.Text         = DateTime.Parse(r["CheckinDate"].ToString()).ToString("MM/dd/yyyy");
                        uoTextBoxCheckoutDate.Text        = DateTime.Parse(r["CheckoutDate"].ToString()).ToString("MM/dd/yyyy");
                    }

                    uoCheckBoxTransportation.Checked = (bool)r["IsNeedTranspo"];
                    if (uoCheckBoxTransportation.Checked)
                    {
                        uoDropDownListOrigin.SelectedValue = r["Origin"].ToString();
                        if (r["Origin"].ToString().ToLower() == "other")
                        {
                            uoTextBoxOrigin.Text = r["OriginRemarks"].ToString();
                        }
                        uoDropDownListDestination.SelectedValue = r["Destination"].ToString();
                        if (r["Destination"].ToString().ToLower() == "other")
                        {
                            uoTextBoxDestination.Text = r["DestinationRemarks"].ToString();
                        }
                        uoTextBoxPickupdate.Text = DateTime.Parse(r["PickupDate"].ToString()).ToString("MM/dd/yyyy");
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (r != null)
                {
                    r.Dispose();
                }
            }
        }