Beispiel #1
0
    public void btnSaveSolutionResult_Click(object sender, EventArgs e)
    {
        PlanTKNLService planser  = new PlanTKNLService();
        PlanTKNL        plantknl = new PlanTKNL();

        plantknl.NamBatDau     = ReportYear;
        plantknl.NamKetThuc    = ReportYear;
        plantknl.CPThucTe      = txtChiPhiThucTe.Text;
        plantknl.MucTieuGP     = txtMucDichGPTT.Text;
        plantknl.MucTKCPThucTe = txtTKCPThucTe.Text;
        plantknl.MucTKThucTe   = txtMucTietKiemNLTT.Text;
        plantknl.CPThucTe      = txtChiPhiThucTe.Text.Trim();
        plantknl.LoiIchKhacTT  = txtLoiIchKhacTT.Text.Trim();
        plantknl.TuongDuongTT  = txtTuongDuongTT.Text.Trim();
        plantknl.GhiChuTT      = txtGhiChuTT.Text.Trim();
        plantknl.IsFiveYear    = false;
        plantknl.IsPlan        = false;
        plantknl.ReportId      = ReportId;
        plantknl.IdPlan        = ReportId;
        plantknl.EnterpriseId  = memVal.OrgId;
        plantknl.HeThongSuDung = ddlUseSysName.SelectedValue;
        if (ddlSolution2.SelectedIndex > 0)
        {
            plantknl.IdGiaPhap = Convert.ToInt32(ddlSolution2.SelectedValue);
        }
        if (ddlFuelType2.SelectedIndex > 0)
        {
            plantknl.LoaiNhienLieu = Convert.ToInt32(ddlFuelType2.SelectedValue);
        }
        if (ddlMeasure2.SelectedIndex > 0)
        {
            plantknl.MeasurementId = Convert.ToInt32(ddlMeasure2.SelectedValue);
        }

        if (hddkhtknl.Value != "" && Convert.ToInt32(hddkhtknl.Value) > 0)
        {
            plantknl.Id = Convert.ToInt32(hddkhtknl.Value);
            if (planser.Update(plantknl) != null)
            {
                BindResultTKNL();
                hddkhtknl.Value = "";
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "showgpkh", "ShowDialogSolutionResultOne(" + hddkhtknl.Value + ");", true);
                ScriptManager.RegisterStartupScript(this, GetType(), "message", "alert('Cập nhật không thành công. Vui lòng thử lại!');", true);
            }
        }
        else
        {
            int i = planser.Insert(plantknl);
            if (i > 0)
            {
                BindResultTKNL();
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "showgpkh", "ShowDialogSolutionResultOne();", true);
                ScriptManager.RegisterStartupScript(this, GetType(), "message", "alert('Thêm mới kê hoạch không thành công. Vui lòng thử lại!');", true);
            }
        }
    }
Beispiel #2
0
    public void btnSaveAddPlan_Click(object sender, EventArgs e)
    {
        PlanTKNLService planser  = new PlanTKNLService();
        PlanTKNL        plantknl = new PlanTKNL();

        if (hddkhtknl.Value != "" && Convert.ToInt32(hddkhtknl.Value) > 0)
        {
            plantknl               = planser.FindByKey(Convert.ToInt32(hddkhtknl.Value));
            plantknl.CPThucTe      = txtChiPhiThucTe.Text;
            plantknl.MucTieuGP     = txtMucDichGPTT.Text;
            plantknl.MucTKCPThucTe = txtTKCPThucTe.Text;
            plantknl.MucTKThucTe   = txtMucTietKiemNLTT.Text;
            plantknl.CPThucTe      = txtChiPhiThucTe.Text.Trim();
            plantknl.LoiIchKhacTT  = txtLoiIchKhacTT.Text.Trim();
            plantknl.TuongDuongTT  = txtTuongDuongTT.Text.Trim();
            plantknl.GhiChuTT      = txtGhiChuTT.Text.Trim();
            plantknl.IsFiveYear    = false;
            plantknl.IsPlan        = false;
            plantknl.ReportId      = ReportId;
            plantknl.EnterpriseId  = m_UserValidation.OrgId;
            if (ddlFuelType.SelectedIndex > 0)
            {
                plantknl.LoaiNhienLieu = Convert.ToInt32(ddlFuelType.SelectedValue);
            }
            plantknl.IdPlan = ReportId;
            if (planser.Update(plantknl) != null)
            {
                BindResultTKNL();
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "showgpkh", "updategiaiphapTKNL();", true);
                ScriptManager.RegisterStartupScript(this, GetType(), "message", "alert('Cập nhật không thành công. Vui lòng thử lại!');", true);
            }
        }
        else
        {
            plantknl.EnterpriseId  = m_UserValidation.OrgId;
            plantknl.IdGiaPhap     = Convert.ToInt32(ddlSolution2.SelectedValue);
            plantknl.CPThucTe      = txtChiPhiThucTe.Text;
            plantknl.MucTieuGP     = txtMucDichGPTT.Text;
            plantknl.MucTKCPThucTe = txtTKCPThucTe.Text;
            plantknl.MucTKThucTe   = txtMucTietKiemNLTT.Text;
            plantknl.CPThucTe      = txtChiPhiThucTe.Text.Trim();
            plantknl.LoiIchKhacTT  = txtLoiIchKhacTT.Text.Trim();
            plantknl.TuongDuongTT  = txtTuongDuongTT.Text.Trim();
            plantknl.GhiChuTT      = txtGhiChuTT.Text.Trim();
            plantknl.IsFiveYear    = false;
            plantknl.IsPlan        = false;
            plantknl.IsAdd         = true;
            plantknl.IdPlan        = ReportId;
            if (ddlFuelType.SelectedIndex > 0)
            {
                plantknl.LoaiNhienLieu = Convert.ToInt32(ddlFuelType.SelectedValue);
            }
            plantknl.IdPlan = ReportId;
            int i = planser.Insert(plantknl);
            if (i > 0)
            {
                BindResultTKNL();
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "showgpkh", "updategiaiphapTKNL();", true);
                ScriptManager.RegisterStartupScript(this, GetType(), "message", "alert('Thêm mới kê hoạch không thành công. Vui lòng thử lại!');", true);
            }
        }
    }
Beispiel #3
0
    public void btnSavePlan_Click(object sender, EventArgs e)
    {
        PlanTKNLService planser  = new PlanTKNLService();
        PlanTKNL        plantknl = new PlanTKNL();

        plantknl.NamBatDau    = ReportYear + 1;
        plantknl.NamKetThuc   = ReportYear + 1;
        plantknl.ThanhTien    = txtThanhTien.Text.Trim();
        plantknl.ChiPhiDuKien = txtchiphidukienTKNL.Text;
        plantknl.MucTieuGP    = txtmuctieuTKNL.Text;
        //plantknl.KhaNangThucHien = txtKhaNangTKNL.Text;
        //plantknl.MucCamKet = ddlCamKet.SelectedValue;
        plantknl.MucTietKiemDuKien = txtTKNLMucTieuDukien.Text;
        plantknl.LoiIchKhac        = txtLoiIchKhac.Text.Trim();
        plantknl.TuongDuong        = txtTuongDuong.Text.Trim();
        plantknl.GhiChu            = txtGhiChu.Text.Trim();
        plantknl.IsFiveYear        = false;
        plantknl.IsPlan            = true;
        plantknl.HeThongSuDung     = ddlUseSysNamePlan.SelectedValue;

        plantknl.EnterpriseId = memVal.OrgId;
        if (ddlSolution.SelectedIndex > 0)
        {
            plantknl.IdGiaPhap = Convert.ToInt32(ddlSolution.SelectedValue);
        }
        if (ddlFuelType.SelectedIndex > 0)
        {
            plantknl.LoaiNhienLieu = Convert.ToInt32(ddlFuelType.SelectedValue);
        }
        if (ddlMeasure.SelectedIndex > 0)
        {
            plantknl.MeasurementId = Convert.ToInt32(ddlMeasure.SelectedValue);
        }
        plantknl.IdPlan   = ReportId;
        plantknl.ReportId = ReportId;
        if (hddkhtknl.Value != "" && Convert.ToInt32(hddkhtknl.Value) > 0)
        {
            plantknl.Id = Convert.ToInt32(hddkhtknl.Value);
            if (planser.Update(plantknl) != null)
            {
                BindPlanTKNL();
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "showgpkh", "ShowDialogSolutionPlanOne(" + hddkhtknl.Value + ");", true);
                ScriptManager.RegisterStartupScript(this, GetType(), "message", "alert('Cập nhật không thành công. Vui lòng thử lại!');", true);
            }
        }
        else
        {
            int i = planser.Insert(plantknl);
            if (i > 0)
            {
                BindPlanTKNL();
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "showgpkh", "ShowDialogSolutionPlanOne(0);", true);
                ScriptManager.RegisterStartupScript(this, GetType(), "message", "alert('Thêm mới kê hoạch không thành công. Vui lòng thử lại!');", true);
            }
        }
    }
Beispiel #4
0
    public void btnSavePlan_Click(object sender, EventArgs e)
    {
        PlanTKNLService planser  = new PlanTKNLService();
        PlanTKNL        plantknl = new PlanTKNL();

        if (hddkhtknl.Value != "")
        {
            plantknl                   = planser.FindByKey(Convert.ToInt32(hddkhtknl.Value));
            plantknl.NamBatDau         = ReportYear;
            plantknl.NamKetThuc        = ReportYear;
            plantknl.ChiPhiDuKien      = txtchiphidukienTKNL.Text;
            plantknl.MucTieuGP         = txtmuctieuTKNL.Text;
            plantknl.KhaNangThucHien   = ddlKhaNang.SelectedValue;
            plantknl.MucCamKet         = txtcamketTKNL.Text;
            plantknl.MucTietKiemDuKien = txtTKNLMucTieuDukien.Text;
            plantknl.LoiIchKhac        = txtLoiIchKhac.Text.Trim();
            plantknl.TuongDuong        = txtTuongDuong.Text.Trim();
            plantknl.GhiChu            = txtGhiChu.Text.Trim();
            plantknl.IsFiveYear        = false;
            plantknl.IsPlan            = true;
            plantknl.EnterpriseId      = m_UserValidation.OrgId;
            if (ddlFuelType.SelectedIndex > 0)
            {
                plantknl.LoaiNhienLieu = Convert.ToInt32(ddlFuelType.SelectedValue);
            }
            plantknl.IdPlan = ReportId;
            int i = planser.Update(plantknl).Id;
            if (i > 0)
            {
                BindPlanTKNL();
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "showgpkh", "showgiaiphapTKNL('1');", true);
                ScriptManager.RegisterStartupScript(this, GetType(), "message", "alert('Cập nhật không thành công. Vui lòng thử lại!');", true);
            }
        }
        else
        {
            plantknl.NamBatDau         = ReportYear;
            plantknl.NamKetThuc        = ReportYear;
            plantknl.ChiPhiDuKien      = txtchiphidukienTKNL.Text;
            plantknl.MucTieuGP         = txtmuctieuTKNL.Text;
            plantknl.KhaNangThucHien   = ddlKhaNang.SelectedValue;
            plantknl.MucCamKet         = txtcamketTKNL.Text;
            plantknl.MucTietKiemDuKien = txtTKNLMucTieuDukien.Text;
            plantknl.IdGiaPhap         = Convert.ToInt32(dllgiaiphap.SelectedValue);
            //plantknl.GiaiDoan = txtGiaiDoanTKNL.Text;
            plantknl.EnterpriseId = m_UserValidation.OrgId;
            plantknl.LoiIchKhac   = txtLoiIchKhac.Text.Trim();
            plantknl.TuongDuong   = txtTuongDuong.Text.Trim();
            plantknl.GhiChu       = txtGhiChu.Text.Trim();
            plantknl.IsFiveYear   = false;
            plantknl.IsPlan       = true;
            if (ddlFuelType.SelectedIndex > 0)
            {
                plantknl.LoaiNhienLieu = Convert.ToInt32(ddlFuelType.SelectedValue);
            }
            plantknl.IdPlan = ReportId;
            int i = planser.Insert(plantknl);
            if (i > 0)
            {
                BindPlanTKNL();
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "showgpkh", "showgiaiphapTKNL('1');", true);
                ScriptManager.RegisterStartupScript(this, GetType(), "message", "alert('Thêm mới kê hoạch không thành công. Vui lòng thử lại!');", true);
            }
        }
    }