//public ICollection<ErrorHandler> SaveCharactersticValueNumeric(CharactersticValueNumeric argCharactersticValueNumeric)
        //{
        //    List<ErrorHandler> lstErr = new List<ErrorHandler>();
        //    DataAccess da = new DataAccess();
        //    try
        //    {
        //        if (blnIsCharactersticValueNumericExists(argCharactersticValueNumeric.idCharactersticsValue, argCharactersticValueNumeric.CharactersticsName, argCharactersticValueNumeric.ClientCode) == false)
        //        {

        //            da.Open_Connection();
        //            da.BEGIN_TRANSACTION();
        //            InsertCharactersticValueNumeric(argCharactersticValueNumeric, da, lstErr);
        //            foreach (ErrorHandler objerr in lstErr)
        //            {
        //                if (objerr.Type == "E")
        //                {
        //                    da.ROLLBACK_TRANSACTION();
        //                    return lstErr;
        //                }
        //            }
        //            da.COMMIT_TRANSACTION();

        //        }
        //        else
        //        {
        //            da.Open_Connection();
        //            da.BEGIN_TRANSACTION();
        //            UpdateCharactersticValueNumeric(argCharactersticValueNumeric, da, lstErr);
        //            foreach (ErrorHandler objerr in lstErr)
        //            {
        //                if (objerr.Type == "E")
        //                {
        //                    da.ROLLBACK_TRANSACTION();
        //                    return lstErr;
        //                }
        //            }
        //            da.COMMIT_TRANSACTION();
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        if (da != null)
        //        {
        //            da.ROLLBACK_TRANSACTION();
        //        }
        //        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);
        //    }
        //    finally
        //    {
        //        if (da != null)
        //        {
        //            da.Close_Connection();
        //            da = null;
        //        }
        //    }
        //    return lstErr;
        //}

        public void SaveCharactersticValueNumeric(CharactersticValueNumeric argCharactersticValueNumeric, DataAccess da, List <ErrorHandler> lstErr)
        {
            try
            {
                if (blnIsCharactersticValueNumericExists(argCharactersticValueNumeric.idCharactersticsValue, argCharactersticValueNumeric.CharactersticsName, argCharactersticValueNumeric.ClientCode, da) == false)
                {
                    InsertCharactersticValueNumeric(argCharactersticValueNumeric, da, lstErr);
                }
                else
                {
                    UpdateCharactersticValueNumeric(argCharactersticValueNumeric, 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 CharactersticValueNumeric objCreateCharactersticValueNumeric(DataRow dr)
        {
            CharactersticValueNumeric tCharactersticValueNumeric = new CharactersticValueNumeric();

            tCharactersticValueNumeric.SetObjectInfo(dr);

            return(tCharactersticValueNumeric);
        }
        public CharactersticValueNumeric objGetCharactersticValueNumeric(int argidCharactersticsValue, string argCharactersticsName, string argClientCode)
        {
            CharactersticValueNumeric argCharactersticValueNumeric = new CharactersticValueNumeric();
            DataSet DataSetToFill = new DataSet();

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

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

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

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

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

            argCharactersticValueNumeric = this.objCreateCharactersticValueNumeric((DataRow)DataSetToFill.Tables[0].Rows[0]);

            goto Finish;

ErrorHandlers:

Finish:
            DataSetToFill = null;


            return(argCharactersticValueNumeric);
        }
        public void UpdateCharactersticValueNumeric(CharactersticValueNumeric argCharactersticValueNumeric, DataAccess da, List <ErrorHandler> lstErr)
        {
            SqlParameter[] param = new SqlParameter[7];
            param[0] = new SqlParameter("@idCharactersticsValue", argCharactersticValueNumeric.idCharactersticsValue);
            param[1] = new SqlParameter("@CharactersticsName", argCharactersticValueNumeric.CharactersticsName);
            param[2] = new SqlParameter("@CharactersticsValue", argCharactersticValueNumeric.CharactersticsValue);
            param[3] = new SqlParameter("@ClientCode", argCharactersticValueNumeric.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_UpdateCharactersticValueNumeric", 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 <CharactersticValueNumeric> colGetCharactersticValueNumeric(string argClientCode)
        {
            List <CharactersticValueNumeric> lst = new List <CharactersticValueNumeric>();
            DataSet DataSetToFill = new DataSet();
            CharactersticValueNumeric tCharactersticValueNumeric = new CharactersticValueNumeric();

            DataSetToFill = this.GetCharactersticValueNumeric(argClientCode);

            if (DataSetToFill != null)
            {
                foreach (DataRow dr in DataSetToFill.Tables[0].Rows)
                {
                    lst.Add(objCreateCharactersticValueNumeric(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);
            }
        }