private GLAccountGroups objCreateGLAccountGroups(DataRow dr)
        {
            GLAccountGroups tGLAccountGroups = new GLAccountGroups();

            tGLAccountGroups.SetObjectInfo(dr);

            return(tGLAccountGroups);
        }
        public void UpdateGLAccountGroups(GLAccountGroups argGLAccountGroups, DataAccess da, List <ErrorHandler> lstErr)
        {
            SqlParameter[] param = new SqlParameter[11];
            param[0] = new SqlParameter("@ChartACCode", argGLAccountGroups.ChartACCode);
            param[1] = new SqlParameter("@ActGroup", argGLAccountGroups.ActGroup);
            param[2] = new SqlParameter("@GroupName", argGLAccountGroups.GroupName);
            param[3] = new SqlParameter("@FromSRNO", argGLAccountGroups.FromSRNO);
            param[4] = new SqlParameter("@ToSRNO", argGLAccountGroups.ToSRNO);
            param[5] = new SqlParameter("@ClientCode", argGLAccountGroups.ClientCode);
            param[6] = new SqlParameter("@CreatedBy", argGLAccountGroups.CreatedBy);
            param[7] = new SqlParameter("@ModifiedBy", argGLAccountGroups.ModifiedBy);


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

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

            param[10]           = new SqlParameter("@returnvalue", SqlDbType.VarChar);
            param[10].Size      = 20;
            param[10].Direction = ParameterDirection.Output;

            int i = da.NExecuteNonQuery("Proc_UpdateGLAccountGroups", param);


            string strMessage  = Convert.ToString(param[9].Value);
            string strType     = Convert.ToString(param[8].Value);
            string strRetValue = Convert.ToString(param[10].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 GLAccountGroups objGetGLAccountGroups(string argChartACCode, string argActGroup, string argClientCode)
        {
            GLAccountGroups argGLAccountGroups = new GLAccountGroups();
            DataSet         DataSetToFill      = new DataSet();

            if (argChartACCode.Trim() == "")
            {
                goto ErrorHandler;
            }

            if (argActGroup.Trim() == "")
            {
                goto ErrorHandler;
            }

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

            DataSetToFill = this.GetGLAccountGroups(argChartACCode, argActGroup, argClientCode);

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

            argGLAccountGroups = this.objCreateGLAccountGroups((DataRow)DataSetToFill.Tables[0].Rows[0]);

            goto Finish;

ErrorHandler:

Finish:
            DataSetToFill = null;


            return(argGLAccountGroups);
        }
        public ICollection <GLAccountGroups> colGetGLAccountGroups(string argClientCode)
        {
            List <GLAccountGroups> lst       = new List <GLAccountGroups>();
            DataSet         DataSetToFill    = new DataSet();
            GLAccountGroups tGLAccountGroups = new GLAccountGroups();

            DataSetToFill = this.GetGLAccountGroups(argClientCode);

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

Finish:
            DataSetToFill = null;


            return(lst);
        }
        public ICollection <ErrorHandler> SaveGLAccountGroups(GLAccountGroups argGLAccountGroups)
        {
            List <ErrorHandler> lstErr = new List <ErrorHandler>();
            DataAccess          da     = new DataAccess();

            try
            {
                if (blnIsGLAccountGroupsExists(argGLAccountGroups.ChartACCode, argGLAccountGroups.ActGroup, argGLAccountGroups.ClientCode) == false)
                {
                    da.Open_Connection();
                    da.BEGIN_TRANSACTION();
                    InsertGLAccountGroups(argGLAccountGroups, 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();
                    UpdateGLAccountGroups(argGLAccountGroups, 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);
        }