/// <summary> /// درج /// </summary> /// <returns></returns> public int Insert(JDataBase Db) { JWeightTable JLT = new JWeightTable(); try { JLT.SetValueProperty(this); Code = JLT.Insert(Db); if (Code > 0) { Db.setQuery(" Update BascoolCounter Set Counter=Counter+1 "); Db.Query_Execute(); Nodes.DataTable.Merge(JWeights.GetDataTable(Code)); return(Code); } return(0); } catch (Exception ex) { JSystem.Except.AddException(ex); return(0); } finally { JLT.Dispose(); } }
/// <summary> /// حذف /// </summary> /// <returns></returns> public bool DeleteTransfer(int pCode, JDataBase Db) { try { JWeightTable JLT = new JWeightTable(); JLT.Code = pCode; if (JLT.Delete(Db)) { return(true); } return(false); } catch (Exception ex) { JSystem.Except.AddException(ex); return(false); } finally { } }
/// <summary> /// ویرایش /// </summary> /// <returns></returns> public bool Update(JDataBase db) { try { JWeightTable PDT = new JWeightTable(); PDT.SetValueProperty(this); PDT.Code = Code; if (PDT.Update(db)) { //Nodes.Refreshdata(Nodes.CurrentNode, JWeights.GetDataTable(Code).Rows[0]); return(true); } return(false); } catch (Exception ex) { JSystem.Except.AddException(ex); return(false); } finally { } }