Ejemplo n.º 1
0
        //Update Reference Group
        public bool UpdateReferenceGroup(eSunSpeedDomain.ReferenceGroupModel objrefGrp)
        {
            string Query    = string.Empty;
            bool   IsUpdate = false;

            DBParameterCollection paramCollection = new DBParameterCollection();

            try
            {
                paramCollection.Add(new DBParameter("@Name", objrefGrp.Name));
                paramCollection.Add(new DBParameter("@CreatedBy", string.Empty));
                paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now, System.Data.DbType.DateTime));
                paramCollection.Add(new DBParameter("@ModifiedBy", "Admin"));
                paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now, System.Data.DbType.DateTime));
                paramCollection.Add(new DBParameter("@ReferenceId", objrefGrp.ReferenceId));
                Query = "UPDATE Referencegroup SET Name=@Name,CreatedBy=@CreatedBy,CreatedDate=@CreatedDate,ModifiedBy=@ModifiedBy,ModifiedDate=@ModifiedDate " +
                        "WHERE RG_ID=@ReferenceId";

                if (_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0)
                {
                    IsUpdate = true;
                }
            }
            catch (Exception ex)
            {
                IsUpdate = false;
                throw ex;
            }
            return(IsUpdate);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Save Reference Group
        /// </summary>
        /// <param name="objReferenceGroup"></param>
        /// <returns>True/False</returns>
        public bool SaveReferenceGroup(eSunSpeedDomain.ReferenceGroupModel objrefGrp)
        {
            string Query   = string.Empty;
            bool   IsSaved = false;

            DBParameterCollection paramCollection = new DBParameterCollection();

            try
            {
                paramCollection.Add(new DBParameter("@Name", objrefGrp.Name));
                paramCollection.Add(new DBParameter("@CreatedBy", "Admin"));
                paramCollection.Add(new DBParameter("@CreatedDate", DateTime.Now, System.Data.DbType.DateTime));
                paramCollection.Add(new DBParameter("@ModifiedBy", string.Empty));
                paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now, System.Data.DbType.DateTime));
                Query = "INSERT INTO Referencegroup(`Name`,`CreatedBy`,`CreatedDate`,`ModifiedBy`,`ModifiedDate`) VALUES (@Name,@CreatedBy,@CreatedDate,@ModifiedBy,@ModifiedDate)";

                if (_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0)
                {
                    IsSaved = true;
                }
            }
            catch (Exception ex)
            {
                IsSaved = false;
                throw ex;
            }
            return(IsSaved);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Save Account Group
        /// </summary>
        /// <param name="objAccountGrp"></param>
        /// <returns>True/False</returns>
        public bool SaveReferenceGroup(eSunSpeedDomain.ReferenceGroupModel objrefGrp)
        {
            string Query = string.Empty;

            DBParameterCollection paramCollection = new DBParameterCollection();

            paramCollection.Add(new DBParameter("@Name", objrefGrp.Name));
            //paramCollection.Add(new DBParameter("@AliasName", objAccountGrp.AliasName));
            //paramCollection.Add(new DBParameter("@Primary", objAccountGrp.Primary));
            //paramCollection.Add(new DBParameter("@UnderGroup", objAccountGrp.UnderGroup));
            paramCollection.Add(new DBParameter("@CreatedBy", "Admin"));

            Query = "INSERT INTO Referencegroup(`Name`,`CreatedBy`) VALUES (@Name,@CreatedBy)";

            return(_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0);
        }