示例#1
0
        public int AddMix(string billNo, DataRow newRow)
        {
            int result = 1;
            using (PersistentManager pm = new PersistentManager())
            {
                ProductStateDao psDao = new ProductStateDao();
                try
                {
                    pm.BeginTransaction();
                    result = psDao.UpdateMix(billNo, newRow["MIXID"].ToString(), Convert.ToDouble(newRow["QUANTITY"]));
                    if (result != 1)
                        throw new Exception("����������Ϊ1");

                    result = psDao.UpdateMixID(billNo, newRow["PRODUCTCODE"].ToString(), newRow["ITEMNO"].ToString(), newRow["MIXID"].ToString());
                    if (result != 1)
                        throw new Exception("����������Ϊ1");

                    pm.Commit();
                }
                catch
                {
                    pm.Rollback();
                }
            }
            return result;
        }