public void SaveCharactersticValueCurrency(CharactersticValueCurrency argCharactersticValueCurrency, DataAccess da, List <ErrorHandler> lstErr)
 {
     try
     {
         if (blnIsCharactersticValueCurrencyExists(argCharactersticValueCurrency.idCharactersticsValue, argCharactersticValueCurrency.CharactersticsName, argCharactersticValueCurrency.ClientCode, da) == false)
         {
             InsertCharactersticValueCurrency(argCharactersticValueCurrency, da, lstErr);
         }
         else
         {
             UpdateCharactersticValueCurrency(argCharactersticValueCurrency, 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 CharactersticValueCurrency objCreateCharactersticValueCurrency(DataRow dr)
        {
            CharactersticValueCurrency tCharactersticValueCurrency = new CharactersticValueCurrency();

            tCharactersticValueCurrency.SetObjectInfo(dr);

            return(tCharactersticValueCurrency);
        }
        public CharactersticValueCurrency objGetCharactersticValueCurrency(int argidCharactersticsValue, string argCharactersticsName, string argClientCode)
        {
            CharactersticValueCurrency argCharactersticValueCurrency = new CharactersticValueCurrency();
            DataSet DataSetToFill = new DataSet();

            if (argidCharactersticsValue <= 0)
            {
                goto ErrorHandlers;
            }

            if (argCharactersticsName.Trim() == "")
            {
                goto ErrorHandlers;
            }

            if (argClientCode.Trim() == "")
            {
                goto ErrorHandlers;
            }

            DataSetToFill = this.GetCharactersticValueCurrency(argidCharactersticsValue, argCharactersticsName, argClientCode);

            if (DataSetToFill.Tables[0].Rows.Count <= 0)
            {
                goto Finish;
            }

            argCharactersticValueCurrency = this.objCreateCharactersticValueCurrency((DataRow)DataSetToFill.Tables[0].Rows[0]);

            goto Finish;

ErrorHandlers:

Finish:
            DataSetToFill = null;


            return(argCharactersticValueCurrency);
        }
        public void UpdateCharactersticValueCurrency(CharactersticValueCurrency argCharactersticValueCurrency, DataAccess da, List <ErrorHandler> lstErr)
        {
            SqlParameter[] param = new SqlParameter[7];
            param[0] = new SqlParameter("@idCharactersticsValue", argCharactersticValueCurrency.idCharactersticsValue);
            param[1] = new SqlParameter("@CharactersticsName", argCharactersticValueCurrency.CharactersticsName);
            param[2] = new SqlParameter("@CharactersticsValue", argCharactersticValueCurrency.CharactersticsValue);
            param[3] = new SqlParameter("@ClientCode", argCharactersticValueCurrency.ClientCode);

            param[4]           = new SqlParameter("@Type", SqlDbType.Char);
            param[4].Size      = 1;
            param[4].Direction = ParameterDirection.Output;

            param[5]           = new SqlParameter("@Message", SqlDbType.VarChar);
            param[5].Size      = 255;
            param[5].Direction = ParameterDirection.Output;

            param[6]           = new SqlParameter("@returnvalue", SqlDbType.VarChar);
            param[6].Size      = 20;
            param[6].Direction = ParameterDirection.Output;
            int i = da.NExecuteNonQuery("Proc_UpdateCharactersticValueCurrency", param);


            string strMessage  = Convert.ToString(param[5].Value);
            string strType     = Convert.ToString(param[4].Value);
            string strRetValue = Convert.ToString(param[6].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     = "";
            objErrorHandler.ReturnValue = strRetValue;
            lstErr.Add(objErrorHandler);
        }
        public ICollection <CharactersticValueCurrency> colGetCharactersticValueCurrency(string argClientCode)
        {
            List <CharactersticValueCurrency> lst = new List <CharactersticValueCurrency>();
            DataSet DataSetToFill = new DataSet();
            CharactersticValueCurrency tCharactersticValueCurrency = new CharactersticValueCurrency();

            DataSetToFill = this.GetCharactersticValueCurrency(argClientCode);

            if (DataSetToFill != null)
            {
                foreach (DataRow dr in DataSetToFill.Tables[0].Rows)
                {
                    lst.Add(objCreateCharactersticValueCurrency(dr));
                }
            }
            goto Finish;

Finish:
            DataSetToFill = null;


            return(lst);
        }
        public void SaveCharactersticsValueMaster(CharactersticsValueMaster argCharactersticsValueMaster, DataAccess da, List <ErrorHandler> lstErr)
        {
            int strRetValue = -1;

            try
            {
                if (blnIsCharactersticsValueMasterExists(argCharactersticsValueMaster.ObjectKey, argCharactersticsValueMaster.ObjectTable, argCharactersticsValueMaster.ClientCode, da) == false)
                {
                    strRetValue = InsertCharactersticsValueMaster(argCharactersticsValueMaster, da, lstErr);
                }
                else
                {
                    DataSet ds = new DataSet();
                    ds = GetCharactersticsValueMaster(argCharactersticsValueMaster.ObjectKey, argCharactersticsValueMaster.ObjectTable, argCharactersticsValueMaster.ClientCode, da);

                    if (ds != null)
                    {
                        strRetValue = Convert.ToInt32(ds.Tables[0].Rows[0]["idCharactersticsValue"]);
                    }
                    //strRetValue =  UpdateCharactersticsValueMaster(argCharactersticsValueMaster, da, lstErr);
                }

                if (strRetValue > 0)
                {
                    if (argCharactersticsValueMaster.CharValuetype.Trim() == "CHAR")
                    {
                        CharactersticValueChar        argCharactersticValueChar        = new CharactersticValueChar();
                        CharactersticValueCharManager argCharactersticValueCharManager = new CharactersticValueCharManager();

                        argCharactersticValueChar.idCharactersticsValue = strRetValue;
                        argCharactersticValueChar.CharactersticsName    = argCharactersticsValueMaster.CharactersticsName;
                        argCharactersticValueChar.CharactersticsValue   = argCharactersticsValueMaster.CharactersticsValue;
                        argCharactersticValueChar.ClientCode            = argCharactersticsValueMaster.ClientCode;

                        argCharactersticValueCharManager.SaveCharactersticValueChar(argCharactersticValueChar, da, lstErr);
                    }
                    else if (argCharactersticsValueMaster.CharValuetype.Trim() == "NUM")
                    {
                        CharactersticValueNumeric        argCharactersticValueNumeric        = new CharactersticValueNumeric();
                        CharactersticValueNumericManager argCharactersticValueNumericManager = new CharactersticValueNumericManager();

                        argCharactersticValueNumeric.idCharactersticsValue = strRetValue;
                        argCharactersticValueNumeric.CharactersticsName    = argCharactersticsValueMaster.CharactersticsName;
                        argCharactersticValueNumeric.CharactersticsValue   = Convert.ToDouble(argCharactersticsValueMaster.CharactersticsValue.Trim());
                        argCharactersticValueNumeric.ClientCode            = argCharactersticsValueMaster.ClientCode;

                        argCharactersticValueNumericManager.SaveCharactersticValueNumeric(argCharactersticValueNumeric, da, lstErr);
                    }
                    else if (argCharactersticsValueMaster.CharValuetype.Trim() == "CURRENCY")
                    {
                        CharactersticValueCurrency        argCharactersticValueCurrency        = new CharactersticValueCurrency();
                        CharactersticValueCurrencyManager argCharactersticValueCurrencyManager = new CharactersticValueCurrencyManager();

                        argCharactersticValueCurrency.idCharactersticsValue = strRetValue;
                        argCharactersticValueCurrency.CharactersticsName    = argCharactersticsValueMaster.CharactersticsName;
                        argCharactersticValueCurrency.CharactersticsValue   = Convert.ToInt32(argCharactersticsValueMaster.CharactersticsValue.Trim());
                        argCharactersticValueCurrency.ClientCode            = argCharactersticsValueMaster.ClientCode;

                        argCharactersticValueCurrencyManager.SaveCharactersticValueCurrency(argCharactersticValueCurrency, da, lstErr);
                    }
                }
            }
            catch (Exception ex)
            {
                objErrorHandler.Type       = ErrorConstant.strAboartType;
                objErrorHandler.MsgId      = 0;
                objErrorHandler.Module     = ErrorConstant.strInsertModule;
                objErrorHandler.ModulePart = ErrorConstant.strMasterModule;
                objErrorHandler.Message    = ex.Message.ToString();
                objErrorHandler.RowNo      = 0;
                objErrorHandler.FieldName  = "";
                objErrorHandler.LogCode    = "";
                lstErr.Add(objErrorHandler);
            }
        }