Ejemplo n.º 1
0
 public ActionResult Index(string eid = "")
 {
     if (eid == "")
     {
     }
     else
     {
         StudentRepository _objRepository = new StudentRepository();
         DataSet           ds             = _objRepository.student_login_activation_link(Encrypt_Decrypt.DecryptData(eid, ""));
         if (ds != null)
         {
         }
     }
     if (Session["studentid"] != null && Session["IsPasswordChanged"] != null && Session["ischangedpassword"] != null)
     {
         if (Session["studentid"].ToString() != "" && Session["IsPasswordChanged"].ToString() == "True" && Session["ischangedpassword"].ToString() == "True")
         {
             return(RedirectToAction("Index", "Dashboard", new { Area = "admission" }));
         }
     }
     return(View());
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         BindOrderReportPathdetails();
         string QorderID = Encrypt_Decrypt.Decrypt(Session["sOrderID"].ToString().Trim(), true);
         BindOrderDetails(Convert.ToInt32(QorderID));
     }
     if (!string.IsNullOrEmpty(hlInvoice.Text))
     {
         btnInvoice.Visible      = false;
         btnDisableInv.Enabled   = false;
         btnDisableInv.Visible   = true;
         btnDisableInv.ForeColor = System.Drawing.ColorTranslator.FromHtml("Gray");
     }
     if (!string.IsNullOrEmpty(hlPacking.NavigateUrl))
     {
         btnPacking.Visible       = false;
         btnDisablePack.Enabled   = false;
         btnDisablePack.Visible   = true;
         btnDisablePack.ForeColor = System.Drawing.ColorTranslator.FromHtml("Gray");
     }
     if (!string.IsNullOrEmpty(hlCoverLetter.NavigateUrl))
     {
         btnCoverLetter.Visible = false;
         btnDisableCL.Enabled   = false;
         btnDisableCL.Visible   = true;
         btnDisableCL.ForeColor = System.Drawing.ColorTranslator.FromHtml("Gray");
     }
     if (!string.IsNullOrEmpty(hlFIRCover.NavigateUrl))
     {
         btnFLetter.Visible     = false;
         btnDisableFL.Enabled   = false;
         btnDisableFL.Visible   = true;
         btnDisableFL.ForeColor = System.Drawing.ColorTranslator.FromHtml("Gray");
     }
     if (!string.IsNullOrEmpty(hlHazSea.NavigateUrl))
     {
         btnHazsea.Visible          = false;
         btnDisableHazSea.Enabled   = false;
         btnDisableHazSea.Visible   = true;
         btnDisableHazSea.ForeColor = System.Drawing.ColorTranslator.FromHtml("Gray");
     }
     if (!string.IsNullOrEmpty(hlHazAir.NavigateUrl))
     {
         btnHazAir.Visible          = false;
         btnDisableHazAir.Enabled   = false;
         btnDisableHazAir.Visible   = true;
         btnDisableHazAir.ForeColor = System.Drawing.ColorTranslator.FromHtml("Gray");
     }
     if (!Page.IsPostBack)
     {
         string orderStatus = Convert.ToString(Session["AdminOrderStatus"]);
         if (orderStatus.Contains("ETA"))
         {
             orderStatus = "INTRANSIT";
             Session["AdminOrderStatus"] = orderStatus;
         }
         BinOrderStatusDetails(orderStatus);
         ScriptManager.RegisterStartupScript(this, GetType(), "myFunction", "ManageStartupTabs('" + Convert.ToString(Session["AdminOrderStatus"]) + "','" + Convert.ToString(Session["AdminOrderStatus"]) + "');", true);
     }
 }
    private void BinOrderStatusDetails(string orderStatus)
    {
        string    OrderID = Encrypt_Decrypt.Decrypt(Session["sOrderID"].ToString().Trim(), true);
        DataTable dtOrder = orderObj.GetOrderDetails(Convert.ToInt32(OrderID));

        if (dtOrder.Rows.Count > 0)
        {
            DataRow dr = dtOrder.Rows[0];
            orderStatus = orderStatus.ToUpper();
            if (orderStatus.Contains("ETA"))
            {
                orderStatus = "INTRANSIT";
            }


            if (orderStatus == "CLOSE")
            {
                btnDisableCloseOrder.Visible = true;
                btnCloseOrder.Visible        = false;

                btnClearance.Visible        = false;
                btnDisableClearance.Visible = true;


                string eta = Convert.ToString(dr["ETA"]);
                if (eta != "N/A")
                {
                    lblETAText.Text = "ETA : " + Convert.ToDateTime(eta).ToString("dd MMM yyyy");
                }

                tblETA.Visible     = false;
                lblETAText.Visible = true;
            }
            else if (orderStatus == "UNDER CUSTOM CLEARANCE" || orderStatus == "UNDER<BR/>CUSTOM<BR/>CLEARANCE")
            {
                btnClearance.Visible        = false;
                btnDisableClearance.Visible = true;

                tblETA.Visible     = true;
                lblETAText.Visible = false;

                btnDisableCloseOrder.Visible = false;
                btnCloseOrder.Visible        = true;

                btnIntransitSubmit.Visible = true;
            }
            else if (orderStatus == "INTRANSIT")
            {
                btnClearance.Visible        = false;
                btnDisableClearance.Visible = true;

                string eta = Convert.ToString(dr["ETA"]);
                if (eta != "N/A")
                {
                    lblETAText.Text = "ETA : " + Convert.ToDateTime(eta).ToString("dd MMM yyyy");
                }

                tblETA.Visible     = false;
                lblETAText.Visible = true;

                btnDisableCloseOrder.Visible = false;
                btnCloseOrder.Visible        = true;
            }
        }
    }
        public JsonResult RegistationUser(Student_Register _obj, bool CaptchaValid)
        {
            bool flagCaptcha = false;
            bool flagValidID = true;

            try
            {
                //if (this.Session["CaptchaImageText"].ToString() == _obj.Captchastr)
                if (CaptchaValid)
                {
                    flagCaptcha = true;
                    StudentRepository _objRepository = new StudentRepository();
                    // _obj.CREATE_BY = Session["FA_USER_ID"].ToString();
                    string localIP = "?";
                    localIP         = Request.ServerVariables["REMOTE_ADDR"].ToString();
                    _obj.Created_Ip = localIP;
                    string password = Membership.GeneratePassword(8, 1);
                    _obj.Random = password;
                    Random        rn           = new Random();
                    int           month        = rn.Next(1, 6);
                    StringBuilder hashPassword = new StringBuilder();
                    string        new_password = _obj.ActualPassword;
                    switch (month)
                    {
                    case 1:
                        hashPassword.Append(Helper.ComputeHash(new_password, "MD5", null));
                        break;

                    case 2:
                        hashPassword.Append(Helper.ComputeHash(new_password, "SHA1", null));
                        break;

                    case 3:
                        hashPassword.Append(Helper.ComputeHash(new_password, "SHA256", null));
                        break;

                    case 4:
                        hashPassword.Append(Helper.ComputeHash(new_password, "SHA384", null));
                        break;

                    case 5:
                        hashPassword.Append(Helper.ComputeHash(new_password, "SHA512", null));
                        break;
                    }
                    _obj.ActualPassword = hashPassword.ToString();
                    DataSet   ds            = _objRepository.InsertStudentRegistration(_obj);
                    SendEmail _objseedemail = new SendEmail();
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        if (ds.Tables[0].Rows[0]["Exist"].ToString() == "0")
                        {
                            flagValidID = true;
                            if (_obj.Email.ToString() != "")
                            {
                                string        strform  = System.Configuration.ConfigurationManager.AppSettings["Emailusername"];
                                string        Subject  = "Student Login";
                                StringBuilder MailBody = new StringBuilder();
                                MailBody.Append("<br/>Dear Student, " + _obj.FirstName + " " + _obj.LastName + ",<br/>");
                                MailBody.Append("<br/>Thank you for registering at Study in India.");
                                MailBody.Append("<br/>To activate your account <b><a target='_blank' href='" + FullyQualifiedApplicationPath(ControllerContext.RequestContext.HttpContext.Request) + "admission/login?eid=" + Encrypt_Decrypt.EncryptData(_obj.Email, "") + "'>click on the following link </a> </b>");
                                //  MailBody.Append("<br/>Username: "******"UserName"].ToString() + "(You can also use your email id for logging in)");
                                //   MailBody.Append("<br/>Password: "******"<br/>Please note: This is an auto generated email.<br/>");
                                MailBody.Append("<br/><br/><br/>Regards,<br/>");
                                MailBody.Append("Study in India Team<br/>");
                                string bcc = "";
                                string cc  = "";
                                _objseedemail.SendEmailInBackgroundThread(strform, _obj.Email, bcc, cc, Subject, MailBody.ToString(), "", true);
                            }
                        }
                        else
                        {
                            flagValidID = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Json(new
            {
                flagCaptcha = flagCaptcha,
                flagValidID = flagValidID
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
Ejemplo n.º 5
0
    private bool generatePdf()
    {
        bool      result          = false;
        int       orderid         = Convert.ToInt32(Encrypt_Decrypt.Decrypt(Session["sOrderID"].ToString().Trim(), true));
        DataTable dtPOProductList = orderObj.OrderProductList(orderid);
        string    path            = string.Empty;

        for (int count = 0; count < dtPOProductList.Rows.Count; count++)
        {
            string strpdf = string.Empty;
            strpdf += "<table align='center' style='font-family: Verdana; width: 885px'><tr bgcolor='#ffcc66'>";
            strpdf += "<td colspan='4'><table align='center' style='font-family: Verdana;'><tr><td align='center' style='font-size: 12px;'>Mudar India Exports</td></tr><tr>";
            strpdf += "<td colspan='4' align='center' style='font-size: 10px;'>6-1-744, Kovur Nagar,ANANTAPUR - 515 004,Andhra Pradesh,India</td></tr></table></td></tr><tr>";
            strpdf += "<td colspan='4'></td></tr><tr>";
            strpdf += "<td colspan='2' align='left'><table width='40%'align='left' border='1'><tr><td><span style='font-size:10px;'>COA No</td><td><span style='font-size:10px;'>&nbsp;02657</td></tr></table></td><td colspan='2' align='center'><table width='55%'align='right' border='1'><tr><td>Date</td><td align='center'><span style='font-size:10px;'>" + lblTodayDate.Text + "</td></tr></table></td></tr><tr>";
            strpdf += "<td colspan='4'></td></tr><tr>";
            strpdf += "<td align='center' colspan='4'>Certificate of Analysis</td></tr><tr>";
            strpdf += "<td colspan='4'></td></tr><tr>";
            strpdf += "<td colspan='4'><table  width='100%' border='1'><tr align='center'>";
            strpdf += "<td rowspan='4'>" + lblConsigneeAddress.Text + "</td>";
            strpdf += "<td>Buyers PO</td><td>" + lblPO.Text + "</td></tr><tr align='center'>";
            strpdf += "<td>PO Date<br /></td><td>" + lblPODate.Text + "</td></tr><tr align='center'>";
            strpdf += "<td>Invoice No #</td><td>" + lblInvoice.Text + "</td></tr><tr align='center'>";
            strpdf += "<td>Invoice Date</td><td>" + lblInvoiceDate.Text + "</td></tr></table></td></tr><tr>";
            strpdf += "<td colspan='4'></td></tr>";
            strpdf += "<td colspan='4'><table width='100%' border='1'><tr align='center'>";
            strpdf += "<td colspan='2'>Name of the Product </td><td colspan='2'>" + dtPOProductList.Rows[count]["ProductName"].ToString() + "</td></tr><tr align='center'>";
            strpdf += "<td>Lot Qty in KG</td><td>" + dtPOProductList.Rows[count]["Quantity"].ToString() + "</td><td>Year of Production</td><td>" + (dlCOAdetails.Items[count].FindControl("txtYearProduction") as TextBox).Text + "</td></tr><tr align='center'>";
            strpdf += "<td>Lot No</td><td>" + dtPOProductList.Rows[count]["BatchID"].ToString() + "</td><td>Drums Ref</td><td>" + dtPOProductList.Rows[count]["TotalDrums"].ToString() + "</td></tr><tr></table></td></tr><tr align='center'>";
            strpdf += "<td colspan='4'></td></tr><tr>";
            strpdf += "<td colspan='4'><table width='100%' border='1'><tr>";
            strpdf += "<td rowspan='2' align='center'>Parameter</td><td rowspan='2'align='center'>Analysis Value </td><td colspan='2'align='center'>Standard Specification</td><td rowspan='2'align='center'>Testing Method<br />Adopted</td></tr><tr>";
            strpdf += "<td align='center'>Low</td><td align='center'>High</td></tr><tr align='center'>";
            strpdf += "<td>" + (dlCOAdetails.Items[count].FindControl("txtApperance") as TextBox).Text + "</td>";
            strpdf += "<td>" + (dlCOAdetails.Items[count].FindControl("txtApperanceAnalysis") as TextBox).Text + "</td>";
            strpdf += "<td>" + (dlCOAdetails.Items[count].FindControl("txtApperanceLow") as TextBox).Text + "</td>";
            strpdf += "<td>" + (dlCOAdetails.Items[count].FindControl("txtApperanceHigh") as TextBox).Text + "</td>";
            strpdf += "<td>" + (dlCOAdetails.Items[count].FindControl("txtApperanceTMA") as TextBox).Text + "</td></tr><tr align='center'>";
            strpdf += "<td>" + (dlCOAdetails.Items[count].FindControl("txtOdor") as TextBox).Text + "</td>";
            strpdf += "<td>" + (dlCOAdetails.Items[count].FindControl("txtOdorAnalysis") as TextBox).Text + "</td>";
            strpdf += "<td>" + (dlCOAdetails.Items[count].FindControl("txtOdorLow") as TextBox).Text + "</td>";
            strpdf += "<td>" + (dlCOAdetails.Items[count].FindControl("txtOdorHigh") as TextBox).Text + "</td>";
            strpdf += "<td>" + (dlCOAdetails.Items[count].FindControl("txtOdorTMA") as TextBox).Text + "</td></tr><tr align='center'>";
            strpdf += "<td>" + (dlCOAdetails.Items[count].FindControl("txtMethyleChevicol") as TextBox).Text + "</td>";
            strpdf += "<td>" + (dlCOAdetails.Items[count].FindControl("txtMethyleChevicolAnalysis") as TextBox).Text + "</td>";
            strpdf += "<td>" + (dlCOAdetails.Items[count].FindControl("txtMethyleChevicolLow") as TextBox).Text + "</td>";
            strpdf += "<td>" + (dlCOAdetails.Items[count].FindControl("txtMethyleChevicolHigh") as TextBox).Text + "</td>";
            strpdf += "<td>" + (dlCOAdetails.Items[count].FindControl("txtMethyleChevicolTMA") as TextBox).Text + "</td></tr></table></td></tr><tr>";
            strpdf += "<td colspan='4'></td></tr></table>";

            Document document = new Document();
            try
            {
                string Pdf_path = string.Empty;
                Pdf_path = mu.createfolder(orderid.ToString(), MudarUser.OrderPDF) ? WebConfigurationManager.AppSettings["orderpdf"].ToString() + orderid.ToString() + "/COA-BO(" + orderid.ToString() + "_" + dtPOProductList.Rows[count]["ProductID"].ToString() + ").pdf" : WebConfigurationManager.AppSettings["orderpdf"].ToString() + "/COA-BO(" + orderid.ToString() + "_" + dtPOProductList.Rows[count]["ProductID"].ToString() + ").pdf";
                path    += Pdf_path;
                if (count < dtPOProductList.Rows.Count - 1)
                {
                    path += "$";
                }
                //writer - have our own path!!!
                PdfWriter.GetInstance(document, new FileStream(Server.MapPath(Pdf_path), FileMode.Create));
                document.Open();



                //Here is where your HTML source goes................
                String htmlText = strpdf.ToString();


                //make an arraylist ....with STRINGREADER since its no IO reading file...

                List <IElement> htmlarraylist = iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList(new StringReader(htmlText), null);

                ////add the collection to the document
                //for (int k = 0; k < htmlarraylist.Count; k++)
                //{
                //    document.Add((IElement)htmlarraylist[k]);
                //}

                //document.Add(new Paragraph("And the same with indentation...."));

                // or add the collection to an paragraph
                // if you add it to an existing non emtpy paragraph it will insert it from
                //the point youwrite -
                Paragraph mypara = new Paragraph();//make an emtphy paragraph as "holder"
                mypara.IndentationLeft = 36;
                mypara.InsertRange(0, htmlarraylist);
                document.Add(mypara);
                document.Close();
                //orderObj.OrderDetails_UPD(orderid, Pdf_path, "bhanu");
                result = true;
            }
            catch (Exception exx)
            {
                Response.Write("<br>____________________________________<br>");
                Response.Write("<br>Error: " + exx + "<br>");
                Response.Write("<br>StackTrace: " + exx.StackTrace + "<br>");
                Response.Write("<br>strPDFDocument: " + strpdf.ToString() + "<br>");
                Response.Write("<br>strSelectUserListBuilder: " + strpdf.ToString() + "<br>");

                //Console.Error.WriteLine(exx.StackTrace);
                //Console.Error.WriteLine(exx.StackTrace);
                result = false;
            }
            finally
            {
                //document.Close();
            }
        }
        result = reportObj.OrderReportsPathInsertandUpdate(Convert.ToInt32(orderid), Convert.ToInt32(Session["BranchOrderID_S"].ToString()), path, "Bhanu", string.Empty, rtypeObj.COA_BO);
        return(result);
    }
Ejemplo n.º 6
0
 protected void rptFiveLotSamples_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     Session["sOrderID"] = Encrypt_Decrypt.Encrypt(e.CommandArgument.ToString(), true);
     Response.Redirect("~/Orders/BranchOrder.aspx");
 }
    private bool generatePDF()
    {
        bool      result          = false;
        int       orderid         = Convert.ToInt32(Encrypt_Decrypt.Decrypt(Session["sOrderID"].ToString().Trim(), true));
        DataTable dtPOProductList = orderObj.OrderProductList(orderid);
        string    path            = string.Empty;

        for (int count = 0; count < dtPOProductList.Rows.Count; count++)
        {
            string strpdf = string.Empty;
            for (int dCount = 0; dCount < Convert.ToInt32(dtPOProductList.Rows[count]["TotalDrums"].ToString()); dCount++)
            {
                strpdf += "<table width='100%' align='center' border='1' style='font-family:Verdana;'><tr>";
                strpdf += "<td  colspan='4' align='center' bgcolor='#ffcc66'>" + dtPOProductList.Rows[count]["ProductName"].ToString() + "</td></tr><tr>";
                strpdf += "<td colspan='4' style='font-size: 9px' align='center'> ( Product Produced &amp; Processed in accordance with requirements of India’s National Program for Organic Production (NPOP) which is considered equivalent to Council Regulation (EC) 834/2007 &amp; also as per USDA-NOP)</td></tr><tr>";
                strpdf += "<td  colspan='4' style='font-size: 15px' align='center'> Licensee Producer</td></tr><tr>";
                strpdf += "<td colspan='4' align='center'> <b>Mudar India Exports</b></td></tr><tr>";
                strpdf += "<td colspan='4' style='font-size: 12px' align='center'> 6-1-744, Kovur Nagar, ANANTAPUR - 515004 Andhra Pradesh, India</td></tr><tr>";
                strpdf += "<td colspan='4' style='font-size: 12px' align='center'> <b>Certified Organic by CU-025367</b></td></tr><tr>";
                strpdf += "<td colspan='2' width='50%' align='center'> Buyer</td><td colspan='2'>&nbsp;&nbsp;&nbsp; <b>CompanyName</b></td></tr><tr> ";
                strpdf += "<td  width='25%' align='center'> Country of Origin</td><td  width='25%' align='center'> &nbsp;&nbsp;India</td><td  width='25%' align='center'> Country of Destination</td><td  width='25%' align='center'>" + lblDCountry.Text + "</td></tr><tr>";
                strpdf += "<td  width='25%' align='center'> Gross Weight (KG)</td><td  width='25%' align='center'> " + dtPOProductList.Rows[count]["GrossQuantity"].ToString() + "</td> <td  width='25%' align='center' colspan='2' style='width: 50%'> <b>Do Not Fumigate</b></td></tr><tr>";
                strpdf += "<td  width='25%' align='center'> Tare Weight (KG)</td><td  width='25%' align='center'> " + (Convert.ToDecimal(dtPOProductList.Rows[count]["GrossQuantity"].ToString()) - Convert.ToDecimal(dtPOProductList.Rows[count]["Quantity"].ToString())).ToString() + "</td><td  width='25%' align='center'> Lot Number</td><td  width='25%' align='center'> " + dtPOProductList.Rows[count]["BatchID"].ToString() + "</td></tr><tr>";
                strpdf += "<td  width='25%' align='center'> Net Weight(KG)</td><td  width='25%' align='center'> " + dtPOProductList.Rows[count]["Quantity"].ToString() + "</td><td  width='25%' align='center'> Drum Number</td><td  width='25%' align='center'> " + (dCount + 1) + "</td></tr></table>";
            }
            Document document = new Document();
            try
            {
                string Pdf_path = string.Empty;
                Pdf_path = mu.createfolder(orderid.ToString(), MudarUser.OrderPDF) ? WebConfigurationManager.AppSettings["orderpdf"].ToString() + orderid.ToString() + "/Label(" + orderid.ToString() + "_" + dtPOProductList.Rows[count]["ProductID"].ToString() + ").pdf" : WebConfigurationManager.AppSettings["orderpdf"].ToString() + "/Label(" + orderid.ToString() + "_" + dtPOProductList.Rows[count]["ProductID"].ToString() + ").pdf";
                path    += Pdf_path;
                if (count < dtPOProductList.Rows.Count - 1)
                {
                    path += "$";
                }
                //writer - have our own path!!!
                PdfWriter.GetInstance(document, new FileStream(Server.MapPath(Pdf_path), FileMode.Create));
                document.Open();



                //Here is where your HTML source goes................
                String htmlText = strpdf.ToString();


                //make an arraylist ....with STRINGREADER since its no IO reading file...

                List <IElement> htmlarraylist = iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList(new StringReader(htmlText), null);

                ////add the collection to the document
                //for (int k = 0; k < htmlarraylist.Count; k++)
                //{
                //    document.Add((IElement)htmlarraylist[k]);
                //}

                //document.Add(new Paragraph("And the same with indentation...."));

                // or add the collection to an paragraph
                // if you add it to an existing non emtpy paragraph it will insert it from
                //the point youwrite -
                Paragraph mypara = new Paragraph();//make an emtphy paragraph as "holder"
                mypara.IndentationLeft = 36;
                mypara.InsertRange(0, htmlarraylist);
                document.Add(mypara);
                document.Close();
                //orderObj.OrderDetails_UPD(orderid, Pdf_path, "bhanu");
                result = true;
            }
            catch (Exception exx)
            {
                Response.Write("<br>____________________________________<br>");
                Response.Write("<br>Error: " + exx + "<br>");
                Response.Write("<br>StackTrace: " + exx.StackTrace + "<br>");
                Response.Write("<br>strPDFDocument: " + strpdf.ToString() + "<br>");
                Response.Write("<br>strSelectUserListBuilder: " + strpdf.ToString() + "<br>");

                //Console.Error.WriteLine(exx.StackTrace);
                //Console.Error.WriteLine(exx.StackTrace);
                result = false;
            }
            finally
            {
                //document.Close();
            }
        }
        result = reportObj.OrderReportsPathInsertandUpdate(Convert.ToInt32(orderid), Convert.ToInt32(Session["BranchOrderID_S"].ToString()), path, "Bhanu", string.Empty, rtypeObj.LABEL);
        return(result);
    }
    protected void dlOrderList_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string command = e.CommandName;
        int    Index   = e.Item.ItemIndex;

        switch (command)
        {
        case "Exp_Col":
        {
            RepeaterItem item = dlOrderList.Items[Index];
            //Label test = item.FindControl("lblC_P") as Label;
            ImageButton img = item.FindControl("ibtnNOExpColap") as ImageButton;
            if (img.ImageUrl == "~/images/expand.JPG")
            {
                ((ImageButton)dlOrderList.Items[Index].FindControl("ibtnNOExpColap")).ImageUrl = "~/images/collapse.JPG";
                ((GridView)dlOrderList.Items[Index].FindControl("gvOrder")).Visible            = true;
            }
            else if (img.ImageUrl == "~/images/collapse.JPG")
            {
                ((ImageButton)dlOrderList.Items[Index].FindControl("ibtnNOExpColap")).ImageUrl = "~/images/expand.JPG";
                ((GridView)dlOrderList.Items[Index].FindControl("gvOrder")).Visible            = false;
            }
        }
        break;

        case "BranchOrder":
        {
            Session["sOrderID"] = Encrypt_Decrypt.Encrypt(((LinkButton)dlOrderList.Items[Index].FindControl("lbtnOrderID")).Text, true);

            if (Session["RoleName_s"].ToString().Trim().ToLower() == LoginType.Admin.ToLower())
            {
                Response.Redirect("~/mudar/UpdateAdminOrder.aspx");
            }
            else if (Session["RoleName_s"].ToString().Trim().ToLower() == LoginType.Branch.ToLower() || Session["RoleName_s"].ToString().Trim().ToLower() == LoginType.Supplier.ToLower())
            {
                Response.Redirect("~/mudar/UpdateOrderNew.aspx");
                //Response.Redirect("~/mudar/Copy of UpdateOrderNew.aspx");
            }
        }
        break;

        case "Display":
        {
            string str = ((HiddenField)dlOrderList.Items[Index].FindControl("hfOrderPdf")).Value.ToString();
            //ifOrderPdf.Attributes.Add("src", str);
            //ifOrderPdf.Attributes.Add("src", "../Attachments/OrderPDF/1015/1015_PO201296.pdf");
        }
        break;

        case "Download":
        {
            string       str      = ((HiddenField)dlOrderList.Items[Index].FindControl("hfOrderPdf")).Value.ToString();
            WebClient    req      = new WebClient();
            HttpResponse response = HttpContext.Current.Response;
            response.Clear();
            response.ClearContent();
            response.ClearHeaders();
            response.Buffer = true;
            response.AddHeader("Content-Disposition", "attachment;filename=\"" + Server.MapPath(str) + "\"");
            byte[] data = req.DownloadData(Server.MapPath(str));
            response.BinaryWrite(data);
            response.End();
        }
        break;
        }
    }