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); } }
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); } }
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); } }
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); } }
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); } }
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); } } }
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); } } }