public void SaveCharAllowedValue(CharAllowedValue argCharAllowedValue, DataAccess da, List <ErrorHandler> lstErr) { try { if (blnIsCharAllowedValueExists(argCharAllowedValue.idClass, argCharAllowedValue.idCharacteristic, argCharAllowedValue.idCharAllowedValue, argCharAllowedValue.ClientCode, da) == false) { InsertCharAllowedValue(argCharAllowedValue, da, lstErr); } else { UpdateCharAllowedValue(argCharAllowedValue, da, lstErr); } } catch (Exception ex) { objErrorHandler.Type = ErrorConstant.strAboartType; objErrorHandler.MsgId = 0; objErrorHandler.Module = ErrorConstant.strInsertModule; objErrorHandler.ModulePart = ErrorConstant.strDetailModule; objErrorHandler.Message = ex.Message.ToString(); objErrorHandler.RowNo = 0; objErrorHandler.FieldName = ""; objErrorHandler.LogCode = ""; lstErr.Add(objErrorHandler); } }
private CharAllowedValue objCreateCharAllowedValue(DataRow dr) { CharAllowedValue tCharAllowedValue = new CharAllowedValue(); tCharAllowedValue.SetObjectInfo(dr); return(tCharAllowedValue); }
public CharAllowedValue objGetCharAllowedValue(int argidClass, int argidCharacteristic, int argidCharAllowedValue, string argClientCode) { CharAllowedValue argCharAllowedValue = new CharAllowedValue(); DataSet DataSetToFill = new DataSet(); if (argidClass <= 0) { goto ErrorHandlers; } if (argidCharacteristic <= 0) { goto ErrorHandlers; } if (argidCharAllowedValue <= 0) { goto ErrorHandlers; } if (argClientCode.Trim() == "") { goto ErrorHandlers; } DataSetToFill = this.GetCharAllowedValue(argidClass, argidCharacteristic, argidCharAllowedValue, argClientCode); if (DataSetToFill.Tables[0].Rows.Count <= 0) { goto Finish; } argCharAllowedValue = this.objCreateCharAllowedValue((DataRow)DataSetToFill.Tables[0].Rows[0]); goto Finish; ErrorHandlers: Finish: DataSetToFill = null; return(argCharAllowedValue); }
public void UpdateCharAllowedValue(CharAllowedValue argCharAllowedValue, DataAccess da, List <ErrorHandler> lstErr) { SqlParameter[] param = new SqlParameter[12]; param[0] = new SqlParameter("@idClass", argCharAllowedValue.idClass); param[1] = new SqlParameter("@idCharacteristic", argCharAllowedValue.idCharacteristic); param[2] = new SqlParameter("@idCharAllowedValue", argCharAllowedValue.idCharAllowedValue); param[3] = new SqlParameter("@CharacteristicValueChar", argCharAllowedValue.CharacteristicValueChar); param[4] = new SqlParameter("@CharValueNumFrom", argCharAllowedValue.CharValueNumFrom); param[5] = new SqlParameter("@CharValueNumTo", argCharAllowedValue.CharValueNumTo); param[6] = new SqlParameter("@ClientCode", argCharAllowedValue.ClientCode); param[7] = new SqlParameter("@CreatedBy", argCharAllowedValue.CreatedBy); param[8] = new SqlParameter("@ModifiedBy", argCharAllowedValue.ModifiedBy); param[9] = new SqlParameter("@Type", SqlDbType.Char); param[9].Size = 1; param[9].Direction = ParameterDirection.Output; param[10] = new SqlParameter("@Message", SqlDbType.VarChar); param[10].Size = 255; param[10].Direction = ParameterDirection.Output; param[11] = new SqlParameter("@returnvalue", SqlDbType.VarChar); param[11].Size = 20; param[11].Direction = ParameterDirection.Output; int i = da.NExecuteNonQuery("Proc_UpdateCharAllowedValue", param); string strMessage = Convert.ToString(param[10].Value); string strType = Convert.ToString(param[9].Value); string strRetValue = Convert.ToString(param[11].Value); objErrorHandler.Type = strType; objErrorHandler.MsgId = 0; objErrorHandler.Module = ErrorConstant.strInsertModule; objErrorHandler.ModulePart = ErrorConstant.strMasterModule; objErrorHandler.Message = strMessage.ToString(); objErrorHandler.RowNo = 0; objErrorHandler.FieldName = ""; objErrorHandler.LogCode = ""; lstErr.Add(objErrorHandler); }
public ICollection <CharAllowedValue> colGetCharAllowedValue(int argidClass, string argClientCode) { List <CharAllowedValue> lst = new List <CharAllowedValue>(); DataSet DataSetToFill = new DataSet(); CharAllowedValue tCharAllowedValue = new CharAllowedValue(); DataSetToFill = this.GetCharAllowedValue(argidClass, argClientCode); if (DataSetToFill != null) { foreach (DataRow dr in DataSetToFill.Tables[0].Rows) { lst.Add(objCreateCharAllowedValue(dr)); } } goto Finish; Finish: DataSetToFill = null; return(lst); }