private void updateList(Common.DataBaseOperation DBAction, GenericMaster objData) { GenericMaster data; switch ((int)DBAction) { case 0: ListGenericMaster.Add(objData); break; case 1: data = getDataByCode(objData.GenericCode); if (data != null) { ListGenericMaster.Remove(data); ListGenericMaster.Add(objData); } break; case 2: data = getDataByCode(objData.GenericCode); if (data != null) { ListGenericMaster.Remove(data); } break; } }
private string dataBaseAction(Common.DataBaseOperation DBAction) { string sMsg = string.Empty; GenericMaster objData = this.Copy <GenericMaster>(); objData.OperationFlag = DBAction; DataBaseResultSet DBRS = BLL.BllClient.objBllClient.Save <GenericMaster>(Common.DataSourceTypes.GenericMasterSave, objData); sMsg = CommonModel.GetOperationMessage <GenericMaster>(DBRS, objData); if (DBRS.ErrorCode == 0) { updateList(DBAction, objData); this.ResetData(); } return(sMsg); }
public string SaveData() { Common.DataBaseOperation DBAction = (this.IsModifyData) ? Common.DataBaseOperation.Update : Common.DataBaseOperation.Save; return(dataBaseAction(DBAction)); }