public ElectrictConsume Update(ElectrictConsume obj) { ElectrictConsumeBO electrictconsumeBO = new ElectrictConsumeBO(obj); electrictconsumeDao.Update(electrictconsumeBO); return(obj); }
protected void btnSaveElectrictConsume_Click(object sender, EventArgs e) { ElectrictConsumeService otherService = new ElectrictConsumeService(); if (otherService.DeleteByReport(ReportId, false) >= 0) { for (int i = 1; i <= 12; i++) { ElectrictConsume other = new ElectrictConsume(); try { string strNormal = Request.Form["txtNormalNo" + i]; string strPeak = Request.Form["txtPeakNo" + i]; string strLow = Request.Form["txtLowNo" + i]; string strTotal = Request.Form["txtElectrictTotal" + i]; string strCost = Request.Form["txtCostTotal" + i]; if (strNormal != null && strNormal.Trim() != "") { other.NormalNo = Convert.ToInt64(strNormal.Trim()); } if (strPeak != null && strPeak.Trim() != "") { other.PeakNo = Convert.ToInt64(strPeak.Trim()); } if (strLow != null && strLow.Trim() != "") { other.LowNo = Convert.ToInt64(strLow.Trim()); } if (strTotal != null && strTotal.Trim() != "") { other.ElectrictTotal = Convert.ToInt64(strTotal.Trim()); } if (strCost != null && strCost.Trim() != "") { other.CostTotal = Convert.ToInt64(strCost.Trim()); } } catch (Exception ex) { } other.FuelId = 1;//Nhien lieu dien other.AuditReportId = ReportId; other.Month = i; other.IsSelf = false; other.Year = ReportYear; otherService.Insert(other); } BindElectricConsume(); ScriptManager.RegisterStartupScript(this, GetType(), "showgpkh", "ShowDialogElectrictConsume();", true); } }
public int Insert(ElectrictConsume obj) { ElectrictConsumeBO electrictconsumeBO = new ElectrictConsumeBO(obj); return(electrictconsumeDao.Insert(electrictconsumeBO)); }