Example #1
0
        protected void gvResult_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            CancerTypeCollection dt = ((CancerTypeCollection)this.gvResult.DataSource);

            PubEntAdmin.BLL.CancerType l_conf = dt[e.Item.ItemIndex];

            int    Ctpyid       = l_conf.CancerTypeID;
            string Ctpyname     = l_conf.CancerTypeName;
            string Activestatus = ((Button)e.Item.Cells[4].Controls[7]).Text;

            if (Activestatus == "Inactive")
            {
                Boolean CtpyExist = LU_DAL.CtpyExist(Ctpyid);

                if (CtpyExist == false)
                {
                    LU_DAL.DeleteCancerTypeLU(Ctpyid);
                    Response.Redirect("~/LookupMgmt.aspx?sub=cancertype");
                }
                else if (CtpyExist == true)
                {
                    string confirm = "Unable to Inactivate, value associated with Publication.";
                    ((Label)e.Item.Cells[5].Controls[1]).Text = confirm;
                }
            }
            if (Activestatus == "Active")
            {
                int Active = 1;
                LU_DAL.UpdateCancerTypeLU(Ctpyid, Ctpyname, Active);
                Response.Redirect("~/LookupMgmt.aspx?sub=cancertype");
            }
        }
Example #2
0
        protected void gvResult_UpdateCommand(object source, DataGridCommandEventArgs e)
        {
            CancerTypeCollection dt = ((CancerTypeCollection)this.gvResult.DataSource);

            PubEntAdmin.BLL.CancerType l_conf = dt[e.Item.ItemIndex];
            int    Ctpyid   = l_conf.CancerTypeID;
            string Ctpyname = ((TextBox)e.Item.Cells[1].Controls[1]).Text;
            int    Active   = 0;
            string sActive  = ((Label)e.Item.Cells[2].Controls[1]).Text;

            if (sActive == "Active")
            {
                Active = 1;
            }
            else
            {
                Active = 0;
            }

            Boolean valid    = false;
            Boolean validnum = false;
            Boolean validlen = false;

            if (Ctpyname.Length != 0)
            {
                valid    = PubEntAdminManager.OtherVal(Ctpyname);
                validnum = PubEntAdminManager.SpecialVal2(Ctpyname);
                validlen = PubEntAdminManager.LenVal(Ctpyname, 50);
            }

            if ((valid == false) && (validnum == false) && (validlen == true))
            {
                LU_DAL.UpdateCancerTypeLU(Ctpyid, Ctpyname, Active);
                Response.Redirect("~/LookupMgmt.aspx?sub=cancertype");
            }
            else
            {
                Response.Redirect("InvalidInput.aspx");
            }
        }
 public bool Contains(CancerType value)
 {
     return(List.Contains(value));
 }
 public void Remove(CancerType value)
 {
     List.Remove(value);
 }
 public void Insert(int index, CancerType value)
 {
     List.Insert(index, value);
 }
 public int IndexOf(CancerType value)
 {
     return(List.IndexOf(value));
 }
 public int Add(CancerType value)
 {
     return(List.Add(value));
 }
Example #8
0
        protected void gvResult_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            CancerTypeCollection dt = ((CancerTypeCollection)this.gvResult.DataSource);

            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PubEntAdmin.BLL.CancerType l_conf = dt[e.Item.ItemIndex];
                ((Label)e.Item.Cells[1].Controls[1]).Text = Server.HtmlEncode(l_conf.CancerTypeName);

                //delete btn col
                Button l_able = e.Item.Cells[5].FindControl("lnkbtnDel") as Button;

                if (l_conf.Checked)
                {
                    ((Label)e.Item.Cells[2].Controls[1]).Text = "Active";
                    l_able.Text = "Inactivate";
                    Panel l_pnl = e.Item.Cells[5].FindControl("pnlConfirmDel") as Panel;
                    ((Label)l_pnl.Controls[1]).Text = "Are you sure you want to inactivate this Lookup Value [" + Server.HtmlEncode(l_conf.CancerTypeName) + "]?";
                }
                else
                {
                    ((Label)e.Item.Cells[2].Controls[1]).Text = "Inactive";
                    l_able.Text = "Activate";
                    Panel l_pnl = e.Item.Cells[5].FindControl("pnlConfirmDel") as Panel;
                    ((Label)l_pnl.Controls[1]).Text = "Are you sure you want to activate this Lookup Value [" + Server.HtmlEncode(l_conf.CancerTypeName) + "]?";
                }
            }
            else if (e.Item.ItemType == ListItemType.EditItem)
            {
                PubEntAdmin.BLL.CancerType l_conf = dt[e.Item.ItemIndex];
                String status = "";
                if (l_conf.Checked == true)
                {
                    status = "Active";
                }
                else
                {
                    status = "Inactive";
                }
                ((Label)e.Item.Cells[2].Controls[1]).Text = status;

                if (e.Item.Cells[3].Controls[2] is Button)
                {
                    Button l_btnCancel = ((Button)e.Item.Cells[3].Controls[2]);
                    l_btnCancel.ID = "gvResult_Cancel";

                    Panel l_panel = new Panel();
                    l_panel.ID       = "l_panel";
                    l_panel.CssClass = "modalPopup";
                    l_panel.Style.Add("display", "none");
                    l_panel.Width = Unit.Pixel(233);

                    Label l_label = new Label();
                    l_label.Text = "Are you sure you want to continue?";

                    HtmlGenericControl l_div    = new HtmlGenericControl();
                    Button             l_ok     = new Button();
                    Button             l_cancel = new Button();
                    l_ok.ID       = "l_ok";
                    l_ok.Text     = "OK";
                    l_cancel.ID   = "l_cancel";
                    l_cancel.Text = "Cancel";
                    l_div.Controls.Add(l_ok);
                    l_div.Controls.Add(new LiteralControl(" "));
                    l_div.Controls.Add(l_cancel);
                    l_div.Attributes.Add("align", "center");

                    l_panel.Controls.Add(l_label);
                    l_panel.Controls.Add(new LiteralControl("<br>"));
                    l_panel.Controls.Add(new LiteralControl("<br>"));
                    l_panel.Controls.Add(l_div);

                    ModalPopupExtender l_mpe = new ModalPopupExtender();
                    l_mpe.ID = "l_mpe";
                    l_mpe.TargetControlID    = l_btnCancel.ID;
                    l_mpe.PopupControlID     = l_panel.ID;
                    l_mpe.BackgroundCssClass = "modalBackground";
                    l_mpe.DropShadow         = true;
                    l_mpe.OkControlID        = l_ok.ID;
                    l_mpe.CancelControlID    = l_cancel.ID;

                    ConfirmButtonExtender l_cbe = new ConfirmButtonExtender();
                    l_cbe.TargetControlID     = l_btnCancel.ID;
                    l_cbe.ConfirmText         = "";
                    l_cbe.DisplayModalPopupID = l_mpe.ID;

                    e.Item.Cells[3].Controls.Add(l_panel);
                    e.Item.Cells[3].Controls.Add(l_mpe);
                    e.Item.Cells[3].Controls.Add(l_cbe);
                }

                //delete btn col
                Button l_able = e.Item.Cells[5].FindControl("lnkbtnDel") as Button;

                if (l_conf.Checked)
                {
                    ((Label)e.Item.Cells[2].Controls[1]).Text = "Active";
                    l_able.Text = "Inactivate";
                    Panel l_pnl = e.Item.Cells[5].FindControl("pnlConfirmDel") as Panel;
                    ((Label)l_pnl.Controls[1]).Text = "Are you sure you want to inactivate this Lookup Value [" + Server.HtmlEncode(l_conf.CancerTypeName) + "]?";
                }
                else
                {
                    ((Label)e.Item.Cells[2].Controls[1]).Text = "Inactive";
                    l_able.Text = "Activate";
                    Panel l_pnl = e.Item.Cells[5].FindControl("pnlConfirmDel") as Panel;
                    ((Label)l_pnl.Controls[1]).Text = "Are you sure you want to activate this Lookup Value [" + Server.HtmlEncode(l_conf.CancerTypeName) + "]?";
                }
            }
        }