protected void BtnReprintTmAck_Click(object sender, EventArgs e)
 {
     if ((this.Session["xvid"] != null) && (this.Session["xvid"].ToString() != ""))
     {
         this.transID = this.Session["xvid"].ToString();
     }
     if ((this.Session["agent_code"] != null) && (this.Session["agent_code"].ToString() != ""))
     {
         this.agent_code = this.Session["agent_code"].ToString();
     }
     this.pwalletID = this.t.getCheckStatusDetails2(this.transID, this.agent_code);
     if (this.pwalletID != "")
     {
         this.c_mark = this.t.getMarkInfoClassByUserID(this.pwalletID);
         this.c_rep = this.t.getRepClassByUserID(this.pwalletID);
         this.c_stage = this.t.getStageClassByUserID(this.pwalletID);
         this.c_app = this.t.getApplicantClassByID(this.pwalletID);
         this.c_app_addy = this.t.getAddressClassByID(this.c_app.addressID);
         this.showtm = 2;
         this.show_search = false;
     }
     else
     {
         this.showtm = 0;
         this.show_search = true;
     }
 }
        protected void BtnReprintTmAck_Click(object sender, EventArgs e)
        {
            if ((Session["xvid"] != null) && (Session["xvid"].ToString() != ""))
            {
                transID = Session["xvid"].ToString();
            }
            if ((Session["agent_code"] != null) && (Session["agent_code"].ToString() != ""))
            {
                agent_code = Session["agent_code"].ToString();
            }
            pwalletID = t.getCheckStatusDetails(transID, agent_code);
            if ((Convert.ToInt32(pwalletID) > 0) && (pwalletID != ""))
            {
                c_mark = t.getMarkInfoClassByUserID(pwalletID);
                c_rep = t.getRepClassByUserID(pwalletID);
                c_stage = t.getStageClassByUserID(pwalletID);
                c_app = t.getApplicantClassByID(pwalletID);
                c_app_addy = t.getAddressClassByID(c_app.addressID);

                if ((c_mark.xID != null) && (c_mark.logo_pic != ""))
                {
                    tm_img.ImageUrl = "http://88.150.164.30/CLD/admin/tm/" + c_mark.logo_pic;

                    Stream str = null;
                    string imageUrl = "http://88.150.164.30/CLD/admin/tm/" + c_mark.logo_pic;
                    HttpWebRequest wReq = (HttpWebRequest)WebRequest.Create(imageUrl);
                    HttpWebResponse wRes = (HttpWebResponse)(wReq).GetResponse();
                    str = wRes.GetResponseStream();

                    try
                    {
                        var imageOrig = System.Drawing.Image.FromStream(str);
                        int height = imageOrig.Height;
                        int width = imageOrig.Width;

                        if ((height > 0) && (width > 0))
                        {
                            if ((height > 240) && (width > 240))
                            {
                                if (height > width) { tm_img.Height = new Unit(320, UnitType.Pixel); tm_img.Width = new Unit(240, UnitType.Pixel); }
                                else if (height < width) { tm_img.Height = new Unit(240, UnitType.Pixel); tm_img.Width = new Unit(320, UnitType.Pixel); }
                                else { tm_img.Height = new Unit(320, UnitType.Pixel); tm_img.Width = new Unit(320, UnitType.Pixel); }
                            }
                            else
                            {
                                tm_img.Height = new Unit(height, UnitType.Pixel); tm_img.Width = new Unit(width, UnitType.Pixel);
                            }
                        }
                        else
                        {
                            tm_img.ImageUrl = "http://88.150.164.30/IpoCldng/images/na.png";
                            tm_img.Height = new Unit(240, UnitType.Pixel); tm_img.Width = new Unit(240, UnitType.Pixel);
                        }

                    }
                    catch (Exception ex)
                    {
                        tm_img.ImageUrl = "http://88.150.164.30/IpoCldng/images/na.png";
                        tm_img.Height = new Unit(240, UnitType.Pixel); tm_img.Width = new Unit(240, UnitType.Pixel);
                    }
                }
                else
                {
                    // tm_img.ImageUrl = "http://88.150.164.30/IpoCldng/images/na.png";
                    //  tm_img.Height = new Unit(240, UnitType.Pixel); tm_img.Width = new Unit(240, UnitType.Pixel);
                }
                showtm = 2;
                show_search = false;
            }
            else
            {
                showtm = 0;
                show_search = true;
            }
        }
Beispiel #3
0
        protected void gvTm_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if ((Session["tm_cnt"] != null) && (Session["tm_cnt"].ToString() != ""))
            {
                tm_cnt = Convert.ToInt32(Session["tm_cnt"]);
            }
            if ((Session["lt_ri"] != null) && (Session["lt_ri"].ToString() != ""))
            {
                lt_ri = (List<XObjs.ReportItem>)Session["lt_ri"];
            }
            gvTm.DataSource = lt_ri;
            gvTm.DataBind();
            if (e.CommandName == "TmDetailsClick")
            {

                GridViewRow namingContainer = (GridViewRow)((ImageButton)e.CommandSource).NamingContainer;
                int rowIndex = namingContainer.RowIndex;
                string new_transID = gvTm.Rows[rowIndex].Cells[1].Text;
                string item_code = gvTm.Rows[rowIndex].Cells[2].Text;
                int vcount = 0;

                if (item_code.Contains("T"))
                {
                    c_stage = t.getStageByTransID(new_transID);
                    if (Convert.ToInt32(c_stage.ID) > 0)
                    {
                        c_app = t.getApplicantByUserID(c_stage.ID);
                        c_mark = t.getMarkInfoClassByUserID(c_stage.ID);
                        c_aos = t.getAddressServiceByID(c_stage.ID);
                        c_rep = t.getRepClassByUserID(c_stage.ID);
                        if (c_rep.addressID!=null) { c_rep_addy = t.getAddressClassByID(c_rep.addressID); }
                        if (c_app.addressID!=null ){ c_app_addy = t.getAddressClassByID(c_app.addressID); }
                    }
                    else
                    {
                        Registration reg = new Registration();
                        string[] trans_arr = new_transID.Split('-');
                        int hcount = reg.updateHwalletStatus(trans_arr[2].Trim());
                        if (hcount > 0)  { vcount ++; }
                    }
                    show_inv = 2;
                }
                else if (item_code.Contains("P"))
                {
                    lt_stage = xpt.getPwalletDetailsByValidationID(new_transID);

                    if (Convert.ToInt32(lt_stage[0].ID) > 0)
                    {
                        lt_mi = xpt.getPtInfoByPwalletID(lt_stage[0].ID);
                        lt_rep = xpt.getRepListByUserID(lt_stage[0].ID);
                        lt_stage = xpt.getStageByUserID(lt_stage[0].ID);
                        lt_app = xpt.getApplicantByvalidationID(lt_stage[0].ID);
                        lt_inv = xpt.getInventorByvalidationID(lt_stage[0].ID);
                        lt_assinfo = xpt.getAssignment_infoByvalidationID(lt_stage[0].ID);
                        lt_xpri = xpt.getPriority_infoByvalidationID(lt_stage[0].ID);
                    }
                    else
                    {
                        Registration reg = new Registration();
                        string[] trans_arr = new_transID.Split('-');
                        int hcount = reg.updateHwalletStatus(trans_arr[2].Trim());
                        if (hcount > 0) { vcount++; }
                    }
                    show_inv = 3;
                }
                else if (item_code.Contains("D"))
                {
                    //c_stage = t.getStageByTransID(new_transID);
                    //if (Convert.ToInt32(c_stage.ID) > 0)
                    //{
                    //    c_app = t.getApplicantByUserID(c_stage.ID);
                    //    c_mark = t.getMarkInfoClassByUserID(c_stage.ID);
                    //    c_aos = t.getAddressServiceByID(c_stage.ID);
                    //    c_rep = t.getRepClassByUserID(c_stage.ID);
                    //    if (Convert.ToInt32(c_rep.addressID) > 0) { c_rep_addy = t.getAddressClassByID(c_rep.addressID); }
                    //    if (Convert.ToInt32(c_app.addressID) > 0) { c_app_addy = t.getAddressClassByID(c_app.addressID); }
                    //}
                    //else
                    //{
                    //    Registration reg = new Registration();
                    //    string[] trans_arr = new_transID.Split('-');
                    //    int hcount = reg.updateHwalletStatus(trans_arr[2].Trim());
                    //    if (hcount > 0)  { vcount ++; }
                    //}
                    //show_inv = 2;
                }

            }
        }