/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gvFormula_RowDeleting(object sender, GridViewDeleteEventArgs e) { int index = e.RowIndex; int formulaID = int.Parse(this.gvFormula.DataKeys[index].Value.ToString()); FormulaDBI.Delete(formulaID); RedirectToProjectPage(); }
static public DeviceFormulaCollectionMap CreateDeviceFormulaCollectionMap(int deviceID) { DeviceFormulaCollectionMap _deviceFormulaCollectionMap = new DeviceFormulaCollectionMap(deviceID); DataTable formulaDataTable = FormulaDBI.GetDataTable(deviceID); foreach (DataRow row in formulaDataTable.Rows) { DateTime begin = Convert.ToDateTime(row["DTBegin"]); DateTime end = Convert.ToDateTime(row["DTEnd"]); string formula = row["formula"].ToString(); if (formula.Length > 0) { Xdgk.CF.Formula item = new Xdgk.CF.Formula(deviceID, begin, end, formula); _deviceFormulaCollectionMap.FormulaCollection.Add(item); } } return(_deviceFormulaCollectionMap); }