Exemplo n.º 1
0
        public int AddNewGroupOfGoods(GroupOfGoodsInfo groupOfGoodsInfo)
        {
            string strSQL = "INSERT INTO GroupOfGoods VALUES(@GOGID, @GOGName, @Note)";
            int    nRow   = 0;

            try
            {
                nRow = dB.ExecuteNonQuery(CommandType.Text, strSQL,
                                          new SqlParameter {
                    ParameterName = "@GOGID", Value = groupOfGoodsInfo.GOGID
                },
                                          new SqlParameter {
                    ParameterName = "@GOGName", Value = groupOfGoodsInfo.GOGName
                },
                                          new SqlParameter {
                    ParameterName = "@Note", Value = groupOfGoodsInfo.Note
                }
                                          );
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            return(nRow);
        }
Exemplo n.º 2
0
        public GroupOfGoodsInfo LoadInfo(int id)
        {
            string           sqlStr           = string.Format("SELECT * FROM GroupOfGoods WHERE GOGID = {0}", id);
            DataTable        dt               = dB.getData(sqlStr);
            GroupOfGoodsInfo groupOfGoodsInfo = new GroupOfGoodsInfo
            {
                GOGID   = int.Parse(dt.Rows[0]["GOGID"].ToString()),
                GOGName = dt.Rows[0]["GOGName"].ToString(),
                Note    = dt.Rows[0]["Note"].ToString(),
            };

            return(groupOfGoodsInfo);
        }
Exemplo n.º 3
0
        public int UpdateGroupOfGoods(GroupOfGoodsInfo groupOfGoodsInfo)
        {
            string strSQL = "UpdateGroupOfGoods";
            int    nRow   = 0;

            nRow = dB.ExecuteNonQuery(CommandType.StoredProcedure, strSQL,
                                      new SqlParameter {
                ParameterName = "@GOGID", Value = groupOfGoodsInfo.GOGID
            },
                                      new SqlParameter {
                ParameterName = "@GOGName", Value = groupOfGoodsInfo.GOGName
            },
                                      new SqlParameter {
                ParameterName = "@Note", Value = groupOfGoodsInfo.Note
            }
                                      );
            return(nRow);
        }
Exemplo n.º 4
0
 public int AddNewGroupOfGoods(GroupOfGoodsInfo groupOfGoodsInfo)
 {
     return(groupOfGoodsDAO.AddNewGroupOfGoods(groupOfGoodsInfo));
 }
Exemplo n.º 5
0
 public int UpdateGroupOfGoods(GroupOfGoodsInfo groupOfGoodsInfo)
 {
     return(groupOfGoodsDAO.UpdateGroupOfGoods(groupOfGoodsInfo));
 }