Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UserAccessValidation();
        if (UDFLib.ConvertToInteger(Request.QueryString["IsPreference"]) == 1)
        {
            cmdApprove.Visible = false;
        }

        if (Request.QueryString["requestid"] != null)
        {
            try
            {
                requestID        = Convert.ToInt32(Request.QueryString["requestid"].ToString());
                ltRequestid.Text = requestID.ToString();
                if (!IsPostBack)
                {
                    BLL_TRV_TravelRequest objT  = new BLL_TRV_TravelRequest();
                    DataTable             dtsts = objT.Get_Request_ApprovalStatus(requestID);
                    if (dtsts.Rows.Count > 0)
                    {
                        if (dtsts.Rows[0]["Sent_For_Approval"].ToString() == "1" && dtsts.Rows[0]["currentStatus"].ToString() == "QUOTE RECEIVED")
                        {
                            IsApproving = 1;
                        }
                    }

                    ViewState["ChepeastAmount"] = null;

                    GetTravelRequestDetails();

                    GetCheapestOptions();

                    GetQuotationForEvaluation();
                    BLL_TRV_QuoteRequest objAppHis = new BLL_TRV_QuoteRequest();

                    gvApprovals.DataSource = objAppHis.Get_Approval_History(requestID);
                    gvApprovals.DataBind();

                    BLL_TRV_QuoteRequest QR = new BLL_TRV_QuoteRequest();


                    DataTable dt = QR.Get_Qtn_Approver_DeptMgr(0, 0);

                    lstMngApprList.DataSource = dt;
                    lstMngApprList.DataBind();
                    lstMngApprList.Items.Insert(0, new ListItem("SELECT", "0"));
                    lstMngApprList.SelectedIndex = 0;
                    ListItem itemrmv = lstMngApprList.Items.FindByValue(Session["userid"].ToString());
                    lstMngApprList.Items.Remove(itemrmv);


                    ListBoxPOApprover.DataSource = QR.Get_Qtn_Approver();
                    ListBoxPOApprover.DataBind();
                    ListBoxPOApprover.Items.Insert(0, new ListItem("SELECT", "0"));
                    ListBoxPOApprover.SelectedIndex = 0;

                    lstMngApprList.Items.Remove(itemrmv);
                }
            }
            catch { }
        }
    }
Ejemplo n.º 2
0
    protected void rptParent_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        try
        {
            if ("SENDTICKET" == e.CommandName)
            {
                string             UploadFilePath = ConfigurationManager.AppSettings["TRV_UPLOAD_PATH"];
                BLL_TRV_Attachment objatt         = new BLL_TRV_Attachment();
                int    MailID = objatt.Send_Ticket(int.Parse(e.CommandArgument.ToString()), int.Parse(Session["userid"].ToString()));
                string URL    = String.Format("window.open('../crew/EmailEditor.aspx?ID=+" + MailID.ToString() + @"&FILEPATH=" + UploadFilePath.Remove(UploadFilePath.Length - 1, 1).Replace(@"\", @"\\") + "');");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "k" + MailID.ToString(), URL, true);
            }

            if (e.CommandName == "delete")
            {
                BLL_TRV_TravelRequest TRequest = new BLL_TRV_TravelRequest();
                TRequest.CancelRequest(Convert.ToInt32(e.CommandArgument), Convert.ToInt32(Session["USERID"].ToString()));
                TRequest            = null;
                ViewState["Status"] = "";

                string jsc = @"__doPostBack('ctl00$MainContent$lnkMenu' + currentlink, '')";

                //  string msgmodal = String.Format("asyncGet_Quote_Count_Approval(" + e.CommandArgument.ToString() + ",'divSendForApproval');");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "jsc", jsc, true);
            }
            if (e.CommandName == "refund")
            {
                hdnRequestID.Value      = e.CommandArgument.ToString();
                lblRequestIDRefund.Text = "Request ID : " + e.CommandArgument.ToString();
                string js = "showModal('dvPopup_Refund');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "jsPopup_Refund", js, true);
            }
            if (e.CommandName == "RequestApproval")
            {
                BLL_TRV_QuoteRequest QR = new BLL_TRV_QuoteRequest();

                ViewState["RequestID_App"] = e.CommandArgument.ToString();
                hdnRequestID_App.Value     = e.CommandArgument.ToString();


                DataTable dt = QR.Get_Qtn_Approver_DeptMgr(0, 0);

                lstUserList.DataSource = dt;
                lstUserList.DataBind();
                lstUserList.Items.Insert(0, new ListItem("SELECT", "0"));
                lstUserList.SelectedIndex = 0;
                ListItem itemrmv = lstUserList.Items.FindByValue(Session["userid"].ToString());
                lstUserList.Items.Remove(itemrmv);


                ListBoxPOApprover.DataSource = QR.Get_Qtn_Approver();
                ListBoxPOApprover.DataBind();
                ListBoxPOApprover.Items.Insert(0, new ListItem("SELECT", "0"));
                ListBoxPOApprover.SelectedIndex = 0;

                lstUserList.Items.Remove(itemrmv);

                string msgmodal = String.Format("asyncGet_Quote_Count_Approval(" + e.CommandArgument.ToString() + ",'divSendForApproval');");
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Apprmodal", msgmodal, true);
            }
        }
        catch { }
    }