コード例 #1
0
        public void SaveTest()
        {
            CommodityImpl target = new CommodityImpl(); // TODO: Initialize to an appropriate value
            string recEmpId = "lk"; // TODO: Initialize to an appropriate value
            DateTime recDate = DateTime.Parse("2010-12-2"); // TODO: Initialize to an appropriate value
            List<PurRecEntity> recs = new List<PurRecEntity>(); // TODO: Initialize to an appropriate value

            PurRecEntity purRecEntity = new PurRecEntity(); // TODO: Initialize to an appropriate value
            purRecEntity.OrderId = "1";
            purRecEntity.DetailId = 11;
            purRecEntity.CommId = "111";
            purRecEntity.AmountReceiving = 2;
            purRecEntity.Remark = "remarkkkkk";

            recs.Add(purRecEntity);

            purRecEntity = new PurRecEntity();
            purRecEntity.OrderId = "1";
            purRecEntity.DetailId = 12;
            purRecEntity.CommId = "112";
            purRecEntity.AmountReceiving = 2;
            recs.Add(purRecEntity);

            target.POSaveRecv(recEmpId, recDate, recs);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
コード例 #2
0
        public void addPurRecvItemTest()
        {
            CommodityImpl_Accessor target = new CommodityImpl_Accessor(); // TODO: Initialize to an appropriate value
            PurRecEntity purRecEntity = new PurRecEntity(); // TODO: Initialize to an appropriate value
            purRecEntity.OrderId = "1";
            purRecEntity.DetailId = 11;
            purRecEntity.CommId = "111";
            purRecEntity.AmountReceiving = 2;
            purRecEntity.ReceivingEmp = "lk";
            purRecEntity.ReveivingDate = "2010-12-10";
            purRecEntity.Remark = "remarkkkkk";

            target.addPurRecvItem(purRecEntity);
        }
コード例 #3
0
ファイル: ComdDAO.cs プロジェクト: marcpiulachs/noahylk
        public List<PurRecEntity> SearchPurRecvListByOrderID(string strPurchaseOrderID)
        {
            List<PurRecEntity> purRecEntityList = new List<PurRecEntity>();

            string sqlStr = dbUtil.getSqlStatement("SQL_Comd_PurchaseReceiveList_SearchByOrderID");
            SqlParameter[] sqlParms = {
                new SqlParameter("@PurchaseOrderID",SqlDbType.VarChar,20)
            };
            sqlParms[0].Value = strPurchaseOrderID;

            DataSet searchResult = null;
            try
            {
                searchResult = DAO.DBAccess.ExecuteAdapter(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, sqlParms);
                foreach (DataTable dt in searchResult.Tables)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        PurRecEntity purRecEntity = new PurRecEntity();

                        purRecEntity.OrderId = dr["PurchaseOrderID"].ToString();
                        purRecEntity.DetailId = Convert.ToInt32(dr["PurchaseOrderDetailID"]);
                        purRecEntity.CommId = dr["ComdID"].ToString();
                        purRecEntity.CommName = dr["ComdName"].ToString();
                        purRecEntity.Standard = dr["ComdStandard"].ToString();
                        purRecEntity.Unit = dr["Unit"].ToString();

                        purRecEntity.AmountTotal = Convert.ToInt32(dr["amountTotal"]);
                        purRecEntity.AmountReceived = Convert.ToInt32(dr["amountReceived"]);
                        purRecEntity.AmountReceiving = 0;

                        purRecEntity.Remark = dr["Remark"].ToString();
                        purRecEntity.ReceivingEmp = dr["ReceivingEmp"].ToString();
                        purRecEntity.ReveivingDate = dr["ReveivingDate"].ToString();

                        purRecEntityList.Add(purRecEntity);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new DAOException("E0001");
            }

            return purRecEntityList;
        }
コード例 #4
0
ファイル: ComdDAO.cs プロジェクト: marcpiulachs/noahylk
        public int AddPurchaseReceiving(PurRecEntity purRecEntity, string currentUser)
        {
            string sqlStr = dbUtil.getSqlStatement("SQL_Comd_PurchaseReceiving_Insert");

            SqlParameter[] sqlParms = {
                new SqlParameter("@PurchaseOrderID",SqlDbType.VarChar,20),
                new SqlParameter("@PurchaseOrderDetailID",SqlDbType.VarChar,20),
                new SqlParameter("@ComdID",SqlDbType.VarChar,20),
                new SqlParameter("@amount",SqlDbType.Int),
                new SqlParameter("@ReceivingEmp",SqlDbType.VarChar,20),
                new SqlParameter("@ReveivingDate",SqlDbType.VarChar,10),
                new SqlParameter("@Remark",SqlDbType.NVarChar,800),
                new SqlParameter("@CreateUser",SqlDbType.VarChar,20),
                new SqlParameter("@UpdateUser",SqlDbType.VarChar,20)
            };

            sqlParms[0].Value = purRecEntity.OrderId;
            sqlParms[1].Value = purRecEntity.DetailId;
            sqlParms[2].Value = purRecEntity.CommId;
            sqlParms[3].Value = purRecEntity.AmountReceiving;
            sqlParms[4].Value = purRecEntity.ReceivingEmp;
            sqlParms[5].Value = purRecEntity.ReveivingDate;
            sqlParms[6].Value = purRecEntity.Remark;
            sqlParms[7].Value = currentUser;
            sqlParms[8].Value = currentUser;

            int resultCount = 0;
            try
            {
                resultCount = (int)DAO.DBAccess.ExecuteNonQuery(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, sqlParms);
            }
            catch (Exception ex)
            {
                throw new DAOException("E0001");
            }
            return resultCount;
        }
コード例 #5
0
ファイル: CommodityImpl.cs プロジェクト: marcpiulachs/noahylk
 private void addPurRecvItem(PurRecEntity purRecEntity)
 {
     try
     {
         int resultCount = 0;
         resultCount = comdDAO.AddPurchaseReceiving(purRecEntity, this.currentUser);
         if (resultCount == 0)
         {
             throw new DAOException("E0001");
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }