Ejemplo n.º 1
0
    protected void cpRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName.Equals("delete"))
        {
            PlanTKNL        rpt    = new PlanTKNL();
            PlanTKNLService rptbso = new PlanTKNLService();
            rptbso.Delete(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            BindPlanTKNL();
            //ScriptManager.RegisterStartupScript(this, GetType(), "showkh", "showkehoach();", true);
            //  ScriptManager.RegisterStartupScript(this, GetType(), "showgpkh", "showgiaiphapTKNL('1');", true);
            //   voidbindexcel(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
        }
        else if (e.CommandName.Equals("edit"))
        {
            PlanTKNL        rpt    = new PlanTKNL();
            PlanTKNLService rptbso = new PlanTKNLService();
            rpt = rptbso.FindByKey(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            txtmuctieuTKNL.Text      = rpt.MucTieuGP;
            txtchiphidukienTKNL.Text = rpt.ChiPhiDuKien;
            if (rpt.IdGiaPhap > 0)
            {
                ddlSolution.SelectedValue = rpt.IdGiaPhap.ToString();
            }
            if (rpt.LoaiNhienLieu > 0)
            {
                ddlFuelType.SelectedValue = rpt.LoaiNhienLieu.ToString();
                BindMeasurement();
            }
            if (rpt.MeasurementId > 0)
            {
                ddlMeasure.SelectedValue = rpt.MeasurementId.ToString();
            }
            try
            {
                ddlCamKet.SelectedValue = rpt.MucCamKet;
            }
            catch { }
            txtvonTKNL.Text    = rpt.HoanVon;
            txtGhiChu.Text     = rpt.GhiChu;
            txtLoiIchKhac.Text = rpt.LoiIchKhac;
            txtThanhTien.Text  = rpt.ThanhTien;
            txtNamBD.Text      = rpt.NamBatDau.ToString();;
            txtNamKT.Text      = rpt.NamKetThuc.ToString();
            txtTuongDuong.Text = rpt.TuongDuong;
            if (rpt.ThanhTien != null)
            {
                txtThanhTien.Text = rpt.ThanhTien;
            }

            txtKhaNangTKNL.Text = rpt.KhaNangThucHien;

            txtTKNLMucTieuDukien.Text = rpt.MucTietKiemDuKien;
            hddkhtknl.Value           = rpt.Id.ToString();
            //BindPlanTKNL();

            //ScriptManager.RegisterStartupScript(this, GetType(), "showkhdg", "showkehoach();", true);
            ScriptManager.RegisterStartupScript(this, GetType(), "showgpkhd", "ShowDialogSolutionPlan(" + hddkhtknl.Value + "," + hdnPlan.Value + ");", true);
        }
    }
Ejemplo n.º 2
0
    protected void rptResultTKNL_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName.Equals("delete"))
        {
            LinkButton btnDelete = (LinkButton)e.CommandSource;
            btnDelete.Visible = AllowEdit;
            PlanTKNL        rpt    = new PlanTKNL();
            PlanTKNLService rptbso = new PlanTKNLService();
            rptbso.Delete(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            BindResultTKNL();
        }
        else if (e.CommandName.Equals("edit"))
        {
            LinkButton btnDelete = (LinkButton)e.CommandSource;
            //btnDelete.Visible = AllowEdit;
            btnDelete.Visible = true;
            PlanTKNL        rpt    = new PlanTKNL();
            PlanTKNLService rptbso = new PlanTKNLService();
            rpt                     = rptbso.FindByKey(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            hddkhtknl.Value         = rpt.Id.ToString();
            txtMucDichGPTT.Text     = rpt.MucTieuGP;
            txtMucTietKiemNLTT.Text = rpt.MucTKThucTe;
            if (rpt.IdGiaPhap > 0)
            {
                ddlSolution2.SelectedValue = rpt.IdGiaPhap.ToString();
            }
            txtTKCPThucTe.Text   = rpt.MucTKCPThucTe;
            txtChiPhiThucTe.Text = rpt.CPThucTe;
            txtGhiChuTT.Text     = rpt.GhiChuTT;
            txtTuongDuongTT.Text = rpt.TuongDuongTT;
            if (!string.IsNullOrEmpty(rpt.HeThongSuDung))
            {
                ddlUseSysName.SelectedValue = rpt.HeThongSuDung;
            }

            if (rpt.LoaiNhienLieu > 0)
            {
                ddlFuelType2.SelectedValue = rpt.LoaiNhienLieu.ToString();
                BindMeasurement2();
            }
            if (rpt.MeasurementId > 0)
            {
                ddlMeasure2.SelectedValue = rpt.MeasurementId.ToString();
            }
            txtLoiIchKhacTT.Text = rpt.LoiIchKhacTT;
            //try
            //{
            //    txtKhaNangTKNL.Text = rpt.KhaNangThucHien;
            //}
            //catch { }
            //txtTKNLMucTieuDukien.Text = rpt.MucTietKiemDuKien;
            hddkhtknl.Value = rpt.Id.ToString();
            ScriptManager.RegisterStartupScript(this, GetType(), "showgpkhd", "ShowDialogSolutionResultOne(" + hddkhtknl.Value + ");", true);
        }
    }
Ejemplo n.º 3
0
    protected void rptPlanTKNL_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName.Equals("delete"))
        {
            PlanTKNL        rpt       = new PlanTKNL();
            PlanTKNLService rptbso    = new PlanTKNLService();
            LinkButton      btnDelete = (LinkButton)e.CommandSource;
            btnDelete.Visible = AllowEdit;
            rptbso.Delete(int.Parse(btnDelete.CommandArgument));
            BindPlanTKNL();
        }
        else if (e.CommandName.Equals("edit"))
        {
            PlanTKNL        rpt     = new PlanTKNL();
            PlanTKNLService rptbso  = new PlanTKNLService();
            LinkButton      btnEdit = (LinkButton)e.CommandSource;
            rpt = rptbso.FindByKey(int.Parse(btnEdit.CommandArgument));
            txtmuctieuTKNL.Text      = rpt.MucTieuGP;
            txtchiphidukienTKNL.Text = rpt.ChiPhiDuKien;
            if (rpt.IdGiaPhap > 0)
            {
                ddlSolution.SelectedValue = rpt.IdGiaPhap.ToString();
            }
            //try
            //{
            //    ddlCamKet.SelectedValue = rpt.MucCamKet;
            //}
            //catch { }
            if (rpt.LoaiNhienLieu > 0)
            {
                ddlFuelType.SelectedValue = rpt.LoaiNhienLieu.ToString();
                BindMeasurement();
            }
            if (rpt.MeasurementId > 0)
            {
                ddlMeasure.SelectedValue = rpt.MeasurementId.ToString();
            }
            txtGhiChu.Text     = rpt.GhiChu;
            txtLoiIchKhac.Text = rpt.LoiIchKhac;
            txtThanhTien.Text  = rpt.ThanhTien;
            txtTuongDuong.Text = rpt.TuongDuong;

            //txtKhaNangTKNL.Text = rpt.KhaNangThucHien;

            txtTKNLMucTieuDukien.Text = rpt.MucTietKiemDuKien;
            hddkhtknl.Value           = rpt.Id.ToString();
            ScriptManager.RegisterStartupScript(this, GetType(), "showgpkhd", "ShowDialogSolutionPlanOne(" + hddkhtknl.Value + ");", true);
        }
    }
Ejemplo n.º 4
0
    protected void cpRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName.Equals("delete"))
        {
            PlanTKNL        rpt    = new PlanTKNL();
            PlanTKNLService rptbso = new PlanTKNLService();
            rptbso.Delete(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            BindPlanTKNL();
            //ScriptManager.RegisterStartupScript(this, GetType(), "showkh", "showkehoach();", true);
            //  ScriptManager.RegisterStartupScript(this, GetType(), "showgpkh", "showgiaiphapTKNL('1');", true);
            //   voidbindexcel(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
        }
        else if (e.CommandName.Equals("edit"))
        {
            PlanTKNL        rpt    = new PlanTKNL();
            PlanTKNLService rptbso = new PlanTKNLService();
            rpt = rptbso.FindByKey(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            txtmuctieuTKNL.Text       = rpt.MucTieuGP;
            txtchiphidukienTKNL.Text  = rpt.ChiPhiDuKien;
            dllgiaiphap.SelectedValue = rpt.IdGiaPhap.ToString();
            txtcamketTKNL.Text        = rpt.MucCamKet;
            //txtGiaiDoanTKNL.Text = rpt.GiaiDoan;
            if (rpt.LoaiNhienLieu > 0)
            {
                ddlFuelType.SelectedValue = rpt.LoaiNhienLieu.ToString();
            }
            txtGhiChu.Text     = rpt.GhiChu;
            txtLoiIchKhac.Text = rpt.LoiIchKhac;
            txtThanhTien.Text  = rpt.ThanhTien;
            try
            {
                ddlKhaNang.Text = rpt.KhaNangThucHien;
            }
            catch { }
            txtTKNLMucTieuDukien.Text = rpt.MucTietKiemDuKien;
            hddkhtknl.Value           = rpt.Id.ToString();
            //BindPlanTKNL();

            //ScriptManager.RegisterStartupScript(this, GetType(), "showkhdg", "showkehoach();", true);
            ScriptManager.RegisterStartupScript(this, GetType(), "showgpkhd", "showgiaiphapTKNL('1');", true);
        }
    }
Ejemplo n.º 5
0
    protected void rptResultTKNL_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName.Equals("delete"))
        {
            PlanTKNL        rpt    = new PlanTKNL();
            PlanTKNLService rptbso = new PlanTKNLService();
            rptbso.Delete(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            BindPlanTKNL();
        }
        else if (e.CommandName.Equals("edit"))
        {
            PlanTKNL        rpt    = new PlanTKNL();
            PlanTKNLService rptbso = new PlanTKNLService();
            rpt                        = rptbso.FindByKey(int.Parse(((LinkButton)e.CommandSource).CommandArgument));
            hddkhtknl.Value            = rpt.Id.ToString();
            txtMucDichGPTT.Text        = rpt.MucTieuGP;
            txtMucTietKiemNLTT.Text    = rpt.MucTKThucTe;
            ddlSolution2.SelectedValue = rpt.IdGiaPhap.ToString();
            txtTKCPThucTe.Text         = rpt.MucTKCPThucTe;
            txtChiPhiThucTe.Text       = rpt.CPThucTe;
            txtGhiChuTT.Text           = rpt.GhiChuTT;
            txtTuongDuongTT.Text       = rpt.TuongDuongTT;
            if (rpt.LoaiNhienLieu > 0)
            {
                ddlFuelType2.SelectedValue = rpt.LoaiNhienLieu.ToString();
            }
            txtLoiIchKhacTT.Text = rpt.LoiIchKhacTT;
            try
            {
                ddlKhaNang.Text = rpt.KhaNangThucHien;
            }
            catch { }
            txtTKNLMucTieuDukien.Text = rpt.MucTietKiemDuKien;
            hddkhtknl.Value           = rpt.Id.ToString();
            //BindPlanTKNL();

            //ScriptManager.RegisterStartupScript(this, GetType(), "showkhdg", "showkehoach();", true);
            ScriptManager.RegisterStartupScript(this, GetType(), "showgpkhd", "updategiaiphapTKNL();", true);
        }
    }