示例#1
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 { }
    }