Example #1
0
 public Size getby_size_ID(string _ma_size, ref string errMsg)
 {
     try
     {
         string sqlstr = "select * from Size where  MaSize like  N'" + _ma_size + "'";
         IDataReader dr = SQLExecute.getIDataReader(sqlstr, ref errMsg);
         Size obj = new Size();
         obj = (Size)CBO.FillObject(dr, typeof(Size));
         return obj;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #2
0
        public int save_Size(Size vsize, ref string errMsg)
        {
            try
            {
                errMsg = "";
                int i = 0;
                int result = 0;
                SqlParameter[] prms = new SqlParameter[4];
                prms[i] = new SqlParameter("@MaSize", vsize.Masize);
                i = i + 1;
                prms[i] = new SqlParameter("@Size", vsize.Size1);
                i = i + 1;
                prms[i] = new SqlParameter("@outreturn", SqlDbType.Int, 1);
                prms[i].Direction = ParameterDirection.Output;

                result = SQLExecute.ExcuteSPOutput("[dbo].[sp_save_Size]", ref prms, 3, ref errMsg, "@outreturn");

                return result;
            }
            catch (Exception ex)
            {
                errMsg = ex.Message;
                return 0;
            }
        }