Exemple #1
0
 protected void gvTm_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "TmStatusClick")
     {
         XObjs.Shopping_card item = new XObjs.Shopping_card();
         if (Session["SCart"] != null)
         {
             lt_cart = (List<XObjs.Shopping_card>) Session["SCart"];
         }
         if (Session["SItems"] != null)
         {
             st_items = (SortedList<string, XObjs.Shopping_card>) Session["SItems"];
         }
         GridViewRow namingContainer = (GridViewRow) ((ImageButton) e.CommandSource).NamingContainer;
         int rowIndex = namingContainer.RowIndex;
         string key = e.CommandArgument.ToString();
         string text = gvTm.Rows[rowIndex].Cells[0].Text;
         string str3 = gvTm.Rows[rowIndex].Cells[2].Text;
         string str4 = gvTm.Rows[rowIndex].Cells[3].Text;
         string str5 = gvTm.Rows[rowIndex].Cells[4].Text;
         int amt = Convert.ToInt32(gvTm.Rows[rowIndex].Cells[5].Text);
         TextBox box = (TextBox) gvTm.Rows[rowIndex].Cells[6].FindControl("txtTm");
         ImageButton button = (ImageButton) gvTm.Rows[rowIndex].Cells[7].FindControl("lbAddTm");
         if (((box.Text != "") && (box.Text != "0")) && (val.IsInt32(box.Text) == 0))
         {
             if (button.ImageUrl != "../images/remove.png")
             {
                 double num3 = calcTotalAmt(Convert.ToInt32(box.Text), amt);
                 item.xid = text;
                 item.amt = amt;
                 item.qty = box.Text;
                 item.total_amt = num3;
                 item.item_code = key;
                 item.item_desc = str3;
                 item.init_amt = str4;
                 item.tech_amt = str5;
                 if (!lt_cart.Contains(item))
                 {
                     lt_cart.Add(item);
                     Session["SItems"] = st_items;
                 }
                 if (!st_items.ContainsKey(key))
                 {
                     st_items.Add(key, item);
                     Session["SCart"] = lt_cart;
                 }
                 box.ReadOnly = true;
                 button.ImageUrl = "../images/remove.png";
             }
             else
             {
                 if (lt_cart.Contains(st_items[key]))
                 {
                     lt_cart.Remove(st_items[key]);
                 }
                 box.Text = "0";
                 box.ReadOnly = false;
                 button.ImageUrl = "../images/add_btn.png";
             }
         }
         displayTotals();
         show_inv = 1;
     }
 }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                Session["Sl_init"] = null;
                Session["Sl_tech"] = null;
                Session["SCart"] = null;
                Session["SItems"] = null;
                Session["c_app"] = null;
                Session["onlineid"] = null;
                Session["onlineid2"] = null;
                Session["onlineid3"] = null;
                Session["onlineid4"] = null;
                Session["onlineid5"] = null;
                Session["onlineid6"] = null;
                Session["onlineid7"] = null;
                Session["onlineid8"] = null;
                Session["onlineid9"] = null;
                if (base.Request.Form["xname"] != null)
                {
                 txt_app_name.Text=   base.Request.Form["xname"].ToString();
                }

                 if (base.Request.Form["address"] != null)
                {
                 txt_app_addy.Text=   base.Request.Form["address"].ToString();

                 }

                 if (base.Request.Form["email"] != null)
                 {
                     txt_app_email.Text = base.Request.Form["email"].ToString();

                 }

                 if (base.Request.Form["PhoneNumber"] != null)
                 {
                     txt_app_no.Text = base.Request.Form["PhoneNumber"].ToString();
                     adminID = base.Request.Form["pwalletID"].ToString();
                     Session["pwalletID"] = adminID;

                     c_reg = ret.getRegistrationByID(adminID);
                     Session["c_reg"] = c_reg;

                     gvTm.Visible = false;

                     gvPt.Visible = false;

                     gvDs.Visible = false;

                     gvAg.Visible = false;

                     gvAg2.Visible = true;

                     gvAg3.Visible = false;

                     ppp.Visible = false;

                     Session["c_app"] = null;
                     c_app.address = txt_app_addy.Text;
                     c_app.xemail = txt_app_email.Text;
                     c_app.xmobile = txt_app_no.Text;
                     c_app.xname = txt_app_name.Text;
                     Session["c_app"] = c_app;
                      XObjs.Shopping_card item = new XObjs.Shopping_card();
                     foreach (GridViewRow row in gvAg2.Rows)
                     {
                         TextBox chkBox = row.FindControl("txtAg") as TextBox;

                         chkBox.Text = "1";

                           string key = row.Cells[1].Text;
                       //  string key = gvAg2.DataKeys[row.RowIndex].Value.ToString();

                string text = row.Cells[0].Text;
                string str3 = row.Cells[2].Text;
                string str4 = row.Cells[3].Text;
                string str5 = row.Cells[4].Text;
                int amt = Convert.ToInt32(row.Cells[5].Text);

                          double num3 = calcTotalAmt(Convert.ToInt32(chkBox.Text), amt);
                        item.xid = text;
                        item.amt = amt;
                        item.qty = chkBox.Text;
                        item.total_amt = num3;
                        item.item_code = key;
                        item.item_desc = str3;
                        item.init_amt = str4;
                        item.tech_amt = str5;
                        if (!lt_cart.Contains(item))
                        {
                            lt_cart.Add(item);
                            Session["SItems"] = st_items;
                        }
                        if (!st_items.ContainsKey(key))
                        {
                            st_items.Add(key, item);
                            Session["SCart"] = lt_cart;
                        }

                     }
                     Session["AgentType"] = "Agent";
                     fillAmtList();
                     AddFeeList();

                     //if (Session["SCart"] != null)
                     //{
                     //    lt_cart = (List<XObjs.Shopping_card>)Session["SCart"];
                     //    if (lt_cart.Count > 0)
                     //    {
                     //        show_inv = 2;
                     //    }
                     //    else
                     //    {
                     //        show_inv = 1;
                     //    }
                     //}
                     //else
                     //{
                     //    show_inv = 1;
                     //}

                 }

                 if (base.Request.Form["PhoneNumber2"] != null)
                 {
                     txt_app_no.Text = base.Request.Form["PhoneNumber2"].ToString();
                     adminID = base.Request.Form["pwalletID"].ToString();
                     Session["pwalletID"] = adminID;

                     c_reg = ret.getRegistrationByID(adminID);
                     Session["c_reg"] = c_reg;

                     gvTm.Visible = false;

                     gvPt.Visible = false;

                     gvDs.Visible = false;

                     gvAg.Visible = false;

                     gvAg2.Visible = false;
                     gvAg3.Visible =true;

                     ppp.Visible = false;

                     if (base.Request.Form["onlineid"] != null)
                     {
                         Session["onlineid"] = base.Request.Form["onlineid"].ToString();
                     }

                     Session["c_app"] = null;

                     txt_app_addy.Text = base.Request.Form["address2"].ToString();
                     txt_app_email.Text = base.Request.Form["email2"].ToString();
                     txt_app_no.Text = base.Request.Form["PhoneNumber77"].ToString();
                     txt_app_name.Text = base.Request.Form["xname2"].ToString();
                     c_app.address = txt_app_addy.Text;
                     c_app.xemail = txt_app_email.Text;
                     c_app.xmobile = txt_app_no.Text;
                     c_app.xname = txt_app_name.Text;
                     Session["c_app"] = c_app;
                     XObjs.Shopping_card item = new XObjs.Shopping_card();
                     foreach (GridViewRow row in gvAg3.Rows)
                     {
                         TextBox chkBox = row.FindControl("txtAg") as TextBox;

                         chkBox.Text = "1";

                         string key = row.Cells[1].Text;
                         //  string key = gvAg2.DataKeys[row.RowIndex].Value.ToString();

                         string text = row.Cells[0].Text;
                         string str3 = row.Cells[2].Text;
                         string str4 = row.Cells[3].Text;
                         string str5 = row.Cells[4].Text;
                         int amt = Convert.ToInt32(row.Cells[5].Text);

                         double num3 = calcTotalAmt(Convert.ToInt32(chkBox.Text), amt);
                         item.xid = text;
                         item.amt = amt;
                         item.qty = chkBox.Text;
                         item.total_amt = num3;
                         item.item_code = key;
                         item.item_desc = str3;
                         item.init_amt = str4;
                         item.tech_amt = str5;
                         if (!lt_cart.Contains(item))
                         {
                             lt_cart.Add(item);
                             Session["SItems"] = st_items;
                         }
                         if (!st_items.ContainsKey(key))
                         {
                             st_items.Add(key, item);
                             Session["SCart"] = lt_cart;
                         }

                     }
                     Session["AgentType"] = "Agent";
                     fillAmtList();
                     AddFeeList();

                     //if (Session["SCart"] != null)
                     //{
                     //    lt_cart = (List<XObjs.Shopping_card>)Session["SCart"];
                     //    if (lt_cart.Count > 0)
                     //    {
                     //        show_inv = 2;
                     //    }
                     //    else
                     //    {
                     //        show_inv = 1;
                     //    }
                     //}
                     //else
                     //{
                     //    show_inv = 1;
                     //}

                 }

                 if (base.Request.Form["PhoneNumber3"] != null)
                 {
                     txt_app_no.Text = base.Request.Form["PhoneNumber3"].ToString();
                     adminID = base.Request.Form["pwalletID"].ToString();
                     Session["pwalletID"] = adminID;

                     c_reg = ret.getRegistrationByID(adminID);
                     Session["c_reg"] = c_reg;

                     gvTm.Visible = false;

                     gvPt.Visible = false;

                     gvDs.Visible = false;

                     gvAg.Visible = false;

                     gvAg2.Visible = false;
                     gvAg3.Visible = true;

                     ppp.Visible = false;

                     if (base.Request.Form["onlineid"] != null)
                     {
                         Session["onlineid2"] = base.Request.Form["onlineid"].ToString();
                     }

                     Session["c_app"] = null;

                     txt_app_addy.Text = base.Request.Form["address2"].ToString();
                     txt_app_email.Text = base.Request.Form["email2"].ToString();
                     txt_app_no.Text = base.Request.Form["PhoneNumber77"].ToString();
                     txt_app_name.Text = base.Request.Form["xname2"].ToString();
                     c_app.address = txt_app_addy.Text;
                     c_app.xemail = txt_app_email.Text;
                     c_app.xmobile = txt_app_no.Text;
                     c_app.xname = txt_app_name.Text;
                     Session["c_app"] = c_app;
                     XObjs.Shopping_card item = new XObjs.Shopping_card();
                     foreach (GridViewRow row in gvAg3.Rows)
                     {
                         TextBox chkBox = row.FindControl("txtAg") as TextBox;

                         chkBox.Text = "1";

                         string key = row.Cells[1].Text;
                         //  string key = gvAg2.DataKeys[row.RowIndex].Value.ToString();

                         string text = row.Cells[0].Text;
                         string str3 = row.Cells[2].Text;
                         string str4 = row.Cells[3].Text;
                         string str5 = row.Cells[4].Text;
                         int amt = Convert.ToInt32(row.Cells[5].Text);

                         double num3 = calcTotalAmt(Convert.ToInt32(chkBox.Text), amt);
                         item.xid = text;
                         item.amt = amt;
                         item.qty = chkBox.Text;
                         item.total_amt = num3;
                         item.item_code = key;
                         item.item_desc = str3;
                         item.init_amt = str4;
                         item.tech_amt = str5;
                         if (!lt_cart.Contains(item))
                         {
                             lt_cart.Add(item);
                             Session["SItems"] = st_items;
                         }
                         if (!st_items.ContainsKey(key))
                         {
                             st_items.Add(key, item);
                             Session["SCart"] = lt_cart;
                         }

                     }
                     Session["AgentType"] = "Agent";
                     fillAmtList();
                     AddFeeList();

                     //if (Session["SCart"] != null)
                     //{
                     //    lt_cart = (List<XObjs.Shopping_card>)Session["SCart"];
                     //    if (lt_cart.Count > 0)
                     //    {
                     //        show_inv = 2;
                     //    }
                     //    else
                     //    {
                     //        show_inv = 1;
                     //    }
                     //}
                     //else
                     //{
                     //    show_inv = 1;
                     //}

                 }

                 if (base.Request.Form["PhoneNumber4"] != null)
                 {
                     txt_app_no.Text = base.Request.Form["PhoneNumber4"].ToString();
                     adminID = base.Request.Form["pwalletID"].ToString();
                     Session["pwalletID"] = adminID;

                     c_reg = ret.getRegistrationByID(adminID);
                     Session["c_reg"] = c_reg;

                     gvTm.Visible = false;

                     gvPt.Visible = false;

                     gvDs.Visible = false;

                     gvAg.Visible = false;

                     gvAg2.Visible = false;
                     gvAg3.Visible = false;
                     gvAg4.Visible = true;

                     ppp.Visible = false;

                     if (base.Request.Form["onlineid"] != null)
                     {
                         Session["onlineid3"] = base.Request.Form["onlineid"].ToString();
                     }

                     Session["c_app"] = null;
                     txt_app_addy.Text = base.Request.Form["address2"].ToString();
                     txt_app_email.Text = base.Request.Form["email2"].ToString();
                     txt_app_no.Text = base.Request.Form["PhoneNumber77"].ToString();
                     txt_app_name.Text = base.Request.Form["xname2"].ToString();
                     c_app.address = txt_app_addy.Text;

                     c_app.xemail = txt_app_email.Text;
                     c_app.xmobile = txt_app_no.Text;
                     c_app.xname = txt_app_name.Text;
                     Session["c_app"] = c_app;
                     XObjs.Shopping_card item = new XObjs.Shopping_card();
                     foreach (GridViewRow row in gvAg4.Rows)
                     {
                         TextBox chkBox = row.FindControl("txtAg") as TextBox;

                         chkBox.Text = "1";

                         string key = row.Cells[1].Text;
                         //  string key = gvAg2.DataKeys[row.RowIndex].Value.ToString();

                         string text = row.Cells[0].Text;
                         string str3 = row.Cells[2].Text;
                         string str4 = row.Cells[3].Text;
                         string str5 = row.Cells[4].Text;
                         int amt = Convert.ToInt32(row.Cells[5].Text);

                         double num3 = calcTotalAmt(Convert.ToInt32(chkBox.Text), amt);
                         item.xid = text;
                         item.amt = amt;
                         item.qty = chkBox.Text;
                         item.total_amt = num3;
                         item.item_code = key;
                         item.item_desc = str3;
                         item.init_amt = str4;
                         item.tech_amt = str5;
                         if (!lt_cart.Contains(item))
                         {
                             lt_cart.Add(item);
                             Session["SItems"] = st_items;
                         }
                         if (!st_items.ContainsKey(key))
                         {
                             st_items.Add(key, item);
                             Session["SCart"] = lt_cart;
                         }

                     }
                     Session["AgentType"] = "Agent";
                     fillAmtList();
                     AddFeeList();

                     //if (Session["SCart"] != null)
                     //{
                     //    lt_cart = (List<XObjs.Shopping_card>)Session["SCart"];
                     //    if (lt_cart.Count > 0)
                     //    {
                     //        show_inv = 2;
                     //    }
                     //    else
                     //    {
                     //        show_inv = 1;
                     //    }
                     //}
                     //else
                     //{
                     //    show_inv = 1;
                     //}

                 }

                 if (base.Request.Form["PhoneNumber5"] != null)
                 {
                     txt_app_no.Text = base.Request.Form["PhoneNumber5"].ToString();
                     adminID = base.Request.Form["pwalletID"].ToString();
                     Session["pwalletID"] = adminID;

                     c_reg = ret.getRegistrationByID(adminID);
                     Session["c_reg"] = c_reg;

                     gvTm.Visible = false;

                     gvPt.Visible = false;

                     gvDs.Visible = false;

                     gvAg.Visible = false;

                     gvAg2.Visible = false;
                     gvAg3.Visible = false;
                     gvAg4.Visible = true;

                     ppp.Visible = false;

                     if (base.Request.Form["onlineid"] != null)
                     {
                         Session["onlineid4"] = base.Request.Form["onlineid"].ToString();
                     }

                     Session["c_app"] = null;
                     txt_app_addy.Text = base.Request.Form["address2"].ToString();
                     txt_app_email.Text = base.Request.Form["email2"].ToString();
                     txt_app_no.Text = base.Request.Form["PhoneNumber77"].ToString();
                     txt_app_name.Text = base.Request.Form["xname2"].ToString();
                     c_app.address = txt_app_addy.Text;
                     c_app.xemail = txt_app_email.Text;
                     c_app.xmobile = txt_app_no.Text;
                     c_app.xname = txt_app_name.Text;
                     Session["c_app"] = c_app;
                     XObjs.Shopping_card item = new XObjs.Shopping_card();
                     foreach (GridViewRow row in gvAg4.Rows)
                     {
                         TextBox chkBox = row.FindControl("txtAg") as TextBox;

                         chkBox.Text = "1";

                         string key = row.Cells[1].Text;
                         //  string key = gvAg2.DataKeys[row.RowIndex].Value.ToString();

                         string text = row.Cells[0].Text;
                         string str3 = row.Cells[2].Text;
                         string str4 = row.Cells[3].Text;
                         string str5 = row.Cells[4].Text;
                         int amt = Convert.ToInt32(row.Cells[5].Text);

                         double num3 = calcTotalAmt(Convert.ToInt32(chkBox.Text), amt);
                         item.xid = text;
                         item.amt = amt;
                         item.qty = chkBox.Text;
                         item.total_amt = num3;
                         item.item_code = key;
                         item.item_desc = str3;
                         item.init_amt = str4;
                         item.tech_amt = str5;
                         if (!lt_cart.Contains(item))
                         {
                             lt_cart.Add(item);
                             Session["SItems"] = st_items;
                         }
                         if (!st_items.ContainsKey(key))
                         {
                             st_items.Add(key, item);
                             Session["SCart"] = lt_cart;
                         }

                     }
                     Session["AgentType"] = "Agent";
                     fillAmtList();
                     AddFeeList();

                     //if (Session["SCart"] != null)
                     //{
                     //    lt_cart = (List<XObjs.Shopping_card>)Session["SCart"];
                     //    if (lt_cart.Count > 0)
                     //    {
                     //        show_inv = 2;
                     //    }
                     //    else
                     //    {
                     //        show_inv = 1;
                     //    }
                     //}
                     //else
                     //{
                     //    show_inv = 1;
                     //}

                 }

                 if (base.Request.Form["PhoneNumber6"] != null)
                 {
                     txt_app_no.Text = base.Request.Form["PhoneNumber6"].ToString();
                     adminID = base.Request.Form["pwalletID"].ToString();
                     Session["pwalletID"] = adminID;

                     c_reg = ret.getRegistrationByID(adminID);
                     Session["c_reg"] = c_reg;

                     gvTm.Visible = false;

                     gvPt.Visible = false;

                     gvDs.Visible = false;

                     gvAg.Visible = false;

                     gvAg2.Visible = false;
                     gvAg3.Visible = false;
                     gvAg4.Visible = true;

                     ppp.Visible = false;

                     if (base.Request.Form["onlineid"] != null)
                     {
                         Session["onlineid5"] = base.Request.Form["onlineid"].ToString();
                     }

                     Session["c_app"] = null;
                     txt_app_addy.Text = base.Request.Form["address2"].ToString();
                     txt_app_email.Text = base.Request.Form["email2"].ToString();
                     txt_app_no.Text = base.Request.Form["PhoneNumber77"].ToString();
                     txt_app_name.Text = base.Request.Form["xname2"].ToString();
                     c_app.address = txt_app_addy.Text;
                     c_app.xemail = txt_app_email.Text;
                     c_app.xmobile = txt_app_no.Text;
                     c_app.xname = txt_app_name.Text;
                     Session["c_app"] = c_app;
                     XObjs.Shopping_card item = new XObjs.Shopping_card();
                     foreach (GridViewRow row in gvAg4.Rows)
                     {
                         TextBox chkBox = row.FindControl("txtAg") as TextBox;

                         chkBox.Text = "1";

                         string key = row.Cells[1].Text;
                         //  string key = gvAg2.DataKeys[row.RowIndex].Value.ToString();

                         string text = row.Cells[0].Text;
                         string str3 = row.Cells[2].Text;
                         string str4 = row.Cells[3].Text;
                         string str5 = row.Cells[4].Text;
                         int amt = Convert.ToInt32(row.Cells[5].Text);

                         double num3 = calcTotalAmt(Convert.ToInt32(chkBox.Text), amt);
                         item.xid = text;
                         item.amt = amt;
                         item.qty = chkBox.Text;
                         item.total_amt = num3;
                         item.item_code = key;
                         item.item_desc = str3;
                         item.init_amt = str4;
                         item.tech_amt = str5;
                         if (!lt_cart.Contains(item))
                         {
                             lt_cart.Add(item);
                             Session["SItems"] = st_items;
                         }
                         if (!st_items.ContainsKey(key))
                         {
                             st_items.Add(key, item);
                             Session["SCart"] = lt_cart;
                         }

                     }
                     Session["AgentType"] = "Agent";
                     fillAmtList();
                     AddFeeList();

                     //if (Session["SCart"] != null)
                     //{
                     //    lt_cart = (List<XObjs.Shopping_card>)Session["SCart"];
                     //    if (lt_cart.Count > 0)
                     //    {
                     //        show_inv = 2;
                     //    }
                     //    else
                     //    {
                     //        show_inv = 1;
                     //    }
                     //}
                     //else
                     //{
                     //    show_inv = 1;
                     //}

                 }

                 if (base.Request.Form["PhoneNumber7"] != null)
                 {
                     txt_app_no.Text = base.Request.Form["PhoneNumber7"].ToString();
                     adminID = base.Request.Form["pwalletID"].ToString();
                     Session["pwalletID"] = adminID;

                     c_reg = ret.getRegistrationByID(adminID);
                     Session["c_reg"] = c_reg;

                     gvTm.Visible = false;

                     gvPt.Visible = false;

                     gvDs.Visible = false;

                     gvAg.Visible = false;

                     gvAg2.Visible = false;
                     gvAg3.Visible = false;
                     gvAg4.Visible = false;
                     gvAg5.Visible = true;

                     ppp.Visible = false;

                     if (base.Request.Form["onlineid"] != null)
                     {
                         Session["onlineid6"] = base.Request.Form["onlineid"].ToString();
                     }

                     Session["c_app"] = null;
                     txt_app_addy.Text = base.Request.Form["address2"].ToString();
                     txt_app_email.Text = base.Request.Form["email2"].ToString();
                     txt_app_no.Text = base.Request.Form["PhoneNumber77"].ToString();
                     txt_app_name.Text = base.Request.Form["xname2"].ToString();
                     c_app.address = txt_app_addy.Text;
                     c_app.xemail = txt_app_email.Text;
                     c_app.xmobile = txt_app_no.Text;
                     c_app.xname = txt_app_name.Text;
                     Session["c_app"] = c_app;
                     XObjs.Shopping_card item = new XObjs.Shopping_card();
                     foreach (GridViewRow row in gvAg5.Rows)
                     {
                         TextBox chkBox = row.FindControl("txtAg") as TextBox;

                         chkBox.Text = "1";

                         string key = row.Cells[1].Text;
                         //  string key = gvAg2.DataKeys[row.RowIndex].Value.ToString();

                         string text = row.Cells[0].Text;
                         string str3 = row.Cells[2].Text;
                         string str4 = row.Cells[3].Text;
                         string str5 = row.Cells[4].Text;
                         int amt = Convert.ToInt32(row.Cells[5].Text);

                         double num3 = calcTotalAmt(Convert.ToInt32(chkBox.Text), amt);
                         item.xid = text;
                         item.amt = amt;
                         item.qty = chkBox.Text;
                         item.total_amt = num3;
                         item.item_code = key;
                         item.item_desc = str3;
                         item.init_amt = str4;
                         item.tech_amt = str5;
                         if (!lt_cart.Contains(item))
                         {
                             lt_cart.Add(item);
                             Session["SItems"] = st_items;
                         }
                         if (!st_items.ContainsKey(key))
                         {
                             st_items.Add(key, item);
                             Session["SCart"] = lt_cart;
                         }

                     }
                     Session["AgentType"] = "Agent";
                     fillAmtList();
                     AddFeeList();

                 }

                 if (base.Request.Form["PhoneNumber8"] != null)
                 {
                     txt_app_no.Text = base.Request.Form["PhoneNumber8"].ToString();
                     adminID = base.Request.Form["pwalletID"].ToString();
                     Session["pwalletID"] = adminID;

                     c_reg = ret.getRegistrationByID(adminID);
                     Session["c_reg"] = c_reg;

                     gvTm.Visible = false;

                     gvPt.Visible = false;

                     gvDs.Visible = false;

                     gvAg.Visible = false;

                     gvAg2.Visible = false;
                     gvAg3.Visible = false;
                     gvAg4.Visible = false;
                     gvAg5.Visible = false;
                     gvAg6.Visible = true;

                     ppp.Visible = false;

                     if (base.Request.Form["onlineid"] != null)
                     {
                         Session["onlineid7"] = base.Request.Form["onlineid"].ToString();
                     }

                     Session["c_app"] = null;
                     txt_app_addy.Text = base.Request.Form["address2"].ToString();
                     txt_app_email.Text = base.Request.Form["email2"].ToString();
                     txt_app_no.Text = base.Request.Form["PhoneNumber77"].ToString();
                     txt_app_name.Text = base.Request.Form["xname2"].ToString();
                     c_app.address = txt_app_addy.Text;
                     c_app.xemail = txt_app_email.Text;
                     c_app.xmobile = txt_app_no.Text;
                     c_app.xname = txt_app_name.Text;
                     Session["c_app"] = c_app;
                     XObjs.Shopping_card item = new XObjs.Shopping_card();
                     foreach (GridViewRow row in gvAg6.Rows)
                     {
                         TextBox chkBox = row.FindControl("txtAg") as TextBox;

                         chkBox.Text = "1";

                         string key = row.Cells[1].Text;
                         //  string key = gvAg2.DataKeys[row.RowIndex].Value.ToString();

                         string text = row.Cells[0].Text;
                         string str3 = row.Cells[2].Text;
                         string str4 = row.Cells[3].Text;
                         string str5 = row.Cells[4].Text;
                         int amt = Convert.ToInt32(row.Cells[5].Text);

                         double num3 = calcTotalAmt(Convert.ToInt32(chkBox.Text), amt);
                         item.xid = text;
                         item.amt = amt;
                         item.qty = chkBox.Text;
                         item.total_amt = num3;
                         item.item_code = key;
                         item.item_desc = str3;
                         item.init_amt = str4;
                         item.tech_amt = str5;
                         if (!lt_cart.Contains(item))
                         {
                             lt_cart.Add(item);
                             Session["SItems"] = st_items;
                         }
                         if (!st_items.ContainsKey(key))
                         {
                             st_items.Add(key, item);
                             Session["SCart"] = lt_cart;
                         }

                     }
                     Session["AgentType"] = "Agent";
                     fillAmtList();
                     AddFeeList();

                 }
                 if (base.Request.Form["PhoneNumber9"] != null)
                 {
                     txt_app_no.Text = base.Request.Form["PhoneNumber9"].ToString();
                     adminID = base.Request.Form["pwalletID"].ToString();
                     Session["pwalletID"] = adminID;

                     c_reg = ret.getRegistrationByID(adminID);
                     Session["c_reg"] = c_reg;

                     gvTm.Visible = false;

                     gvPt.Visible = false;

                     gvDs.Visible = false;

                     gvAg.Visible = false;

                     gvAg2.Visible = false;
                     gvAg3.Visible = false;
                     gvAg4.Visible = false;
                     gvAg5.Visible = false;
                     gvAg6.Visible = true;

                     ppp.Visible = false;

                     if (base.Request.Form["onlineid"] != null)
                     {
                         Session["onlineid8"] = base.Request.Form["onlineid"].ToString();
                     }

                     Session["c_app"] = null;
                     txt_app_addy.Text = base.Request.Form["address2"].ToString();
                     txt_app_email.Text = base.Request.Form["email2"].ToString();
                     txt_app_no.Text = base.Request.Form["PhoneNumber77"].ToString();
                     txt_app_name.Text = base.Request.Form["xname2"].ToString();
                     c_app.address = txt_app_addy.Text;
                     c_app.xemail = txt_app_email.Text;
                     c_app.xmobile = txt_app_no.Text;
                     c_app.xname = txt_app_name.Text;
                     Session["c_app"] = c_app;
                     XObjs.Shopping_card item = new XObjs.Shopping_card();
                     foreach (GridViewRow row in gvAg6.Rows)
                     {
                         TextBox chkBox = row.FindControl("txtAg") as TextBox;

                         chkBox.Text = "1";

                         string key = row.Cells[1].Text;
                         //  string key = gvAg2.DataKeys[row.RowIndex].Value.ToString();

                         string text = row.Cells[0].Text;
                         string str3 = row.Cells[2].Text;
                         string str4 = row.Cells[3].Text;
                         string str5 = row.Cells[4].Text;
                         int amt = Convert.ToInt32(row.Cells[5].Text);

                         double num3 = calcTotalAmt(Convert.ToInt32(chkBox.Text), amt);
                         item.xid = text;
                         item.amt = amt;
                         item.qty = chkBox.Text;
                         item.total_amt = num3;
                         item.item_code = key;
                         item.item_desc = str3;
                         item.init_amt = str4;
                         item.tech_amt = str5;
                         if (!lt_cart.Contains(item))
                         {
                             lt_cart.Add(item);
                             Session["SItems"] = st_items;
                         }
                         if (!st_items.ContainsKey(key))
                         {
                             st_items.Add(key, item);
                             Session["SCart"] = lt_cart;
                         }

                     }
                     Session["AgentType"] = "Agent";
                     fillAmtList();
                     AddFeeList();

                 }

                 if (base.Request.Form["PhoneNumber10"] != null)
                 {
                     txt_app_no.Text = base.Request.Form["PhoneNumber10"].ToString();
                     adminID = base.Request.Form["pwalletID"].ToString();
                     Session["pwalletID"] = adminID;

                     c_reg = ret.getRegistrationByID(adminID);
                     Session["c_reg"] = c_reg;

                     gvTm.Visible = false;

                     gvPt.Visible = false;

                     gvDs.Visible = false;

                     gvAg.Visible = false;

                     gvAg2.Visible = false;
                     gvAg3.Visible = false;
                     gvAg4.Visible = false;
                     gvAg5.Visible = false;
                     gvAg6.Visible = true;

                     ppp.Visible = false;

                     if (base.Request.Form["onlineid"] != null)
                     {
                         Session["onlineid9"] = base.Request.Form["onlineid"].ToString();
                     }

                     Session["c_app"] = null;
                     txt_app_addy.Text = base.Request.Form["address2"].ToString();
                     txt_app_email.Text = base.Request.Form["email2"].ToString();
                     txt_app_no.Text = base.Request.Form["PhoneNumber77"].ToString();
                     txt_app_name.Text = base.Request.Form["xname2"].ToString();
                     c_app.address = txt_app_addy.Text;
                     c_app.xemail = txt_app_email.Text;
                     c_app.xmobile = txt_app_no.Text;
                     c_app.xname = txt_app_name.Text;
                     Session["c_app"] = c_app;
                     XObjs.Shopping_card item = new XObjs.Shopping_card();
                     foreach (GridViewRow row in gvAg7.Rows)
                     {
                         TextBox chkBox = row.FindControl("txtAg") as TextBox;

                         chkBox.Text = "1";

                         string key = row.Cells[1].Text;
                         //  string key = gvAg2.DataKeys[row.RowIndex].Value.ToString();

                         string text = row.Cells[0].Text;
                         string str3 = row.Cells[2].Text;
                         string str4 = row.Cells[3].Text;
                         string str5 = row.Cells[4].Text;
                         int amt = Convert.ToInt32(row.Cells[5].Text);

                         double num3 = calcTotalAmt(Convert.ToInt32(chkBox.Text), amt);
                         item.xid = text;
                         item.amt = amt;
                         item.qty = chkBox.Text;
                         item.total_amt = num3;
                         item.item_code = key;
                         item.item_desc = str3;
                         item.init_amt = str4;
                         item.tech_amt = str5;
                         if (!lt_cart.Contains(item))
                         {
                             lt_cart.Add(item);
                             Session["SItems"] = st_items;
                         }
                         if (!st_items.ContainsKey(key))
                         {
                             st_items.Add(key, item);
                             Session["SCart"] = lt_cart;
                         }

                     }
                     Session["AgentType"] = "Agent";
                     fillAmtList();
                     AddFeeList();

                 }

                if (base.Request.Form["PhoneNumber11"] != null)
                {
                    txt_app_no.Text = base.Request.Form["PhoneNumber11"].ToString();
                    adminID = base.Request.Form["pwalletID"].ToString();
                    Session["pwalletID"] = adminID;

                    c_reg = ret.getRegistrationByID(adminID);
                    Session["c_reg"] = c_reg;

                    gvTm.Visible = false;

                    gvPt.Visible = false;

                    gvDs.Visible = false;

                    gvAg.Visible = false;

                    gvAg2.Visible = false;
                    gvAg3.Visible = false;
                    gvAg4.Visible = false;
                    gvAg5.Visible = false;
                    gvAg6.Visible = false;
                    gvAg7.Visible = false;
                    gvAg8.Visible = true;
                    ppp.Visible = false;

                    if (base.Request.Form["onlineid"] != null)
                    {
                        Session["onlineid10"] = base.Request.Form["onlineid"].ToString();
                    }

                    Session["c_app"] = null;
                    txt_app_addy.Text = base.Request.Form["address2"].ToString();
                    txt_app_email.Text = base.Request.Form["email2"].ToString();
                    txt_app_no.Text = base.Request.Form["PhoneNumber77"].ToString();
                    txt_app_name.Text = base.Request.Form["xname2"].ToString();
                    c_app.address = txt_app_addy.Text;
                    c_app.xemail = txt_app_email.Text;
                    c_app.xmobile = txt_app_no.Text;
                    c_app.xname = txt_app_name.Text;
                    Session["c_app"] = c_app;
                    XObjs.Shopping_card item = new XObjs.Shopping_card();
                    foreach (GridViewRow row in gvAg8.Rows)
                    {
                        TextBox chkBox = row.FindControl("txtAg") as TextBox;

                        chkBox.Text = "1";

                        string key = row.Cells[1].Text;
                        //  string key = gvAg2.DataKeys[row.RowIndex].Value.ToString();

                        string text = row.Cells[0].Text;
                        string str3 = row.Cells[2].Text;
                        string str4 = row.Cells[3].Text;
                        string str5 = row.Cells[4].Text;
                        int amt = Convert.ToInt32(row.Cells[5].Text);

                        double num3 = calcTotalAmt(Convert.ToInt32(chkBox.Text), amt);
                        item.xid = text;
                        item.amt = amt;
                        item.qty = chkBox.Text;
                        item.total_amt = num3;
                        item.item_code = key;
                        item.item_desc = str3;
                        item.init_amt = str4;
                        item.tech_amt = str5;
                        if (!lt_cart.Contains(item))
                        {
                            lt_cart.Add(item);
                            Session["SItems"] = st_items;
                        }
                        if (!st_items.ContainsKey(key))
                        {
                            st_items.Add(key, item);
                            Session["SCart"] = lt_cart;
                        }

                    }
                    Session["AgentType"] = "Agent";
                    fillAmtList();
                    AddFeeList();

                }

                if (base.Request.Form["PhoneNumber12"] != null)
                {
                    txt_app_no.Text = base.Request.Form["PhoneNumber12"].ToString();
                    adminID = base.Request.Form["pwalletID"].ToString();
                    Session["pwalletID"] = adminID;

                    c_reg = ret.getRegistrationByID(adminID);
                    Session["c_reg"] = c_reg;

                    gvTm.Visible = false;

                    gvPt.Visible = false;

                    gvDs.Visible = false;

                    gvAg.Visible = false;

                    gvAg2.Visible = false;
                    gvAg3.Visible = false;
                    gvAg4.Visible = false;
                    gvAg5.Visible = false;
                    gvAg6.Visible = false;
                    gvAg9.Visible = true;

                    ppp.Visible = false;

                    if (base.Request.Form["onlineid"] != null)
                    {
                        Session["onlineid12"] = base.Request.Form["onlineid"].ToString();
                    }

                    Session["c_app"] = null;
                    txt_app_addy.Text = base.Request.Form["address2"].ToString();
                    txt_app_email.Text = base.Request.Form["email2"].ToString();
                    txt_app_no.Text = base.Request.Form["PhoneNumber77"].ToString();
                    txt_app_name.Text = base.Request.Form["xname2"].ToString();
                    c_app.address = txt_app_addy.Text;
                    c_app.xemail = txt_app_email.Text;
                    c_app.xmobile = txt_app_no.Text;
                    c_app.xname = txt_app_name.Text;
                    Session["c_app"] = c_app;
                    XObjs.Shopping_card item = new XObjs.Shopping_card();
                    foreach (GridViewRow row in gvAg9.Rows)
                    {
                        TextBox chkBox = row.FindControl("txtAg") as TextBox;

                        chkBox.Text = "1";

                        string key = row.Cells[1].Text;
                        //  string key = gvAg2.DataKeys[row.RowIndex].Value.ToString();

                        string text = row.Cells[0].Text;
                        string str3 = row.Cells[2].Text;
                        string str4 = row.Cells[3].Text;
                        string str5 = row.Cells[4].Text;
                        int amt = Convert.ToInt32(row.Cells[5].Text);

                        double num3 = calcTotalAmt(Convert.ToInt32(chkBox.Text), amt);
                        item.xid = text;
                        item.amt = amt;
                        item.qty = chkBox.Text;
                        item.total_amt = num3;
                        item.item_code = key;
                        item.item_desc = str3;
                        item.init_amt = str4;
                        item.tech_amt = str5;
                        if (!lt_cart.Contains(item))
                        {
                            lt_cart.Add(item);
                            Session["SItems"] = st_items;
                        }
                        if (!st_items.ContainsKey(key))
                        {
                            st_items.Add(key, item);
                            Session["SCart"] = lt_cart;
                        }

                    }
                    Session["AgentType"] = "Agent";
                    fillAmtList();
                    AddFeeList();

                }

                fillAmtList();
                if ((((base.Request.Form["agentType"] != null) && (base.Request.Form["agentType"].ToString() != "")) && (base.Request.Form["pwalletID"] != null)) && (base.Request.Form["pwalletID"].ToString() != ""))
                {

                    adminID = base.Request.Form["pwalletID"].ToString();
                    Session["pwalletID"] = adminID;
                    agentType = base.Request.Form["agentType"].ToString();
                    Session["agentType"] = agentType;
                    if (agentType == "Agent")
                    {
                        c_reg = ret.getRegistrationByID(adminID);
                        Session["c_reg"] = c_reg;
                    }
                    else
                    {
                        c_sub = ret.getSubAgentByID(adminID);
                        Session["c_sub"] = c_sub;
                        c_sub_reg = ret.getRegistrationBySubagentRegistrationID(c_sub.RegistrationID);
                        Session["c_sub_reg"] = c_sub_reg;
                    }
                }
                else
                {
                    base.Response.Redirect(ConfigurationManager.AppSettings["agent_home"]);
                }
            }
            else if ((Session["pwalletID"] != null) && (Session["pwalletID"].ToString() != ""))
            {
                adminID = Session["pwalletID"].ToString();
            }
            else
            {
                base.Response.Redirect(ConfigurationManager.AppSettings["agent_home"]);
            }
        }
Exemple #3
0
 protected void gvPt_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "PtStatusClick")
     {
         XObjs.Shopping_card item = new XObjs.Shopping_card();
         if (this.Session["SCart"] != null)
         {
             this.lt_cart = (List<XObjs.Shopping_card>) this.Session["SCart"];
         }
         if (this.Session["SItems"] != null)
         {
             this.st_items = (SortedList<string, XObjs.Shopping_card>) this.Session["SItems"];
         }
         GridViewRow namingContainer = (GridViewRow) ((ImageButton) e.CommandSource).NamingContainer;
         int rowIndex = namingContainer.RowIndex;
         string key = e.CommandArgument.ToString();
         string text = this.gvPt.Rows[rowIndex].Cells[2].Text;
         string str3 = this.gvPt.Rows[rowIndex].Cells[0].Text;
         int amt = Convert.ToInt32(this.gvPt.Rows[rowIndex].Cells[3].Text);
         TextBox box = (TextBox) this.gvPt.Rows[rowIndex].Cells[4].FindControl("txtPt");
         ImageButton button = (ImageButton) this.gvPt.Rows[rowIndex].Cells[4].FindControl("lbAddPt");
         if (((box.Text != "") && (box.Text != "0")) && (this.val.IsInt32(box.Text) == 0))
         {
             if (button.ImageUrl != "../../images/x.gif")
             {
                 double num3 = this.calcTotalAmt(Convert.ToInt32(box.Text), amt);
                 item.xid = str3;
                 item.amt = amt;
                 item.qty = box.Text;
                 item.total_amt = num3;
                 item.item_code = key;
                 item.item_desc = text;
                 if (!this.lt_cart.Contains(item))
                 {
                     this.lt_cart.Add(item);
                     this.Session["SItems"] = this.st_items;
                 }
                 if (!this.st_items.ContainsKey(key))
                 {
                     this.st_items.Add(key, item);
                     this.Session["SCart"] = this.lt_cart;
                 }
                 box.ReadOnly = true;
                 button.ImageUrl = "../../images/x.gif";
             }
             else
             {
                 if (this.lt_cart.Contains(this.st_items[key]))
                 {
                     this.lt_cart.Remove(this.st_items[key]);
                 }
                 box.Text = "0";
                 box.ReadOnly = false;
                 button.ImageUrl = "../../images/checkmark.gif";
             }
         }
         this.displayTotals();
         this.show_inv = 1;
     }
 }