protected void rptResultTB_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName.Equals("delete"))
        {
            PlanTB        rpt       = new PlanTB();
            PlanTBService rptbso    = new PlanTBService();
            LinkButton    btnDelete = (LinkButton)e.CommandSource;
            btnDelete.Visible = AllowEdit;
            rptbso.Delete(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            BindResultTB();
        }
        else if (e.CommandName.Equals("edit"))
        {
            LinkButton btnDelete = (LinkButton)e.CommandSource;
            btnDelete.Visible = AllowEdit;
            PlanTB        rpt    = new PlanTB();
            PlanTBService rptbso = new PlanTBService();
            rpt = rptbso.FindByKey(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            if (rpt.CachLapDat != "")
            {
                try
                {
                    ddlCacThucLDBS.SelectedValue = rpt.CachLapDat;
                }
                catch { }
            }

            txtMoTaTinhNangBS.Text    = rpt.TinhNang;
            txtTenTietBiBS.Text       = rpt.NameTB;
            txtLyDoKhongThucHien.Text = rpt.LyDo;
            if (rpt.IsExecuted)
            {
                rblThucHien.SelectedIndex = 0;
            }
            else
            {
                rblThucHien.SelectedIndex = 1;
            }
            if (rpt.IsNew)
            {
                rblIsNew.SelectedIndex = 1;
            }
            else
            {
                rblIsNew.SelectedIndex = 0;
            }

            txtLyDoKhongThucHien.Text = rpt.LyDoLapDat;

            txtLyDoKhongThucHien.Text = rpt.LyDoLapDat;

            hddkhTB.Value = rpt.Id.ToString();
            ScriptManager.RegisterStartupScript(this, GetType(), "showtb", "ShowDialogDeviceResultOne(" + hddkhTB.Value + ");", true);
        }
    }
示例#2
0
    protected void rptResultTB_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName.Equals("delete"))
        {
            PlanTB        rpt    = new PlanTB();
            PlanTBService rptbso = new PlanTBService();
            rptbso.Delete(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            BindResultTB();
        }
        else if (e.CommandName.Equals("edit"))
        {
            PlanTB        rpt    = new PlanTB();
            PlanTBService rptbso = new PlanTBService();
            rpt = rptbso.FindByKey(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            if (rpt.CachLapDat != "")
            {
                try
                {
                    ddlCacThucLDBS.SelectedValue = rpt.CachLapDat;
                }
                catch { }
            }

            txtMoTaTinhNangBS.Text    = rpt.TinhNang;
            txtTenTietBiBS.Text       = rpt.NameTB;
            txtLyDoKhongThucHien.Text = rpt.LyDo;
            cbxThucHien.Checked       = rpt.IsExecuted;
            if (rpt.IsNew)
            {
                if (cbxThucHien.Checked)
                {
                    txtLyDoKhongThucHien.Text = rpt.LyDoLapDat;
                }
                else
                {
                    txtLyDoKhongThucHien.Text = rpt.LyDo;
                }
            }
            else
            {
                txtLyDoKhongThucHien.Text = rpt.LyDoLapDat;
            }
            hddkhTB.Value = rpt.Id.ToString();
            ScriptManager.RegisterStartupScript(this, GetType(), "showtb", "updategiaiphapTB();", true);
        }
    }
    protected void rptKetQuaTB_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName.Equals("delete"))
        {
            PlanTB        rpt    = new PlanTB();
            PlanTBService rptbso = new PlanTBService();
            rptbso.Delete(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            BindResultTB();
        }
        else if (e.CommandName.Equals("edit"))
        {
            PlanTB        rpt    = new PlanTB();
            PlanTBService rptbso = new PlanTBService();
            rpt = rptbso.FindByKey(int.Parse(((LinkButton)e.CommandSource).CommandArgument));

            hddkhTB.Value = rpt.Id.ToString();
            ScriptManager.RegisterStartupScript(this, GetType(), "showtb", "updateiaiphapTB5(" + hdnFiveYear.Value + "," + hdnPlan.Value + ");", true);
        }
    }
    protected void rptKHBoSungTB_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName.Equals("delete"))
        {
            PlanTB        rpt       = new PlanTB();
            PlanTBService rptbso    = new PlanTBService();
            LinkButton    btnDelete = (LinkButton)e.CommandSource;
            btnDelete.Visible = AllowEdit;
            rptbso.Delete(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            BindThietBi();
        }
        else if (e.CommandName.Equals("edit"))
        {
            PlanTB        rpt       = new PlanTB();
            PlanTBService rptbso    = new PlanTBService();
            LinkButton    btnDelete = (LinkButton)e.CommandSource;
            btnDelete.Visible = AllowEdit;
            rpt = rptbso.FindByKey(int.Parse(((LinkButton)e.CommandSource).CommandArgument));

            if (rpt.CachLapDat != "")
            {
                try
                {
                    ddlCacThucLD.SelectedValue = rpt.CachLapDat;
                }
                catch { }
            }
            txtlydoTB.Text = rpt.LyDo;
            txtTenTB.Text  = rpt.NameTB;
            try
            {
                ddlCamKetTB.SelectedValue = rpt.CamKet;
            }
            catch { }
            txtKhaNangTB.Text  = rpt.KhaNang;
            txtTinhNangTB.Text = rpt.TinhNang;
            hddkhTB.Value      = rpt.Id.ToString();
            ScriptManager.RegisterStartupScript(this, GetType(), "showtb", "ShowDialogDevicePlanOne(" + hddkhTB.Value + ");", true);
        }
    }
示例#5
0
    protected void cpRepeaterTB_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName.Equals("delete"))
        {
            PlanTB        rpt    = new PlanTB();
            PlanTBService rptbso = new PlanTBService();
            rptbso.Delete(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            BindThietBi();
            ScriptManager.RegisterStartupScript(this, GetType(), "showkh", "showkehoach();", true);
        }
        else if (e.CommandName.Equals("edit"))
        {
            PlanTB        rpt    = new PlanTB();
            PlanTBService rptbso = new PlanTBService();
            rpt = rptbso.FindByKey(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            //txtMucCamKetTB.Text = rpt.CamKet;

            if (rpt.CachLapDat != "")
            {
                try
                {
                    ddlCacThucLD.SelectedValue = rpt.CachLapDat;
                }
                catch { }
            }
            txtlydoTB.Text             = rpt.LyDo;
            txtnamTB.Text              = rpt.Nam.ToString();
            txtTenTB.Text              = rpt.NameTB;
            txtCamKetTB.Text           = rpt.CamKet;
            ddlKhaNangTB.SelectedValue = rpt.KhaNang;
            txtTinhNangTB.Text         = rpt.TinhNang;
            hddkhTB.Value              = rpt.Id.ToString();
            //BindThietBi();
            ScriptManager.RegisterStartupScript(this, GetType(), "showkhd", "showkehoach();", true);
            ScriptManager.RegisterStartupScript(this, GetType(), "showtb", "showgiaiphapTB('1');", true);
        }
    }