public OtherFuelConsume Update(OtherFuelConsume obj)
        {
            OtherFuelConsumeBO otherfuelconsumeBO = new OtherFuelConsumeBO(obj);

            otherfuelconsumeDao.Update(otherfuelconsumeBO);
            return(obj);
        }
Example #2
0
    protected void btnSaveFuel_Click(object sender, EventArgs e)
    {
        int FuelId    = Convert.ToInt32(ddlFuel.SelectedValue);
        int MeasureId = Convert.ToInt32(ddlMeasure.SelectedValue);
        OtherFuelConsumeService otherService = new OtherFuelConsumeService();

        if (otherService.DeleteByFuel(ReportId, FuelId) >= 0)
        {
            for (int i = 1; i <= 12; i++)
            {
                string           strQuantity = Request.Form["txtQuantity" + i];
                string           strCost     = Request.Form["txtCost" + i];
                OtherFuelConsume other       = new OtherFuelConsume();
                try
                {
                    if (strQuantity != null && strQuantity.Trim() != "")
                    {
                        other.Quantity = Convert.ToDecimal(strQuantity.Trim());
                    }
                    if (strCost != null && strCost.Trim() != "")
                    {
                        other.Cost = Convert.ToDecimal(strCost.Trim());
                    }
                }
                catch (Exception ex)
                {
                }
                other.FuelId        = FuelId;
                other.AuditReportId = ReportId;
                other.MonthUsed     = i;
                other.MeasurementId = MeasureId;
                otherService.Insert(other);
            }
            BindData();
            BindFuelConsume();
            ScriptManager.RegisterStartupScript(this, GetType(), "showgpkh", "ShowDialogFuelConsume();", true);
        }
    }
        public int Insert(OtherFuelConsume obj)
        {
            OtherFuelConsumeBO otherfuelconsumeBO = new OtherFuelConsumeBO(obj);

            return(otherfuelconsumeDao.Insert(otherfuelconsumeBO));
        }