public bool updateSupplier(Supplier s)
 {
     BusinessLogic.SupplierController BL = new BusinessLogic.SupplierController();
     if (BL.updateSupplier(s))
     {
         OutgoingWebResponseContext response = WebOperationContext.Current.OutgoingResponse;
         response.StatusCode = HttpStatusCode.OK;
         return true;
     }
     else
     {
         OutgoingWebResponseContext response = WebOperationContext.Current.OutgoingResponse;
         response.StatusCode = HttpStatusCode.NotFound;
         return false;
     }
 }
예제 #2
0
        }   //orderList Edit

        public string Edit(Model.Supplier supplier)
        {
            string sqlStr = "update Supplier set name=@name,area=@area,telephone=@telephone where supID=@supID";

            SqlParameter[] paras = new SqlParameter[] {
                new SqlParameter("@supID", supplier.SupID),
                new SqlParameter("@name", supplier.Name),
                new SqlParameter("@area", supplier.Area),
                new SqlParameter("@telephone", supplier.Telephone)
            };
            if (userDao.Edit(sqlStr, paras))
            {
                return("Success");
            }
            else
            {
                return("Fail");
            }
        }   //supplier Edit
예제 #3
0
        }   //machine Insert

        public string Insert(Model.Supplier supplier)
        {
            string sqlStr = "insert into Supplier(supID,name,area,telephone) values(@supID,@name,@area,@telephone)";

            SqlParameter[] paras = new SqlParameter[] {
                new SqlParameter("@supID", supplier.SupID),
                new SqlParameter("@name", supplier.Name),
                new SqlParameter("@area", supplier.Area),
                new SqlParameter("@telephone", supplier.Telephone)
            };
            if (userDao.Insert(sqlStr, paras))
            {
                return("Success");
            }
            else
            {
                return("Fail");
            }
        }   //supplier Insert