Пример #1
0
        //Update
        public bool UpdateStdNarration(eSunSpeedDomain.StdNarrationMasterModel objSNM)
        {
            string Query     = string.Empty;
            bool   isUpdated = true;

            try
            {
                DBParameterCollection paramCollection = new DBParameterCollection();

                paramCollection.Add(new DBParameter("@Vouchertype", objSNM.Vouchertype));
                paramCollection.Add(new DBParameter("@Narration", objSNM.Narration));
                paramCollection.Add(new DBParameter("@ModifiedBy", "Admin"));
                paramCollection.Add(new DBParameter("@ModifiedDate", DateTime.Now));
                paramCollection.Add(new DBParameter("@SN_Id", objSNM.SN_Id));

                Query = "UPDATE StdNarrationMaster SET [Vouchertype]=@Vouchertype,[Narration]=@Narration,[ModifiedBy]=@ModifiedBy,[ModifiedDate]=@ModifiedDate " +
                        "WHERE SN_Id=@SN_Id;";

                if (_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0)
                {
                    isUpdated = true;
                }
            }
            catch (Exception ex)
            {
                isUpdated = false;
                throw ex;
            }

            return(isUpdated);
        }
Пример #2
0
        //Save
        public bool SaveStdNarration(eSunSpeedDomain.StdNarrationMasterModel objSNM)
        {
            string Query   = string.Empty;
            bool   isSaved = true;

            try
            {
                DBParameterCollection paramCollection = new DBParameterCollection();

                paramCollection.Add(new DBParameter("@Vouchertype", objSNM.Vouchertype));
                paramCollection.Add(new DBParameter("@Narration", objSNM.Narration));
                paramCollection.Add(new DBParameter("@CreatedBy", "Admin"));

                Query = "INSERT INTO StdNarrationMaster(`Vouchertype`,`Narration`,`CreatedBy`) " +
                        "VALUES(@Vouchertype,@Narration,@CreatedBy)";

                if (_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0)
                {
                    isSaved = true;
                }
            }
            catch (Exception ex)
            {
                isSaved = false;
                throw ex;
            }

            return(isSaved);
        }